From c5f901250a5707ed4f9df471e686f11302e36198 Mon Sep 17 00:00:00 2001 From: ru44 <18311071+ru44@users.noreply.github.com> Date: Thu, 29 Oct 2026 11:05:51 +0300 Subject: [PATCH] =?UTF-8?q?=D8=AF=D8=B1=D8=B3=20=D8=AC=D8=AF=D9=8A=D8=AF?= =?UTF-8?q?=20=D9=81=D9=8A=20=D8=A7=D9=84=D9=83=D9=87=D8=B1=D8=A8=D8=A7?= =?UTF-8?q?=D8=A1:=20=D9=85=D8=AE=D8=B7=D8=B7=20=D8=B3=D9=85=D9=8A=D8=AB?= =?UTF-8?q?=D8=8C=20=D8=A7=D9=84=D8=AF=D8=A7=D8=A6=D8=B1=D8=A9=20=D8=A7?= =?UTF-8?q?=D9=84=D8=AA=D9=8A=20=D8=AA=D9=8F=D8=B1=D9=8A=20=D9=83=D9=85=20?= =?UTF-8?q?=D9=85=D9=86=20=D8=A7=D9=84=D8=A5=D8=B4=D8=A7=D8=B1=D8=A9=20?= =?UTF-8?q?=D9=8A=D8=B1=D8=AA=D8=AF=20=D8=B9=D9=86=20=D8=A7=D9=84=D9=87?= =?UTF-8?q?=D9=88=D8=A7=D8=A6=D9=8A.=20=D9=87=D9=88=D8=A7=D8=A6=D9=8A=20R?= =?UTF-8?q?=20+=20jX=20=D8=B9=D9=84=D9=89=20=D9=83=D8=A7=D8=A8=D9=84=2050?= =?UTF-8?q?=20=CE=A9=D8=8C=20=D9=88=D9=85=D8=B9=D8=A7=D9=85=D9=84=20=D8=A7?= =?UTF-8?q?=D9=84=D8=A7=D9=86=D8=B9=D9=83=D8=A7=D8=B3=20=CE=93=20=3D=20(Z?= =?UTF-8?q?=5FL=20=E2=88=92=20Z=5F0)/(Z=5FL=20+=20Z=5F0)=D8=8C=20=D9=88?= =?UTF-8?q?=D8=A7=D9=84=D9=82=D8=AF=D8=B1=D8=A9=20=D8=A7=D9=84=D9=85=D8=B1?= =?UTF-8?q?=D8=AA=D8=AF=D8=A9=20|=CE=93|=C2=B2=D8=8C=20=D9=88VSWR.=20?= =?UTF-8?q?=D8=A7=D9=84=D8=B1=D8=B3=D9=85=20=D8=A7=D9=84=D9=85=D8=B3=D8=B7?= =?UTF-8?q?=D8=AD=20=D9=87=D9=88=20=D9=85=D8=AE=D8=B7=D8=B7=20=D8=B3=D9=85?= =?UTF-8?q?=D9=8A=D8=AB=20=D9=86=D9=81=D8=B3=D9=87=20=D9=85=D8=B9=20=D8=B2?= =?UTF-8?q?=D8=B1=20=D9=8A=D9=81=D8=B1=D8=AF=D9=87=20=D8=A5=D9=84=D9=89=20?= =?UTF-8?q?=D8=B1=D8=B3=D9=85=20R=E2=80=93X=20=D8=A7=D9=84=D8=B9=D8=A7?= =?UTF-8?q?=D8=AF=D9=8A=20=D9=88=D9=8A=D8=B7=D9=88=D9=8A=D9=87=20=D9=85?= =?UTF-8?q?=D9=86=20=D8=AC=D8=AF=D9=8A=D8=AF=20=D9=81=D9=8A=D8=B1=D9=89=20?= =?UTF-8?q?=D8=A7=D9=84=D8=B7=D8=A7=D9=84=D8=A8=20=D9=85=D9=86=20=D8=A3?= =?UTF-8?q?=D9=8A=D9=86=20=D8=AC=D8=A7=D8=A1=D8=AA=20=D8=A7=D9=84=D8=AF?= =?UTF-8?q?=D9=88=D8=A7=D8=A6=D8=B1=20=D9=88=D8=A7=D9=84=D8=A3=D9=82=D9=88?= =?UTF-8?q?=D8=A7=D8=B3=20=D9=88=D8=A3=D9=8A=D9=86=20=D8=A7=D8=B3=D8=AA?= =?UTF-8?q?=D9=82=D8=B1=D8=AA=20=D8=A7=D9=84=D9=84=D8=A7=D9=86=D9=87=D8=A7?= =?UTF-8?q?=D9=8A=D8=A9=D8=8C=20=D9=88=D8=A8=D8=AC=D8=A7=D9=86=D8=A8=D9=87?= =?UTF-8?q?=20=D8=A7=D9=84=D9=83=D8=A7=D8=A8=D9=84=20=D9=85=D9=86=20=D9=81?= =?UTF-8?q?=D9=88=D9=82=20=D8=A8=D9=85=D9=88=D8=AC=D8=AA=D9=87=20=D8=A7?= =?UTF-8?q?=D9=84=D9=88=D8=A7=D9=82=D9=81=D8=A9=20=D9=88=D8=B4=D8=B1=D9=8A?= =?UTF-8?q?=D8=B7=20=D9=85=D8=A7=20=D9=8A=D8=B5=D9=84=20=D8=A5=D9=84=D9=89?= =?UTF-8?q?=20=D8=A7=D9=84=D9=87=D9=88=D8=A7=D8=A6=D9=8A=20=D9=88=D9=85?= =?UTF-8?q?=D8=A7=20=D9=8A=D8=B1=D8=AA=D8=AF=D8=8C=20=D9=88=D9=85=D9=86?= =?UTF-8?q?=D8=B2=D9=84=D9=82=20d=20=D9=8A=D9=85=D8=B4=D9=8A=20=D8=B9?= =?UTF-8?q?=D9=84=D9=89=20=D8=A7=D9=84=D9=83=D8=A7=D8=A8=D9=84=20=D9=81?= =?UTF-8?q?=D8=AA=D8=AF=D9=88=D8=B1=20=D8=A7=D9=84=D9=86=D9=82=D8=B7=D8=A9?= =?UTF-8?q?=20=D8=AF=D9=88=D8=B1=D8=A9=20=D9=83=D8=A7=D9=85=D9=84=D8=A9=20?= =?UTF-8?q?=D9=83=D9=84=20=D9=86=D8=B5=D9=81=20=D8=B7=D9=88=D9=84=20=D9=85?= =?UTF-8?q?=D9=88=D8=AC=D8=A9=D8=8C=20=D9=88=D8=B9=D9=86=D8=AF=20=CE=BB/8?= =?UTF-8?q?=20=D9=8A=D8=B5=D9=8A=D8=B1=20=D9=87=D9=88=D8=A7=D8=A6=D9=8A=20?= =?UTF-8?q?100=20+=20j50=20=D9=83=D8=A3=D9=86=D9=87=2050=20=E2=88=92=20j50?= =?UTF-8?q?.=20=D9=88=D9=81=D9=8A=20=D8=AB=D9=84=D8=A7=D8=AB=D9=8A=20?= =?UTF-8?q?=D8=A7=D9=84=D8=A3=D8=A8=D8=B9=D8=A7=D8=AF=20=D8=AC=D9=87=D8=A7?= =?UTF-8?q?=D8=B2=20=D8=A5=D8=B1=D8=B3=D8=A7=D9=84=20=D9=88=D9=83=D8=A7?= =?UTF-8?q?=D8=A8=D9=84=20=D9=88=D9=87=D9=88=D8=A7=D8=A6=D9=8A=D8=8C=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D9=88=D8=AC=D8=A9=20=D8=A7=D9=84=D8=B0=D8=A7?= =?UTF-8?q?=D9=87=D8=A8=D8=A9=20=D9=88=D8=A7=D9=84=D8=B5=D8=AF=D9=89=20?= =?UTF-8?q?=D9=81=D9=88=D9=82=20=D8=A7=D9=84=D9=83=D8=A7=D8=A8=D9=84=20?= =?UTF-8?q?=D9=88=D9=85=D8=AC=D9=85=D9=88=D8=B9=D9=87=D9=85=D8=A7=20=D8=AE?= =?UTF-8?q?=D8=B1=D8=B2=D9=8B=D8=A7=20=D8=B9=D9=84=D9=89=20=D8=A7=D9=84?= =?UTF-8?q?=D9=83=D8=A7=D8=A8=D9=84=20=D8=AF=D8=A7=D8=AE=D9=84=20=D8=BA?= =?UTF-8?q?=D9=84=D8=A7=D9=81=D9=87=D8=8C=20=D9=88=D8=AD=D9=84=D9=82=D8=A7?= =?UTF-8?q?=D8=AA=20=D8=AA=D8=AE=D8=B1=D8=AC=20=D9=85=D9=86=20=D8=A7=D9=84?= =?UTF-8?q?=D9=87=D9=88=D8=A7=D8=A6=D9=8A=20=D8=A8=D9=82=D8=AF=D8=B1=20?= =?UTF-8?q?=D9=85=D8=A7=20=D9=8A=D8=AE=D8=B1=D8=AC=20=D9=88=D9=8A=D8=AA?= =?UTF-8?q?=D9=88=D9=87=D8=AC=20=D8=A7=D9=84=D8=AC=D9=87=D8=A7=D8=B2=20?= =?UTF-8?q?=D8=A8=D9=82=D8=AF=D8=B1=20=D9=85=D8=A7=20=D9=8A=D8=B1=D8=AC?= =?UTF-8?q?=D8=B9=D8=8C=20=D9=88=D8=B9=D8=AF=D8=A7=D8=AF=20=D9=8A=D9=85?= =?UTF-8?q?=D8=B4=D9=8A=20=D8=B9=D9=84=D9=89=20=D8=A7=D9=84=D9=83=D8=A7?= =?UTF-8?q?=D8=A8=D9=84=20(=D8=B2=D8=B1=20=C2=AB=D8=A7=D9=85=D8=B4=D9=90?= =?UTF-8?q?=20=D9=86=D8=AD=D9=88=20=D8=AC=D9=87=D8=A7=D8=B2=20=D8=A7=D9=84?= =?UTF-8?q?=D8=A5=D8=B1=D8=B3=D8=A7=D9=84=C2=BB)=20=D9=88=D9=84=D9=88?= =?UTF-8?q?=D8=AD=D8=A9=20=D9=85=D8=AE=D8=B7=D8=B7=20=D8=B3=D9=85=D9=8A?= =?UTF-8?q?=D8=AB=20=D8=A8=D8=AC=D8=A7=D9=86=D8=A8=20=D8=A7=D9=84=D9=87?= =?UTF-8?q?=D9=88=D8=A7=D8=A6=D9=8A=20=D8=AA=D8=B1=D8=A8=D8=B7=20=D9=86?= =?UTF-8?q?=D9=82=D8=B7=D8=A9=20=D8=A7=D9=84=D8=B9=D8=AF=D8=A7=D8=AF=20?= =?UTF-8?q?=D8=A8=D9=86=D9=82=D8=B7=D8=A9=20=D8=A7=D9=84=D9=87=D9=88=D8=A7?= =?UTF-8?q?=D8=A6=D9=8A.=20=D8=A8=D8=A7=D9=84=D8=B9=D8=B1=D8=A8=D9=8A?= =?UTF-8?q?=D8=A9=20=D9=88=D8=A7=D9=84=D8=A5=D9=86=D8=AC=D9=84=D9=8A=D8=B2?= =?UTF-8?q?=D9=8A=D8=A9=D8=8C=20=D8=A8=D8=B9=D8=AF=20=D8=AF=D8=B1=D8=B3=20?= =?UTF-8?q?=D8=A7=D9=84=D9=82=D8=AF=D8=B1=D8=A9=20=D9=81=D9=8A=20=D8=A7?= =?UTF-8?q?=D9=84=D8=AA=D9=8A=D8=A7=D8=B1=20=D8=A7=D9=84=D9=85=D8=AA=D8=B1?= =?UTF-8?q?=D8=AF=D8=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/lessons/electricity/_order.yaml | 1 + content/lessons/electricity/smith-chart/ar.md | 79 ++++ content/lessons/electricity/smith-chart/en.md | 79 ++++ .../electricity/smith-chart/lesson.yaml | 67 ++++ content/ui/ar/smith-chart.yaml | 28 ++ content/ui/ar/smith-chart3d.yaml | 13 + content/ui/en/smith-chart.yaml | 28 ++ content/ui/en/smith-chart3d.yaml | 13 + src/viz/electricity/SmithChart.vue | 340 ++++++++++++++++++ src/viz/electricity/smithModel.ts | 95 +++++ src/viz3d/electricity/SmithChart3D.vue | 311 ++++++++++++++++ 11 files changed, 1054 insertions(+) create mode 100644 content/lessons/electricity/smith-chart/ar.md create mode 100644 content/lessons/electricity/smith-chart/en.md create mode 100644 content/lessons/electricity/smith-chart/lesson.yaml create mode 100644 content/ui/ar/smith-chart.yaml create mode 100644 content/ui/ar/smith-chart3d.yaml create mode 100644 content/ui/en/smith-chart.yaml create mode 100644 content/ui/en/smith-chart3d.yaml create mode 100644 src/viz/electricity/SmithChart.vue create mode 100644 src/viz/electricity/smithModel.ts create mode 100644 src/viz3d/electricity/SmithChart3D.vue diff --git a/content/lessons/electricity/_order.yaml b/content/lessons/electricity/_order.yaml index c45d193e..549d5186 100644 --- a/content/lessons/electricity/_order.yaml +++ b/content/lessons/electricity/_order.yaml @@ -6,6 +6,7 @@ - series-parallel - rlc-resonance - ac-power +- smith-chart - kirchhoffs-laws - electric-power-and-energy-bills - capacitors diff --git a/content/lessons/electricity/smith-chart/ar.md b/content/lessons/electricity/smith-chart/ar.md new file mode 100644 index 00000000..0fa5a942 --- /dev/null +++ b/content/lessons/electricity/smith-chart/ar.md @@ -0,0 +1,79 @@ +--- +title: 'مخطط سميث: دائرة تُريك كم من إشارتك يرتد عن الهوائي' +summary: >- + إذا لم يناسب الهوائي الكابل ارتد جزء من الإشارة إلى الجهاز. مخطط سميث خريطة + دائرية تُريك كم يرتد بنظرة واحدة. +parameters: + R: R — مقاومة الهوائي (الكابل 50 Ω) + X: X — مفاعلة الهوائي، موجبة حين يتصرف كملف وسالبة حين يتصرف كمكثف + d: d — كم تبتعد عن الهوائي على الكابل وأنت تنظر، بوحدة طول الموجة +variables: + - 'معامل الانعكاس: أي جزء من الموجة يرتد (من 0 إلى 1) وبأي تأخير (زاويته)' + - معاوقة الهوائي، R + jX، بالأوم + - المعاوقة المميزة للكابل، وهي 50 Ω في هذا الدرس + - 'الهوائي مقسومًا على الكابل: هوائي 100 + j50 Ω على كابل 50 Ω يعطي 2 + j1' + - جزء المقاومة من z، ولكل قيمة دائرة على المخطط + - جزء المفاعلة من z، ولكل قيمة قوس على المخطط + - 'الوحدة التخيلية: تميز الجزء من المعاوقة الذي يؤخر الموجة بدل أن يستهلك طاقتها' +--- + +## Try it + +1. اضغط زر «أرني الرسم المسطح» تحت الصورة. تنفرد الدائرة إلى رسم عادي، المقاومة إلى اليمين والمفاعلة إلى الأعلى والأسفل. اضغط مرة أخرى وراقبها تنطوي من جديد، وتستقر اللانهاية على الحافة اليمنى. +2. اسحب R إلى 50 وX إلى 0. تصل النقطة البرتقالية إلى المركز ويصير الشريط أخضر كله، فلا يرتد شيء. ثم ادفع R إلى 250 أو X بعيدًا عن 0، وراقب النقطة تنزلق نحو الحافة حيث يرتد كل شيء. +3. أعد R إلى 100 وX إلى 50، ثم حرّك d من 0 إلى 0.5. تدور النقطة الزرقاء على الدائرة المتقطعة دورة كاملة، ويمشي الخط الأزرق على الكابل مبتعدًا عن الهوائي. قف عند 0.125، فيقرأ الكابل الآن 50 − j50 Ω. + +## Real-life examples + +- **هوائي منحرف.** هوائي 100 + j50 Ω على كابل 50 Ω. اقسم على 50 تحصل على 2 + j1، فتقف النقطة يمين المركز وفوق المحور. يرتد خُمس القدرة، وVSWR يساوي 2.6. +- **هوائي تلفاز على الكابل الخطأ.** هوائيات التلفاز مصنوعة لكابل 75 Ω. على كابل 50 Ω يكون Γ يساوي 0.2، فلا يرتد إلا 4% من القدرة، وVSWR يساوي 1.5. يكفي لمعظم الأجهزة. +- **ثُمن طول موجة على الكابل.** الهوائي نفسه 100 + j50 Ω لكن من مسافة d = 0.125. دارت النقطة ربع دورة ووقفت على دائرة 50 Ω، فصار الكابل يقرأ 50 − j50 Ω. المقاومة صحيحة، ولا ينقص إلا ملف بقيمة +j50. + +## Test yourself + +1. وائم الهوائي مع الكابل حتى يرتد أقل من 1% من القدرة. +2. اجعل ربع القدرة بالضبط يرتد (بين 24% و26%). +3. أبقِ الهوائي عند 100 + j50 Ω وامشِ على الكابل حتى يقرأ الكابل مقاومة 50 Ω بالضبط. + +## Intuition + +جهاز الواي فاي في بيتك، وجهاز اللاسلكي، ومحطة الإذاعة، كلها تدفع موجة في كابل إلى هوائي. الكابل مصنوع بحيث تشعر الموجة فيه بمقاومة 50 أوم في كل نقطة، فتنزلق فيه دون أن تلاحظ شيئًا. تخيل الآن أن الهوائي في آخره يبدو كأنه 100 أوم. تصل الموجة فتجد الطريق قد تغير فجأة، فيرتد جزء منها نحو الجهاز، كصرخة تتردد عن جدار. مع 100 أوم على كابل 50 أوم يرجع ثلث جهد الموجة، أي تُسع القدرة. نحو 11% لا يخرج من الهوائي أبدًا، بل يعود في الكابل ويسخّن الجهاز. + +في الصورة، النقطة البرتقالية هي هوائيك. مركز الدائرة هو 50 أوم، أي التطابق التام، ولا يرتد فيه شيء. كلما ابتعدت النقطة عن المركز ارتد جزء أكبر من الموجة، وعلى الحافة يرتد كل شيء. الحافة اليسرى دائرة قصر، أي 0 أوم، والحافة اليمنى دائرة مفتوحة، أي لا شيء موصول أصلًا. كل دائرة هي مقاومة R واحدة، وكل قوس هو مفاعلة X واحدة، فتقرأ أي هوائي من المخطط. والشريط على اليمين يقول الشيء نفسه بالأخضر والأحمر: ما يصل إلى الهوائي وما يرجع. + +من أين جاءت الدائرة؟ اضغط الزر تحت الصورة فينفرد المخطط إلى رسم عادي، المقاومة إلى اليمين والمفاعلة إلى الأعلى والأسفل. هذا الرسم لا ينتهي. الدائرة المفتوحة تقف في اللانهاية على اليمين، والملف الكبير في اللانهاية إلى الأعلى. يطوي مخطط سميث هذه الصفحة التي لا تنتهي حتى تصير اللانهاية كلها نقطة واحدة على الحافة، ويدخل كل شيء في دائرة. الخطوط المستقيمة للمقاومة الواحدة تصير دوائر، وخطوط المفاعلة الواحدة تصير أقواسًا. لا يضيع شيء، فهو الرسم نفسه مطويًا. + +والآن الجزء الذي يحبه المهندسون. حرّك d فتمشي على الكابل مبتعدًا عن الهوائي. تدور النقطة الزرقاء حول المركز دورة كاملة كل نصف طول موجة، ولا يتغير بُعدها عن المركز أبدًا. فالصدى بالحجم نفسه في أي نقطة من الكابل، ولا يتغير إلا توقيته. لذلك كابل بأي طول هو مجرد دورة للنقطة، بلا حسابات. وفي مكان ما من هذه الدورة تعبر النقطة دائرة 50 أوم. هناك يلغي ملف صغير أو مكثف صغير ما بقي، ويصير التطابق تامًا. هكذا يُضبط الهوائي في كل هاتف. + +## Formal + +للكابل معاوقة مميزة $Z_0$، وهي هنا 50 Ω. وللهوائي معاوقة $Z_L = R + jX$. الجزء الذي يرتد من موجة الجهد هو معامل الانعكاس $\Gamma = \frac{Z_L - Z_0}{Z_L + Z_0}$، وهو عدد مركب. حجمه $|\Gamma|$ يقول كم يرجع من الموجة، من 0 إلى 1، وزاويته تقول كم تأخر الصدى. القدرة المرتدة هي الجزء $|\Gamma|^2$، فهوائي 100 + j50 Ω حجمه 0.45 ويعيد 20% من القدرة. على طول الكابل تتجمع الموجة الذاهبة والصدى حيث يتفقان، ويلغي أحدهما الآخر حيث يختلفان. أكبر جهد مقسومًا على أصغره هو VSWR، أي $\frac{1+|\Gamma|}{1-|\Gamma|}$، وهو هنا 2.6. + +اقسم كل شيء على الكابل: $z = Z_L/Z_0 = r + jx$. مخطط سميث هو مستوى $\Gamma$ وقد رُسمت عليه خطوط $r$ الثابتة وخطوط $x$ الثابتة. يصير الخط $r = 1$ الدائرة المارة بالمركز والحافة اليمنى، وتصير كل قيمة من $x$ قوسًا ينتهي عند الحافة. وحين تنظر من مسافة $d$ طول موجة عن الهوائي يكون الصدى قد قطع $2d$ أكثر من الموجة الذاهبة، فتدور النقطة: $\Gamma(d) = \Gamma(0)\,e^{-j4\pi d/\lambda}$ مع عقارب الساعة، دورة كاملة كل نصف طول موجة. والمعاوقة التي يُظهرها الكابل هناك هي $Z = Z_0\,\frac{1+\Gamma}{1-\Gamma}$، ولهوائي 100 + j50 Ω عند $d = \lambda/8$ تساوي 50 − j50 Ω. + +## Advanced + +المواءمة هي قراءة المخطط بالعكس. امشِ على الكابل حتى تقف النقطة على دائرة $r = 1$، ثم أضف ملفًا أو مكثفًا على التوالي يلغي ما بقي من $x$. أو أضف قطعة كابل قصيرة على التوازي، وهي الحركة نفسها على مخطط الموصلية، أي مخطط سميث مدارًا 180°. ويذكر المهندسون الصدى أيضًا بصيغة خسارة الرجوع، $-20\log_{10}|\Gamma|$ بوحدة dB، وهي 7 dB لهوائينا المنحرف وأكثر من 20 dB لمواءمة جيدة. والكابل الحقيقي يفقد قليلًا في الطريق، فتدور النقطة في حلزون نحو الداخل وأنت تمشي، وقد يخفي كابل طويل هوائيًا سيئًا. + +رسم فيليب سميث هذا المخطط عام 1939 في مختبرات Bell، حين كانت كل حسابات المعاوقة باليد وكانت قسمة عدد مركب تأخذ دقائق. اليوم يرسمه محلل الشبكات المتجه (VNA)، أو جهاز NanoVNA رخيص، مباشرة: النقطة هي هوائيك، وتضبطه حتى تقف النقطة في المركز. ويرسم عليه مصممو المكبرات دوائر الاستقرار ودوائر الضجيج ليختاروا المعاوقة التي يريدها الترانزستور. ويعمل المخطط عند أي تردد لأنه مرسوم بوحدات منسوبة وبطول الموجة، فلا يتحرك إلا النقطة. + +## Derivation + +1. اقسم معاوقة الهوائي على 50 Ω الخاصة بالكابل، فيصير الكابل نفسه 1 ويصلح المخطط نفسه لأي كابل. +2. الصدى هو الفرق $z - 1$ مقارنًا بالمجموع $z + 1$. الهوائي المطابق، $z = 1$، لا يعطي صدى. دائرة القصر تعطي −1، فترجع الموجة مقلوبة. والدائرة المفتوحة تعطي +1، فترجع كما كانت. +3. تتجمع الموجة الذاهبة والصدى حيث يتفقان ويلغي أحدهما الآخر حيث يختلفان. أكبر جهد مقسومًا على أصغره هو VSWR، ويساوي 1 للتطابق التام ولانهاية للقصر أو الدائرة المفتوحة. +4. وأنت تمشي على الكابل مبتعدًا ترى الموجة الذاهبة أبكر والصدى أبطأ بالمسافة نفسها، فيكبر فرق التوقيت بينهما بضعف المسافة: $4\pi$ لكل طول موجة، أي دورة كاملة كل نصف طول موجة. وحجم الصدى لا يتغير، فتدور النقطة على دائرتها. + +## Real world + +### ضبط هوائي جهاز لاسلكي +يُظهر محلل الهوائي نقطة على مخطط سميث. يقصّ الهاوي السلك أو يدير الموالف حتى تقف النقطة في المركز، فتخرج قدرة الجهاز بدل أن ترجع إليه. + +### الهوائي داخل هاتفك +هوائي الهاتف شريط معدني طوله بضعة سنتيمترات، وهو وحده بعيد جدًا عن 50 Ω. شبكة مواءمة من ملفين أو ثلاثة ومكثفات صغيرة، مصممة على هذا المخطط، تنقل نقطته إلى المركز في كل نطاق يستعمله الهاتف. + +### حماية جهاز الإرسال +جهاز إذاعة بقدرة 1 kW مع VSWR يساوي 3 يرجع إليه 250 W من قدرته حرارةً. تراقب الأجهزة VSWR وتتوقف فوق 2 تقريبًا، ولهذا يُكتشف كابل الهوائي المقطوع خلال ثوانٍ. + +### أشباح على شاشات التلفاز القديمة +في التلفاز التناظري كان الكابل غير المناسب يعيد جزءًا من الصورة ذهابًا وإيابًا في الكابل فتصل متأخرة قليلًا، نسخة ثانية باهتة من الصورة منزاحة إلى اليمين. ولهذا اعتمد عالم التلفاز كابل 75 Ω لتبقى هذه الأصداء صغيرة. diff --git a/content/lessons/electricity/smith-chart/en.md b/content/lessons/electricity/smith-chart/en.md new file mode 100644 index 00000000..1a2723b7 --- /dev/null +++ b/content/lessons/electricity/smith-chart/en.md @@ -0,0 +1,79 @@ +--- +title: 'The Smith chart: a round map of how much of your signal bounces back' +summary: >- + If the antenna does not match the cable, part of the signal bounces back. The Smith + chart is a round map that shows how much, at a glance. +parameters: + R: R — the antenna's resistance (the cable is 50 Ω) + X: X — the antenna's reactance, + when it acts like a coil, − when it acts like a capacitor + d: d — how far back from the antenna you look along the cable, in wavelengths +variables: + - 'the reflection coefficient: what fraction of the wave bounces back (0 to 1) and with what delay (its angle)' + - the antenna's impedance, R + jX, in ohms + - the cable's characteristic impedance, 50 Ω in this lesson + - 'the antenna divided by the cable: 100 + j50 Ω on a 50 Ω cable gives 2 + j1' + - the resistance part of z, one circle on the chart for each value + - the reactance part of z, one arc on the chart for each value + - 'the imaginary unit: it marks the part of the impedance that delays the wave instead of eating its energy' +--- + +## Try it + +1. Press "show the flat graph it came from" under the picture. The circle unrolls into an ordinary graph, resistance to the right and reactance up and down. Press again and watch it fold back, with infinity landing on the right edge. +2. Drag R to 50 and X to 0. The orange point reaches the centre and the bar turns fully green: nothing bounces back. Now push R to 250 or X far from 0 and watch the point slide toward the rim, where everything bounces. +3. Put R back to 100 and X to 50, then slide d from 0 to 0.5. The blue point rides around the dashed circle, one full turn, while the blue line on the cable walks back from the antenna. Stop at 0.125: the cable now reads 50 − j50 Ω. + +## Real-life examples + +- **A bent antenna.** An antenna of 100 + j50 Ω on a 50 Ω cable. Divided by 50 that is 2 + j1, so the point sits right of centre and above the axis. One fifth of the power bounces back, VSWR 2.6. +- **A TV antenna on the wrong cable.** TV antennas are made for 75 Ω cable. On 50 Ω, Γ is 0.2: only 4% of the power bounces back, VSWR 1.5. Good enough for most radios. +- **An eighth of a wavelength down the cable.** The same 100 + j50 Ω antenna, seen from d = 0.125. The point has turned a quarter of the way round and sits on the 50 Ω circle: the cable now reads 50 − j50 Ω. The resistance is right; only a coil's worth of +j50 is missing. + +## Test yourself + +1. Match the antenna to the cable so that less than 1% of the power bounces back. +2. Make exactly a quarter of the power bounce back (between 24% and 26%). +3. Keep the antenna at 100 + j50 Ω and walk back along the cable until the cable reads exactly 50 Ω of resistance. + +## Intuition + +A Wi-Fi router, a walkie-talkie, a radio station: each one pushes a wave down a cable into an antenna. The cable is built so that a wave travelling along it feels 50 ohms, the same push-back at every point, so the wave glides along without noticing anything. Now suppose the antenna at the end looks like 100 ohms. The wave arrives, finds the road suddenly different, and part of it bounces back toward the transmitter, like a shout echoing off a wall. With 100 ohms on a 50 ohm cable, a third of the wave's voltage comes back, which is one ninth of the power: about 11% never leaves the antenna. It travels back down the cable and heats the transmitter instead. + +In the picture, the orange point is your antenna. The centre of the circle is 50 ohms, a perfect match: nothing bounces back. The further the point sits from the centre, the more of the wave bounces, and on the rim everything does. The left edge is a short circuit, 0 ohms, and the right edge is an open circuit, nothing connected at all. Every circle is one resistance R and every arc is one reactance X, so you can read any antenna off the chart. The bar on the right shows the same thing in green and red: what reaches the antenna and what comes back. + +Where does the circle come from? Press the button under the picture and the chart unrolls into an ordinary graph: resistance to the right, reactance up and down. That graph never ends. An open circuit sits infinitely far to the right, and a big coil infinitely far up. The Smith chart bends that endless sheet so that all of infinity becomes one point on the rim and everything fits in a circle. Straight lines of equal resistance become circles, lines of equal reactance become arcs. Nothing is lost: it is the same graph, folded. + +Now the part engineers love. Slide d and you walk back from the antenna along the cable. The blue point simply turns around the centre, one full turn every half wavelength, and never changes its distance from the centre. The echo is the same size anywhere along the cable; only its timing shifts. So a cable of any length is just a turn of the point, no algebra needed. And somewhere on that turn the point crosses the 50 ohm circle. There, one small coil or capacitor cancels what is left, and the match is perfect. That is how the antenna in every phone is tuned. + +## Formal + +The cable has a characteristic impedance $Z_0$, here 50 Ω. The antenna has an impedance $Z_L = R + jX$. The part of the voltage wave that bounces back is the reflection coefficient $\Gamma = \frac{Z_L - Z_0}{Z_L + Z_0}$, a complex number. Its size $|\Gamma|$ says how much of the wave comes back, from 0 to 1, and its angle says how much the echo is delayed. The bounced power is the fraction $|\Gamma|^2$, so the 100 + j50 Ω antenna, with a size of 0.45, sends back 20% of the power. Along the cable the forward wave and the echo add where they agree and cancel where they disagree. The biggest voltage divided by the smallest is the VSWR, $\frac{1+|\Gamma|}{1-|\Gamma|}$, here 2.6. + +Divide everything by the cable: $z = Z_L/Z_0 = r + jx$. The Smith chart is the plane of $\Gamma$ with the lines of constant $r$ and constant $x$ drawn on it. The line $r = 1$ becomes the circle through the centre and the right edge, and each value of $x$ becomes an arc ending on the rim. Seen $d$ wavelengths back from the antenna, the echo has travelled $2d$ further than the forward wave, so the point turns: $\Gamma(d) = \Gamma(0)\,e^{-j4\pi d/\lambda}$, clockwise, a full turn every half wavelength. The impedance the cable shows there is $Z = Z_0\,\frac{1+\Gamma}{1-\Gamma}$, and for the 100 + j50 Ω antenna at $d = \lambda/8$ that is 50 − j50 Ω. + +## Advanced + +Matching is reading the chart backwards. Walk along the cable until the point lands on the $r = 1$ circle, then add a series coil or capacitor to cancel the remaining $x$. Or add a short stub of cable in parallel, which is the same move on the admittance chart, the Smith chart turned by 180°. Engineers also quote the echo as return loss, $-20\log_{10}|\Gamma|$ in dB: 7 dB for our bent antenna, over 20 dB for a good match. A real cable loses a little on the way, so the point spirals inward as you walk, and a long lossy cable can hide a bad antenna. + +Phillip Smith drew the chart in 1939 at Bell Labs, when every impedance calculation was done by hand and a complex division took minutes. Today a vector network analyser, or a cheap NanoVNA, draws it live: the dot is your antenna, and you tune until the dot sits in the centre. Amplifier designers draw stability and noise circles on it to pick the impedance a transistor wants to see. And the chart works at any frequency, because it is drawn in normalised units and wavelengths; only the point moves. + +## Derivation + +1. Divide the antenna's impedance by the cable's 50 Ω, so the cable itself becomes 1 and the same chart works for any cable. +2. The echo is the mismatch, $z - 1$, compared with the total, $z + 1$. A matched antenna, $z = 1$, gives no echo. A short circuit gives −1: the wave comes back upside down. An open circuit gives +1: it comes back as it was. +3. The forward wave and the echo add where they agree and cancel where they disagree. The biggest voltage over the smallest is the VSWR; a perfect match gives 1, a short or an open gives infinity. +4. Walking back along the cable, the forward wave is seen earlier and the echo later by the same distance, so their timing difference grows by twice the distance: $4\pi$ per wavelength, a full turn every half wavelength. The size of the echo stays the same, so the point turns on its circle. + +## Real world + +### Tuning a ham radio antenna +An antenna analyser shows a dot on a Smith chart. The operator trims the wire or turns a tuner until the dot sits in the centre, and the transmitter's power goes out instead of coming back. + +### The antenna inside your phone +A phone antenna is a strip of metal a few centimetres long, far from 50 Ω on its own. A matching network of two or three tiny coils and capacitors, designed on this chart, moves its point to the centre for every band the phone uses. + +### Protecting a transmitter +A 1 kW broadcast transmitter with a VSWR of 3 gets 250 W of its own power back as heat. Transmitters watch the VSWR and shut down above about 2, which is why a broken antenna cable is noticed within seconds. + +### Ghosts on old TV screens +On analogue TV a mismatched cable sent part of the picture back and forth along the cable, arriving a little late: a faint second copy of the image, shifted to the right. The TV world settled on 75 Ω cable to keep those echoes small. diff --git a/content/lessons/electricity/smith-chart/lesson.yaml b/content/lessons/electricity/smith-chart/lesson.yaml new file mode 100644 index 00000000..a2b6b893 --- /dev/null +++ b/content/lessons/electricity/smith-chart/lesson.yaml @@ -0,0 +1,67 @@ +id: smith-chart +subject: electricity +difficulty: university +equation: \Gamma = \frac{Z_L - Z_0}{Z_L + Z_0} +concepts: +- smith-chart +- reflection-coefficient +- impedance-matching +- transmission-line +- standing-wave-ratio +prerequisites: +- rlc-resonance +related: +- ac-power +- standing-waves +visualization: + type: smith-chart +visualization3d: + type: smith-chart +parameters: + R: + min: 0 + max: 250 + step: 1 + value: 100 + unit: Ω + X: + min: -250 + max: 250 + step: 1 + value: 50 + unit: Ω + d: + min: 0 + max: 0.5 + step: 0.005 + value: 0 + unit: λ +variables: +- \Gamma +- Z_L +- Z_0 +- z +- r +- x +- j +derivation: +- z = \frac{Z_L}{Z_0} = r + jx +- \Gamma = \frac{z - 1}{z + 1} +- '\text{VSWR} = \frac{1 + |\Gamma|}{1 - |\Gamma|}' +- \Gamma(d) = \Gamma(0)\, e^{-j\,4\pi d/\lambda} +charts: [] +primary: R +presets: +- R: 100 + X: 50 + d: 0 +- R: 75 + X: 0 + d: 0 +- R: 100 + X: 50 + d: 0.125 +challenges: +- check: ((R/50)^2 - 1 + (X/50)^2)^2 + (2*X/50)^2 < 0.01 * ((R/50 + 1)^2 + (X/50)^2)^2 +- check: abs((((R/50)^2 - 1 + (X/50)^2)^2 + (2*X/50)^2) / ((R/50 + 1)^2 + (X/50)^2)^2 - 0.25) < 0.01 +- check: abs(R - 100) < 0.5 and abs(X - 50) < 0.5 and abs(d - 0.125) < 0.003 diff --git a/content/ui/ar/smith-chart.yaml b/content/ui/ar/smith-chart.yaml new file mode 100644 index 00000000..61a96265 --- /dev/null +++ b/content/ui/ar/smith-chart.yaml @@ -0,0 +1,28 @@ +smith.hint: ▶ اسحب النقطة البرتقالية (أو منزلقي R وX)، والمركز هو التطابق التام +smith.short: 0 Ω دائرة قصر +smith.open: ∞ دائرة مفتوحة +smith.match: 50 Ω تطابق تام +smith.load: هوائيك +smith.seen: كما يبدو من مسافة d على الكابل +smith.vswrCircle: الصدى نفسه من أي مسافة +smith.bend: ↺ أرني الرسم المسطح الذي جاء منه +smith.unbend: ▶ اطوه من جديد إلى مخطط سميث +smith.axisR: المقاومة R (Ω) +smith.axisX: المفاعلة X (Ω) +smith.cable: الكابل من فوق، من الجهاز إلى الهوائي +smith.transmitter: جهاز الإرسال +smith.antenna: الهوائي +smith.here: تنظر من هنا +smith.vmax: الأكبر +smith.vmin: الأصغر +smith.delivered: '{pct}% يصل إلى الهوائي' +smith.bounced: '{pct}% يرتد' +smith.seenSentence: 'من هنا يقرأ الكابل {z}' +smith.toward: ↻ نحو جهاز الإرسال +smith.caption: 'كلما ابتعدت النقطة عن المركز ارتد جزء أكبر من الإشارة، والمشي على الكابل لا يفعل إلا أن يدير النقطة' +smith.r.load: الهوائي Z_L +smith.r.z: مقسومًا على 50 Ω +smith.r.gamma: الانعكاس Γ +smith.r.vswr: VSWR +smith.r.bounced: القدرة المرتدة +smith.r.seen: ما يقرؤه الكابل diff --git a/content/ui/ar/smith-chart3d.yaml b/content/ui/ar/smith-chart3d.yaml new file mode 100644 index 00000000..f28398d5 --- /dev/null +++ b/content/ui/ar/smith-chart3d.yaml @@ -0,0 +1,13 @@ +viz3d.smith.walk: ▶ امشِ نحو جهاز الإرسال +viz3d.smith.pause: ❚❚ توقف +viz3d.smith.restart: ↺ عُد إلى الهوائي +viz3d.smith.matched: تطابق تام، الموجة كلها تخرج من الهوائي +viz3d.smith.bounce: 'يرتد {pct} من القدرة، وVSWR يساوي {vswr}' +viz3d.smith.here: 'الكابل هنا يقرأ {z}' +viz3d.smith.probe: تنظر من هنا +viz3d.smith.seen: كما يبدو من العداد +viz3d.smith.forward: الموجة الذاهبة +viz3d.smith.reflected: الصدى الراجع +viz3d.smith.total: ما يحمله الكابل +viz3d.smith.heat: 'يرجع {pct} ويسخّن الجهاز' +viz3d.smith.chart: مخطط سميث diff --git a/content/ui/en/smith-chart.yaml b/content/ui/en/smith-chart.yaml new file mode 100644 index 00000000..73b28f7d --- /dev/null +++ b/content/ui/en/smith-chart.yaml @@ -0,0 +1,28 @@ +smith.hint: ▶ drag the orange point (or the R and X sliders); the centre is a perfect match +smith.short: 0 Ω short circuit +smith.open: ∞ open circuit +smith.match: 50 Ω perfect match +smith.load: your antenna +smith.seen: seen from d down the cable +smith.vswrCircle: the same echo, from any distance +smith.bend: ↺ show the flat graph it came from +smith.unbend: ▶ fold it back into the Smith chart +smith.axisR: resistance R (Ω) +smith.axisX: reactance X (Ω) +smith.cable: the cable from above, transmitter to antenna +smith.transmitter: transmitter +smith.antenna: antenna +smith.here: you look from here +smith.vmax: biggest +smith.vmin: smallest +smith.delivered: '{pct}% reaches the antenna' +smith.bounced: '{pct}% bounces back' +smith.seenSentence: 'from here the cable reads {z}' +smith.toward: ↻ toward the transmitter +smith.caption: 'the further the point is from the centre, the more of the signal bounces back; walking along the cable only turns the point' +smith.r.load: antenna Z_L +smith.r.z: divided by 50 Ω +smith.r.gamma: reflection Γ +smith.r.vswr: VSWR +smith.r.bounced: power bounced back +smith.r.seen: the cable reads diff --git a/content/ui/en/smith-chart3d.yaml b/content/ui/en/smith-chart3d.yaml new file mode 100644 index 00000000..c31766cd --- /dev/null +++ b/content/ui/en/smith-chart3d.yaml @@ -0,0 +1,13 @@ +viz3d.smith.walk: ▶ walk toward the transmitter +viz3d.smith.pause: ❚❚ pause +viz3d.smith.restart: ↺ back to the antenna +viz3d.smith.matched: 'a perfect match: the whole wave leaves the antenna' +viz3d.smith.bounce: '{pct} of the power bounces back, VSWR {vswr}' +viz3d.smith.here: 'the cable here reads {z}' +viz3d.smith.probe: you look from here +viz3d.smith.seen: seen from the meter +viz3d.smith.forward: wave going out +viz3d.smith.reflected: echo coming back +viz3d.smith.total: what the cable carries +viz3d.smith.heat: '{pct} comes back and heats the transmitter' +viz3d.smith.chart: Smith chart diff --git a/src/viz/electricity/SmithChart.vue b/src/viz/electricity/SmithChart.vue new file mode 100644 index 00000000..e8f3d8e9 --- /dev/null +++ b/src/viz/electricity/SmithChart.vue @@ -0,0 +1,340 @@ + + + diff --git a/src/viz/electricity/smithModel.ts b/src/viz/electricity/smithModel.ts new file mode 100644 index 00000000..3fd4e5ae --- /dev/null +++ b/src/viz/electricity/smithModel.ts @@ -0,0 +1,95 @@ +// The Smith-chart lesson's model, shared by the flat picture (SmithChart.vue) and the 3D scene +// (SmithChart3D.vue): an antenna Z_L = R + jX on a Z0 = 50 Ω cable, its reflection coefficient +// Γ = (z − 1)/(z + 1) with z = Z_L/Z0, and how Γ turns as you look at the cable d wavelengths back +// from the antenna. The chart itself is the Γ disc with the lines of constant r and x drawn on it. +import { fmt } from '../../engine/math' + +export const Z0 = 50 +export type C = { re: number; im: number } +const clamp = (v: number, lo: number, hi: number) => Math.min(Math.max(v, lo), hi) +export const readParams = (p: Record) => ({ R: clamp(p.R ?? 100, 0, 250), X: clamp(p.X ?? 50, -250, 250), d: clamp(p.d ?? 0, 0, 0.5) }) + +export const mag = (c: C) => Math.hypot(c.re, c.im) +export const arg = (c: C) => Math.atan2(c.im, c.re) +/** Normalised impedance z = r + jx → reflection coefficient Γ = (z − 1)/(z + 1). */ +export function gammaOf(r: number, x: number): C { + const den = (r + 1) ** 2 + x * x + return { re: (r * r - 1 + x * x) / den, im: (2 * x) / den } +} +/** Γ → z = (1 + Γ)/(1 − Γ); Γ = 1 (an open circuit) gives infinity. */ +export function zOf(g: C): C { + const den = (1 - g.re) ** 2 + g.im ** 2 + return { re: (1 - g.re ** 2 - g.im ** 2) / den, im: (2 * g.im) / den } +} +/** Γ seen d wavelengths back from the antenna: Γ·e^{−j4πd}, clockwise, a full turn every half wavelength. */ +export function rotate(g: C, d: number): C { + const a = -4 * Math.PI * d + return { re: g.re * Math.cos(a) - g.im * Math.sin(a), im: g.re * Math.sin(a) + g.im * Math.cos(a) } +} +export const vswrOf = (m: number) => (m > 0.999 ? Infinity : (1 + m) / (1 - m)) +/** Size of the voltage d wavelengths back from the antenna, relative to the forward wave: |1 + Γe^{−j4πd}|. */ +export function envelope(g: C, d: number) { + const q = rotate(g, d) + return Math.hypot(1 + q.re, q.im) +} +/** "100 + j50", "75", "50 − j50"; infinity for an open circuit. */ +export function cfmt(re: number, im: number, digits = 0) { + if (!Number.isFinite(re) || !Number.isFinite(im) || Math.abs(re) > 1e5 || Math.abs(im) > 1e5) return '∞' + const a = fmt(re, digits).replace('-', '−') + if (Math.abs(im) < 0.5 * 10 ** -digits) return a + return `${a} ${im < 0 ? '−' : '+'} j${fmt(Math.abs(im), digits)}` +} + +// The grid: lines of constant r and of constant x, as (r, x) samples in the impedance plane. Sampled +// through tan() so each line runs out towards infinity, where the chart closes it into a circle. +export const R_LINES = [0, 0.2, 0.5, 1, 2, 5] +export const X_LINES = [0.2, 0.5, 1, 2, 5] +const N = 120 +export const rLine = (r: number): [number, number][] => Array.from({ length: N + 1 }, (_, i) => [r, Math.tan((i / N - 0.5) * Math.PI * 0.994)]) +export const xLine = (x: number): [number, number][] => Array.from({ length: N + 1 }, (_, i) => [Math.tan((i / N) * (Math.PI / 2) * 0.994), x]) + +/** Draws the chart's grid on a canvas: the Γ disc of radius R at (cx, cy), with the values in ohms. */ +export function drawSmithGrid( + g: CanvasRenderingContext2D, + cx: number, + cy: number, + R: number, + col: { grid: string; axis: string; text: string; font: string; match?: string }, +) { + const pt = (r: number, x: number): [number, number] => { + const q = gammaOf(r, x) + return [cx + q.re * R, cy - q.im * R] + } + const stroke = (pts: [number, number][], color: string, w: number) => { + g.strokeStyle = color + g.lineWidth = w + g.beginPath() + pts.forEach(([r, x], i) => { + const [X, Y] = pt(r, x) + if (i) g.lineTo(X, Y) + else g.moveTo(X, Y) + }) + g.stroke() + } + for (const x of X_LINES) { + stroke(xLine(x), col.grid, R * 0.004) + stroke(xLine(-x), col.grid, R * 0.004) + } + for (const r of R_LINES) + stroke(rLine(r), r === 0 ? col.axis : r === 1 && col.match ? col.match : col.grid, r === 0 ? R * 0.008 : r === 1 && col.match ? R * 0.007 : R * 0.004) + stroke(xLine(0), col.axis, R * 0.005) + g.fillStyle = col.text + g.font = `600 ${Math.round(R * 0.09)}px ${col.font}` + g.textAlign = 'center' + g.textBaseline = 'middle' + g.direction = 'ltr' + for (const r of R_LINES.slice(1)) { + const [X, Y] = pt(r, 0) + g.fillText(`${r * Z0}`, X, Y - R * 0.055) + } + for (const x of X_LINES) + for (const s of [1, -1]) { + const [X, Y] = pt(0, s * x) + g.fillText(`${s > 0 ? '+' : '−'}j${x * Z0}`, X + ((X - cx) / R) * R * 0.11, Y + ((Y - cy) / R) * R * 0.11) + } +} diff --git a/src/viz3d/electricity/SmithChart3D.vue b/src/viz3d/electricity/SmithChart3D.vue new file mode 100644 index 00000000..7bc44cfc --- /dev/null +++ b/src/viz3d/electricity/SmithChart3D.vue @@ -0,0 +1,311 @@ + + +