Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/lessons/aerodynamics/bernoulli/lesson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ challenges:
- check: 'v1/ratio'
target: 20
tol: 2
- check: '0.6125*v1^2*(1/ratio^2-1)'
- check: '0.6*v1^2*(1/ratio^2-1)'
target: 500
tol: 50
- check: 'v1/ratio < 15 and 0.6125*v1^2*(1/ratio^2-1) > 100'
- check: 'v1/ratio < 15 and 0.6*v1^2*(1/ratio^2-1) > 100'
2 changes: 1 addition & 1 deletion content/lessons/aerodynamics/gliding-and-glide-ratio/ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ variables:

## Real-life examples

1. **طائرة من الورق تُرمى من فوق مكتب.** أُطلقت من ارتفاع 1.5 m بنسبة انزلاق نحو 4. تقطع نحو 6 أمتار قبل أن تلامس الأرض: انزلاق قصير شديد الانحدار.
1. **طائرة من الورق تُرمى من فوق مكتب.** أُطلقت من ارتفاع 1 m بنسبة انزلاق نحو 4. تقطع نحو 4 أمتار قبل أن تلامس الأرض: انزلاق قصير شديد الانحدار.
2. **طائرة شراعية أُطلقت من ارتفاع 1000 m.** بنسبة انزلاق نحو 30، تستطيع قطع نحو 30 كم قبل الهبوط. يعتمد التحليق الشراعي عبر المسافات على هذا الرقم بالضبط.
3. **طائرة عريضة الجسم فقدت محركيها من ارتفاع 12500 m.** بنسبة انزلاق نحو 15، تستطيع نظريًا قطع 187 كم في خط مستقيم. حالات انزلاق حقيقية مشهورة بعد فقدان المحرك قطعت مسافة أقل قليلًا، لأن الطاقم اضطر أيضًا للمناورة والتخلص من ارتفاع زائد قبل الهبوط.

Expand Down
2 changes: 1 addition & 1 deletion content/lessons/aerodynamics/gliding-and-glide-ratio/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variables:

## Real-life examples

1. **A paper aeroplane from a desk.** Released 1.5 m up with a glide ratio around 4, it covers roughly 6 m before touching down — a steep, short glide.
1. **A paper aeroplane from a desk.** Released 1 m up with a glide ratio around 4, it covers roughly 4 m before touching down — a steep, short glide.
2. **A sailplane released at 1,000 m.** With a glide ratio of about 30, it can cover roughly 30 km before landing — cross-country soaring depends on exactly this number.
3. **A widebody jet with both engines out, from 12,500 m.** At a clean glide ratio of about 15, it could in theory cover a straight-line 187 km — famous real engine-out glides have covered somewhat less, because the crew also had to manoeuvre to lose extra height before landing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ derivation:
charts: []
presets:
- LD: 4
h: 1.5
h: 1
- LD: 30
h: 1000
- LD: 15
Expand Down
8 changes: 4 additions & 4 deletions content/lessons/aerodynamics/helicopters-and-rotors/ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ variables:

## Try it

1. ابدأ بالقيم الظاهرة: هليكوبتر خفيفة، «نصف قطر الدوّار R» يساوي 3.84 m و«وزن الطائرة W» يساوي 6076 N. تحلّق ثابتة و«ميل الدوّار» عند 0°.
2. اقرأ سرعة تيار الهواء الهابط v_i = 7.32 m/s وقدرة التحليق الثابت P = 44.5 kW. كلاهما تقدير، لكنه واقعي.
3. اسحب «ميل الدوّار» إلى الأمام حتى 12°. يصعد الدفع الكلي T من 6076 N إلى 6212 N. القرص كله، لا جسم الطائرة، يميل ليدفع الطائرة إلى الأمام.
1. ابدأ بالقيم الظاهرة: هليكوبتر خفيفة، «نصف قطر الدوّار R» يساوي 3.8 m و«وزن الطائرة W» يساوي 6075 N. تحلّق ثابتة و«ميل الدوّار» عند 0°.
2. اقرأ سرعة تيار الهواء الهابط v_i = 7.39 m/s وقدرة التحليق الثابت P = 44.9 kW. كلاهما تقدير، لكنه واقعي.
3. اسحب «ميل الدوّار» إلى الأمام حتى 12°. يصعد الدفع الكلي T من 6075 N إلى 6211 N. القرص كله، لا جسم الطائرة، يميل ليدفع الطائرة إلى الأمام.

## Real-life examples

1. **هليكوبتر خفيفة تحلّق ثابتة.** دوّار نصف قطره 3.84 m يرفع 6076 N. يدفع الهواء إلى الأسفل بنحو 7.3 m/s، ويحتاج نحو 44 kW من القدرة المثالية للتحليق الثابت. محرك هليكوبتر حقيقية يغطي أيضًا خسائر يتجاهلها هذا التقدير.
1. **هليكوبتر خفيفة تحلّق ثابتة.** دوّار نصف قطره 3.8 m يرفع 6075 N. يدفع الهواء إلى الأسفل بنحو 7.4 m/s، ويحتاج نحو 45 kW من القدرة المثالية للتحليق الثابت. محرك هليكوبتر حقيقية يغطي أيضًا خسائر يتجاهلها هذا التقدير.
2. **هليكوبتر رفع ثقيل تحلّق ثابتة.** دوّار نصف قطره 16 m يرفع نحو 550000 N. ما زال يدفع الهواء بنحو 16.7 m/s فقط، أكثر بقليل من ضعف تيار الهواء الهابط للهليكوبتر الخفيفة، رغم أنها ترفع وزنًا يقارب 100 ضعف، لأن قرصها أكبر بكثير.
3. **الهليكوبتر الخفيفة تميل للأمام لتطير بسرعة.** أمِل الدوّار نفسه 12° للأمام. ليستمر بحمل الوزن نفسه، يجب أن يرتفع الدفع الكلي بنحو 2%، تكلفة إضافية صغيرة لكنها حقيقية للطيران بسرعة.

Expand Down
8 changes: 4 additions & 4 deletions content/lessons/aerodynamics/helicopters-and-rotors/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ variables:

## Try it

1. Start with the values on screen: a small helicopter, «rotor radius R» 3.84 m, «aircraft weight W» 6,076 N, hovering with «rotor tilt» at 0°.
2. Read the downwash speed v_i = 7.32 m/s and the hover power P = 44.5 kW — both are estimates, but realistic ones.
3. Drag «rotor tilt» forward to 12°. Total thrust T climbs from 6076 N to 6212 N, and the whole disc — not the fuselage — leans to push the aircraft ahead.
1. Start with the values on screen: a small helicopter, «rotor radius R» 3.8 m, «aircraft weight W» 6,075 N, hovering with «rotor tilt» at 0°.
2. Read the downwash speed v_i = 7.39 m/s and the hover power P = 44.9 kW — both are estimates, but realistic ones.
3. Drag «rotor tilt» forward to 12°. Total thrust T climbs from 6075 N to 6211 N, and the whole disc — not the fuselage — leans to push the aircraft ahead.

## Real-life examples

1. **A light helicopter hovering.** A 3.84 m rotor lifting 6,076 N pushes air down at roughly 7.3 m/s and needs on the order of 44 kW of ideal power to hover — a real light helicopter's engine also has to cover losses this estimate ignores.
1. **A light helicopter hovering.** A 3.8 m rotor lifting 6,075 N pushes air down at roughly 7.4 m/s and needs on the order of 45 kW of ideal power to hover — a real light helicopter's engine also has to cover losses this estimate ignores.
2. **A heavy-lift helicopter hovering.** A 16 m rotor lifting nearly 550,000 N still only pushes air down at about 16.7 m/s — barely more than twice the light helicopter's downwash, despite lifting almost 100 times the weight, because its disc is so much bigger.
3. **The light helicopter tilted forward for cruise.** Tilt the same rotor 12° forward and, to keep supporting the same weight, total thrust has to rise by about 2% — a small but real extra cost of flying fast.

Expand Down
12 changes: 6 additions & 6 deletions content/lessons/aerodynamics/helicopters-and-rotors/lesson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ parameters:
min: 0.3
max: 16
step: 0.1
value: 3.84
value: 3.8
unit: m
W:
min: 5
max: 600000
step: 5
value: 6076
value: 6075
unit: N
tilt:
min: -15
Expand All @@ -48,14 +48,14 @@ derivation:
- P = T\, v_i
charts: []
presets:
- R: 3.84
W: 6076
- R: 3.8
W: 6075
tilt: 0
- R: 16
W: 548800
tilt: 0
- R: 3.84
W: 6076
- R: 3.8
W: 6075
tilt: 12
challenges:
- check: 'sqrt((W/cos(tilt*pi/180))/(2*1.225*pi*R^2))'
Expand Down
4 changes: 2 additions & 2 deletions content/lessons/aerodynamics/propellers-and-jets/ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ variables:

## Formal

الدفع بحسب نظرية الزخم هو $T = \dot m\, \Delta v$، حيث معدل التدفق الكتلي عبر قرص الدفع هو $\dot m = \rho A v$، أي الكثافة مضروبة في مساحة القرص وسرعة الهواء عبره.
الدفع بحسب نظرية الزخم هو $T = \dot m\, \Delta v$، حيث معدل التدفق الكتلي عبر قرص الدفع هو $\dot m = \rho A \left(v + \tfrac{\Delta v}{2}\right)$، أي الكثافة مضروبة في مساحة القرص وسرعة الهواء عبره. هذه السرعة تقع في منتصف المسافة بين سرعة الهواء الداخل $v$ وسرعة العادم $v + \Delta v$.

كفاءة الدفع المثالية هي قدرة الدفع المفيدة مقسومة على إجمالي القدرة الحركية المضافة إلى الهواء. تعطي هذه النسبة $\eta = \dfrac{2v}{2v + \Delta v}$. تنخفض نحو الصفر كلما كبرت $\Delta v$ بالنسبة لسرعة الطيران $v$، وترتفع نحو 100% كلما اقتربت $\Delta v \to 0$. لكن الدفع نفسه سينخفض حينها نحو الصفر أيضًا، فتوازن التصاميم الحقيقية بين الاثنين.

Expand All @@ -48,7 +48,7 @@ variables:

## Derivation

1. يسرّع المحرك كل ثانية كتلة هواء $\dot m = \rho A v$، أي الكثافة مضروبة في مساحة القرص وسرعة الهواء المتحرك عبره، بمقدار $\Delta v$.
1. يسرّع المحرك كل ثانية كتلة هواء $\dot m = \rho A \left(v + \tfrac{\Delta v}{2}\right)$، أي الكثافة مضروبة في مساحة القرص وسرعة الهواء المتحرك عبره، بمقدار $\Delta v$.
2. يقول قانون نيوتن الثاني إن القوة اللازمة لتغيير هذا القدر من الزخم كل ثانية هي $T = \dot m\,\Delta v$. وبحسب القانون الثالث يدفع الهواء المحرك بالقوة نفسها إلى الأمام، وهذا رد الفعل هو الدفع.
3. تحريك كتلة هواء ضخمة بمقدار $\Delta v$ صغير يصنع الدفع نفسه الذي تصنعه كتلة صغيرة بمقدار $\Delta v$ ضخم، لكنه يهدر طاقة حركية أقل بكثير في العادم. لهذا بالضبط تنخفض كفاءة الدفع $\eta = \dfrac{2v}{2v+\Delta v}$ كلما كبرت $\Delta v$.

Expand Down
4 changes: 2 additions & 2 deletions content/lessons/aerodynamics/propellers-and-jets/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ That trade matters because kinetic energy grows with speed squared, not speed. D

## Formal

Thrust from momentum theory is $T = \dot m\, \Delta v$, where the mass flow rate through the propulsor's disc is $\dot m = \rho A v$ (density times disc area times the air's speed through it).
Thrust from momentum theory is $T = \dot m\, \Delta v$, where the mass flow rate through the propulsor's disc is $\dot m = \rho A \left(v + \tfrac{\Delta v}{2}\right)$ (density times disc area times the air's speed through it, which is halfway between the incoming speed $v$ and the exhaust speed $v + \Delta v$).

The ideal propulsive efficiency — useful thrust power out, divided by total kinetic power put into the airflow — works out to $\eta = \dfrac{2v}{2v + \Delta v}$: it falls toward zero as $\Delta v$ grows relative to flight speed $v$, and rises toward 100% as $\Delta v \to 0$ (though thrust itself would then also fall toward zero, so real designs balance the two).

Expand All @@ -51,7 +51,7 @@ Real engines don't hit this ideal efficiency: extra losses come from the fan and

## Derivation

1. Each second, the engine accelerates a mass of air $\dot m = \rho A v$ (density times disc area times the speed of air moving through it) up by $\Delta v$.
1. Each second, the engine accelerates a mass of air $\dot m = \rho A \left(v + \tfrac{\Delta v}{2}\right)$ (density times disc area times the speed of air moving through it) up by $\Delta v$.
2. Newton's second law says the force needed to change that much momentum every second is $T = \dot m\,\Delta v$, and by the third law the air pushes back on the engine with the same force, forward: that reaction is thrust.
3. Moving a huge mass of air by a small $\Delta v$ makes the same thrust as moving a small mass by a huge $\Delta v$, but wastes far less kinetic energy in the exhaust — which is exactly why propulsive efficiency $\eta = \dfrac{2v}{2v+\Delta v}$ falls as $\Delta v$ grows.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ variables:
- \dot m
- \Delta v
derivation:
- \dot m = \rho A v
- \dot m = \rho A \left(v + \tfrac{\Delta v}{2}\right)
- T = \dot m\, \Delta v
- \eta = \dfrac{2v}{2v + \Delta v}
charts: []
Expand Down
2 changes: 1 addition & 1 deletion content/lessons/ai/attention/ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ variables:

## Formal

تُقاس الصلة بين الاستعلام $q$ ومفتاح كل كلمة $k_i$ بجداء نقطي، ثم تتحوّل إلى أوزان مجموعها واحد عبر Softmax: $a_i = \frac{\exp\!\big((q\cdot k_i)/T\big)}{\sum_j \exp\!\big((q\cdot k_j)/T\big)}$. المخرج يمزج قيمة كل كلمة $v_i$ بوزنها $a_i$.
تُقاس الصلة بين الاستعلام $q$ ومفتاح كل كلمة $k_i$ بجداء نقطي، ثم تتحوّل إلى أوزان مجموعها واحد عبر Softmax: $a_i = \frac{\exp\!\big((q\cdot k_i)/T\big)}{\sum_j \exp\!\big((q\cdot k_j)/T\big)}$. المخرج يمزج قيمة كل كلمة $v_i$ بوزنها $a_i$. في هذه الصورة يُقصَّر سهم كل كلمة أولًا إلى الطول 1، فيقيس الجداء النقطي فقط مدى اتفاق السهمين في الاتجاه (تشابه جيب التمام).

الحرارة $T$ تتحكّم في مدى حدّة تلك الأوزان. $T$ منخفضة تضع معظم الوزن على الكلمة الأعلى درجة وحدها، و$T$ مرتفعة توزّع الوزن بالتساوي تقريبًا على كل الكلمات مهما كانت درجتها، تمامًا كمنزلق الحرارة في التنبّؤ بالكلمة التالية.

Expand Down
2 changes: 1 addition & 1 deletion content/lessons/ai/attention/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ That blend is what attention computes. The current word asks a question (its que

## Formal

Relevance between the query $q$ and each word's key $k_i$ is scored by a dot product, then turned into weights that sum to one with a softmax: $a_i = \frac{\exp\!\big((q\cdot k_i)/T\big)}{\sum_j \exp\!\big((q\cdot k_j)/T\big)}$. The output blends every word's value $v_i$ by its weight $a_i$.
Relevance between the query $q$ and each word's key $k_i$ is scored by a dot product, then turned into weights that sum to one with a softmax: $a_i = \frac{\exp\!\big((q\cdot k_i)/T\big)}{\sum_j \exp\!\big((q\cdot k_j)/T\big)}$. The output blends every word's value $v_i$ by its weight $a_i$. In this picture every word arrow is first shrunk to length 1, so the dot product only measures how closely two arrows point the same way (cosine similarity).

The temperature $T$ controls how peaked those weights are: a low $T$ pushes almost all the weight onto the single highest-scoring word, a high $T$ spreads weight nearly evenly across every word regardless of score, exactly like the temperature slider in next-token prediction.

Expand Down
4 changes: 2 additions & 2 deletions content/lessons/ai/neural-network/lesson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ parameters:
min: -3
max: 3
step: 0.1
value: 1
value: -1
w31:
min: -3
max: 3
Expand Down Expand Up @@ -92,7 +92,7 @@ presets:
- w11: 1
w12: 1
w21: 1
w22: 1
w22: -1
w31: -1
w32: 1
v1: 1
Expand Down
12 changes: 6 additions & 6 deletions content/lessons/ai/tokenization/ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ variables:
## Try it

1. اضبط merges على 0 واقرأ الرقاقات: كل حرف رمز وحده، وعلامة ▁ تعني بداية كلمة، والعدّاد يُظهر 49 رمزًا. هكذا يقرأ نموذج لا معجم عنده: زحفًا، حرفًا حرفًا.
2. ارفع merges من 0 إلى 6 خطوة خطوة وشاهد القاعدة تعمل: تلتصق «▁th»، ثم «▁the»، ثم «▁cat» فتصير كل منها رقاقة واحدة، وتبقى الكلمات النادرة قطعًا. ينزل العدد من 49 إلى 31. وبعد 6 لا يتغيّر شيء، لأنه لم يبقَ زوج يتكرر مرتين.
3. أبقِ merges عند 10 واضبط text على 1 (الشيفرة) ثم 2 (العربية). الشيفرة تنزل من 38 رمزًا إلى 34 فقط لأنه لا يكاد يتكرر فيها شيء، والعربية تنزل من 44 إلى 32 حين تصير «▁القطة» رقاقة واحدة. الرقاقات تأتي من التكرار، ولهذا لا ينفع معجم نما على نوع من النصوص نوعًا آخر كما ينبغي.
2. ارفع merges من 0 إلى 6 خطوة خطوة وشاهد القاعدة تعمل: تلتصق «▁th»، ثم «▁the»، ثم «▁cat» فتصير كل منها رقاقة واحدة، وتبقى الكلمات النادرة قطعًا. ينزل العدد من 49 إلى 31. ويقف المنزلق عند 6، لأنه لم يبقَ بعدها زوج يتكرر مرتين.
3. أبقِ merges عند 6 واضبط text على 1 (الشيفرة) ثم 2 (العربية). الشيفرة تنزل من 38 رمزًا إلى 34 فقط لأنه لا يكاد يتكرر فيها شيء، والعربية تنزل من 44 إلى 32 حين تصير «▁القطة» رقاقة واحدة. الرقاقات تأتي من التكرار، ولهذا لا ينفع معجم نما على نوع من النصوص نوعًا آخر كما ينبغي.

## Real-life examples

- **جملة إنجليزية بلا معجم.** جملة القط تكلف 49 رمزًا، رمزًا لكل حرف. بهذا المعدل تغرق صفحة واحدة النموذج قبل أن يقول شيئًا.
- **الجملة نفسها بعد 25 دمجة.** الكلمتان المتكررتان «the» و«cat» صارتا رقاقتين مفردتين ونزل العدد من 49 إلى 31. ضغطٌ سببه التكرار وحده. والدمجات الست الأولى فقط هي التي عملت، فبعدها لم يبقَ في هذه الجملة القصيرة زوج يتكرر.
- **العربية عند 12 دمجة.** القاعدة تعمل على أي لغة، فتنزل هذه الجملة من 44 رمزًا إلى 32. لكن معجمًا تدرب على الإنجليزية أنفق رقاقاته هناك. لهذا تكلف الجملة نفسها رموزًا أكثر بلغات أخرى.
- **الجملة نفسها بعد 6 دمجات.** الكلمتان المتكررتان «the» و«cat» صارتا رقاقتين مفردتين ونزل العدد من 49 إلى 31. ضغطٌ سببه التكرار وحده. وبعد 6 دمجات لم يبقَ في هذه الجملة القصيرة زوج يتكرر، ولهذا يقف المنزلق هناك.
- **العربية عند 5 دمجات.** القاعدة تعمل على أي لغة، فتنزل هذه الجملة من 44 رمزًا إلى 32. لكن معجمًا تدرب على الإنجليزية أنفق رقاقاته هناك. لهذا تكلف الجملة نفسها رموزًا أكثر بلغات أخرى.

## Test yourself

1. اضبط الدمجات على صفر واقرأ جملة كما يقرؤها نموذج بلا معجم.
2. أعطِ الجملة الإنجليزية 25 دمجة على الأقل وشاهد كلمات كاملة تصير رقاقة واحدة.
3. خذ العينة العربية إلى 10 دمجات أو أكثر وقارن رقاقاتها برقاقات الإنجليزية.
2. أعطِ الجملة الإنجليزية الدمجات الست كلها وشاهد كلمات كاملة تصير رقاقة واحدة.
3. خذ العينة العربية إلى 5 دمجات أو أكثر وقارن رقاقاتها برقاقات الإنجليزية.

## Intuition

Expand Down
Loading
Loading