Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jhillairet committed Mar 27, 2024
1 parent e0f1179 commit 04da497
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 82 deletions.
Binary file added doc/automatic_matching_control_loop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/chart_manual_matching.ipynb
Expand Up @@ -114,7 +114,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.7"
},
"toc": {
"base_numbering": 1,
Expand Down
58 changes: 10 additions & 48 deletions doc/digital_twin.ipynb

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions doc/introduction.ipynb
Expand Up @@ -20,15 +20,6 @@
"## WEST IC antenna Python RF Model"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib notebook"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -183,7 +174,7 @@
"source": [
"f_match = 54e6\n",
"C_match_left = antenna.match_one_side(f_match=f_match, \n",
" side='right', solution_number=1)"
" side='left', solution_number=1)"
]
},
{
Expand Down Expand Up @@ -363,16 +354,23 @@
"ax[1].legend(('I1','I2','I3','I4'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The voltage and current values are of course not realistic, because the antenna is radiating on vacuum here, not on plasma."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Impedance at the T-junction\n",
"The WEST ICRH antennas design is based on the conjugate-T to insure a load-tolerance. In particular, they have been designed to operate with an impedance at the T-junction $Z_T$ close to 3 Ohm. An impedance transformer connects the T-junction to the feeding transmission line (30 Ohm line). Hence, matching the antenna is similar to having a 30 Ohm load connected to the feeding transmission line, such as no power is reflected (VSWR$\\to 1$), which should be equivalent of having an impedance of roughtly 3 Ohm at the T-junction.\n",
"\n",
"However, due to real-life design and manufacturing constraint, the optimal impedance at the T-junction is not necessarely 3 Ohm, but can be slightly different in both real and imaginary parts. \n",
"However, due to real-life design and manufacturing constraints, the optimal impedance at the T-junction is not necessarely 3 Ohm, but can be slightly different in both real and imaginary parts. \n",
"\n",
"So let's evaluate the impact of the impedance at the T-junction to the 30 Ohm feeder line (the one which really matter for the generator point-of-view).\n",
"So let's evaluate the impact of the realistic geometries (simulated from full-wave tools) on the impedance at the T-junction to the 30 Ohm feeder line (the one which really matter for the generator point-of-view).\n",
"\n",
"For that, let's take the impedance transformer/vacuum window/service stub network assembly of an antenna:"
]
Expand Down Expand Up @@ -520,7 +518,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.7"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial_matching_automatic.ipynb
Expand Up @@ -738,7 +738,7 @@
"metadata": {},
"outputs": [],
"source": [
"C_opt_2 = antenna.matching_both_sides_iterative(f_match=55e6, power=power, phase=phase)"
"C_opt_2 = antenna.match_both_sides_iterative(f_match=55e6, power=power, phase=phase, Cs=[50, 50, 50, 50])"
]
},
{
Expand Down Expand Up @@ -896,7 +896,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
37 changes: 23 additions & 14 deletions doc/tutorial_matching_manual.ipynb
Expand Up @@ -385,7 +385,7 @@
"metadata": {},
"outputs": [],
"source": [
"np.array(C_match_plasma) - np.array(C_vacuum)"
"np.array(C_match_plasma) - np.array(C_opt_vacuum_dipole)"
]
},
{
Expand Down Expand Up @@ -447,7 +447,7 @@
"metadata": {},
"outputs": [],
"source": [
"diff_C = np.array(C_matchs) - np.array(C_vacuum)"
"diff_C = np.array(C_matchs) - np.array(C_opt_vacuum_dipole)"
]
},
{
Expand All @@ -466,21 +466,18 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"Cs=list(np.array(C_opt_vacuum_dipole) + np.array([+3, -3, +3, -3]))"
"# Automatic Matching\n",
"Here is just a glimpse of the automatic matching capabilities.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"np.argmin(np.abs(ant.frequency.f - 55e6))"
"Let's assume we start from a non-optimal situation, that is we enlarge the capacitance differences from a vacuum matching from a rather arbitrary value: "
]
},
{
Expand All @@ -489,9 +486,14 @@
"metadata": {},
"outputs": [],
"source": [
"C_left, C_right, err = ant.capacitor_predictor(powers, phases, Cs=Cs)\n",
"Cs=[*C_left[500], *C_right[500]]\n",
"print(Cs)"
"Cs=list(np.array(C_opt_vacuum_dipole) + np.array([+3, -3, +3, -3]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Then, using the capacitor predictor, we calculate the capacitance set to reach:"
]
},
{
Expand All @@ -500,6 +502,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Evaluate this cell a few times to see the convergence to the optimal matching\n",
"C_left, C_right, err = ant.capacitor_predictor(powers, phases, Cs=Cs)\n",
"idx_f = np.argmin(np.abs(ant.frequency.f - 55e6))\n",
"Cs=[*C_left[idx_f], *C_right[idx_f]]\n",
"\n",
"print(Cs)\n",
"\n",
"s_act = ant.s_act(powers, phases , Cs=Cs)\n",
"\n",
"fig, ax = plt.subplots()\n",
Expand Down Expand Up @@ -561,7 +570,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.7"
},
"toc": {
"base_numbering": 1,
Expand Down
8 changes: 4 additions & 4 deletions west_ic_antenna/digital_twin.py
Expand Up @@ -31,13 +31,13 @@ def __init__(self):

#### defining widgets
# capacitor widgets
C1 = widgets.FloatSlider(value=49.31, min=30.0, max=120.0, step=1e-4,
C1 = widgets.FloatSlider(value=50.62, min=30.0, max=120.0, step=1e-4,
continuous_update=False)
C2 = widgets.FloatSlider(value=47.38, min=30.0, max=120.0, step=1e-4,
C2 = widgets.FloatSlider(value=48.69, min=30.0, max=120.0, step=1e-4,
continuous_update=False)
C3 = widgets.FloatSlider(value=49.11, min=30.0, max=120.0, step=1e-4,
C3 = widgets.FloatSlider(value=50.15, min=30.0, max=120.0, step=1e-4,
continuous_update=False)
C4 = widgets.FloatSlider(value=47.56, min=30.0, max=120.0, step=1e-4,
C4 = widgets.FloatSlider(value=48.86, min=30.0, max=120.0, step=1e-4,
continuous_update=False)

def capa_plus(clicked_button):
Expand Down

0 comments on commit 04da497

Please sign in to comment.