{ "cells": [ { "cell_type": "markdown", "id": "f2df5433-1df0-4ea1-b055-dffbc8993123", "metadata": {}, "source": [ "# Manual Matching of a WEST ICRH Antenna on Vacuum" ] }, { "cell_type": "markdown", "id": "808b14fd-dc7e-412c-abfa-b3ca0254598b", "metadata": {}, "source": [ "This notebook calculates the charts used in the internal documentation for the IC Operators for the manual matching on vacuum. " ] }, { "cell_type": "code", "execution_count": null, "id": "14c9acaa-9f2e-4f89-bb51-6b9497c88ef6", "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from tqdm.notebook import tqdm\n", "import skrf as rf\n", "\n", "# WEST ICRH Antenna package\n", "import sys; sys.path.append('..')\n", "from west_ic_antenna import WestIcrhAntenna\n", "#rf.stylely()" ] }, { "cell_type": "markdown", "id": "6c69f03f-a506-4d68-bdd7-f9e5fe758d4d", "metadata": {}, "source": [ "## Matching each side separately\n", "For a given RF frequency $f_0$, an antenna can be matched on the left side only, then on the right side only, before using both sides together and shifting the frequency depending on the phase excitation (see [Tutorial on Manual Matching](tutorial_matching_manual.ipynb). A further step can consist of slightly adjusting the four capacitors, to decrease the reflected powers seen by the generators. \n", "\n", "This section calculates the frequency shift to apply depending on the phase excitation and the theoretical capacitance shifts to further apply for additional improvement." ] }, { "cell_type": "code", "execution_count": null, "id": "0f2d4877-46c6-44db-8501-c0363046fa8b", "metadata": {}, "outputs": [], "source": [ "f0_MHzs = np.arange(46, 66, 5) # decrease the step size to get more precise plots" ] }, { "cell_type": "code", "execution_count": null, "id": "4d290673-ea1c-4f85-8a66-f54ee92a6121", "metadata": {}, "outputs": [], "source": [ "# frequency scan for dipole and monopole\n", "freq_shift_MHzs_dipo, freq_shift_MHzs_mono = [], []\n", "C_vacuums, C_opt_dipoles, C_opt_monopoles = [], [], []\n", "for f0_MHz in tqdm(f0_MHzs):\n", " freq = rf.Frequency(f0_MHz, f0_MHz, npoints=1, unit='MHz')\n", " ant_vacuum = WestIcrhAntenna(frequency=freq) # default is vacuum coupling\n", " Cs_left = ant_vacuum.match_one_side(f_match=f0_MHz*1e6, side='left', decimals=2, verbose=False)\n", " Cs_right = ant_vacuum.match_one_side(f_match=f0_MHz*1e6, side='right', decimals=2, verbose=False)\n", " Cs = [Cs_left[0], Cs_left[1], Cs_right[2], Cs_right[3]]\n", " del ant_vacuum # cleanup mem\n", "\n", " # searching for the frequency shift to apply\n", " freqs = rf.Frequency(f0_MHz - 1, f0_MHz + 1, npoints=201, unit='MHz')\n", " ant = WestIcrhAntenna(frequency=freqs)\n", "\n", " # dipole\n", " s_act = np.abs(ant.s_act(Cs=Cs, power=[1,1], phase=[0,np.pi]))\n", " f_opt_dipole = freqs.f_scaled[np.argmin(s_act[:,0])] # assume same at right\n", " freq_shift_MHzs_dipo.append(f_opt_dipole - f0_MHz)\n", " \n", " # monopole\n", " s_act = np.abs(ant.s_act(Cs=Cs, power=[1,1], phase=[0,0]))\n", " f_opt_monopole = freqs.f_scaled[np.argmin(s_act[:,0])]\n", " freq_shift_MHzs_mono.append(f_opt_monopole - f0_MHz)\n", "\n", " # Finally determining the optimum set of capacitance\n", " # for the dipole or monopole case\n", " C_opt_dipole = ant.match_both_sides(f_match=f_opt_dipole*1e6, decimals=2, power=[1,1], phase=[0,np.pi], verbose=False)\n", " C_opt_monopole = ant.match_both_sides(f_match=f_opt_monopole*1e6, decimals=2, power=[1,1], phase=[0,0], verbose=False)\n", " del ant # memory cleanup\n", " \n", " C_vacuums.append(Cs)\n", " C_opt_dipoles.append(C_opt_dipole)\n", " C_opt_monopoles.append(C_opt_monopole)\n", "\n", "freq_shift_MHzs_dipo = np.array(freq_shift_MHzs_dipo)\n", "freq_shift_MHzs_mono = np.array(freq_shift_MHzs_mono)\n", "C_vacuums = np.array(C_vacuums)\n", "C_opt_dipoles = np.array(C_opt_dipoles)\n", "C_opt_monopoles = np.array(C_opt_monopoles)" ] }, { "cell_type": "markdown", "id": "d12d6bb7-2f22-4d3d-b4af-fa56d2373fdb", "metadata": {}, "source": [ "The frequency shift to apply for dipole and monopole configurations are:" ] }, { "cell_type": "code", "execution_count": null, "id": "01247c63-ad55-4ddd-8aa3-08bbf368cace", "metadata": {}, "outputs": [], "source": [ "fig, ax = plt.subplots()\n", "ax.plot(f0_MHzs[freq_shift_MHzs_dipo>0.1], freq_shift_MHzs_dipo[freq_shift_MHzs_dipo>0.1], marker='^', ls='')\n", "ax.set_xlabel('Initial match frequency (side by side) [MHz]')\n", "ax.set_ylabel('Frequency shift to apply [MHz]')\n", "ax.set_title('Dipole')\n", "ax.set_xlim(46, 65)\n", "ax.grid(True)" ] }, { "cell_type": "code", "execution_count": null, "id": "99d3385b-3f70-439d-9dd7-856544de6139", "metadata": {}, "outputs": [], "source": [ "fig, ax = plt.subplots()\n", "ax.plot(f0_MHzs[freq_shift_MHzs_mono<-0.1], freq_shift_MHzs_mono[freq_shift_MHzs_mono<-0.1], marker='o', ls='', color='C1')\n", "ax.set_xlabel('Initial match frequency (side by side) [MHz]')\n", "ax.set_ylabel('Frequency shift to apply [MHz]')\n", "ax.set_title('Monopole')\n", "ax.set_xlim(46, 65)\n", "ax.grid(True)" ] }, { "cell_type": "markdown", "id": "c474551a-ef4c-43a2-a72b-bfb4e65c116a", "metadata": {}, "source": [ "The capacitor shift" ] }, { "cell_type": "code", "execution_count": null, "id": "8d6793fd-f53b-4f47-901f-3a9c6010ccbf", "metadata": {}, "outputs": [], "source": [ "diff_dipole = C_opt_dipoles - C_vacuums\n", "\n", "fig, ax = plt.subplots()\n", "ax.plot(f0_MHzs, diff_dipole[:,0], marker='o', ls='', color='C0', label='C1')\n", "ax.plot(f0_MHzs, diff_dipole[:,1], marker='o', ls='', color='C1', label='C2')\n", "ax.plot(f0_MHzs, diff_dipole[:,2], marker='o', ls='', color='C2', label='C3')\n", "ax.plot(f0_MHzs, diff_dipole[:,3], marker='o', ls='', color='C3', label='C4')\n", "\n", "ax.set_xlabel('Initial match frequency (side by side) [MHz]')\n", "ax.set_ylabel('Capacitance shift to apply [pF]')\n", "ax.set_title('Dipole')\n", "ax.set_xlim(46, 65)\n", "ax.set_ylim(-0.2, +0.2)\n", "ax.legend()\n", "ax.grid(True)" ] }, { "cell_type": "code", "execution_count": null, "id": "41cfe253-886f-44c4-8132-5a6704ef47cc", "metadata": {}, "outputs": [], "source": [ "diff_dipole = C_opt_monopoles - C_vacuums\n", "\n", "fig, ax = plt.subplots()\n", "ax.plot(f0_MHzs, diff_dipole[:,0], marker='o', ls='', color='C0', label='C1')\n", "ax.plot(f0_MHzs, diff_dipole[:,1], marker='o', ls='', color='C1', label='C2')\n", "ax.plot(f0_MHzs, diff_dipole[:,2], marker='o', ls='', color='C2', label='C3')\n", "ax.plot(f0_MHzs, diff_dipole[:,3], marker='o', ls='', color='C3', label='C4')\n", "\n", "ax.set_xlabel('Initial match frequency (side by side) [MHz]')\n", "ax.set_ylabel('Capacitance shift to apply [pF]')\n", "ax.set_title('Monopole')\n", "ax.set_xlim(46, 65)\n", "ax.set_ylim(-0.2, +0.2)\n", "ax.legend()\n", "ax.grid(True)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.7" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": true, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }