{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "PHiX Equilibrium profiles\n", "===" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Using the Tokamak Simulation Code (TSC) enables to produce the PHiX's equilibrium information such as magnetic flux surface, current flux, etc.\n", "Here, let us show some results under the typical coil current case." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from matplotlib import pyplot as plt\n", "\n", "from cherab.phix.plasma import import_equilibrium\n", "from cherab.tools.equilibrium import plot_equilibrium\n", "\n", "plt.rcParams[\"figure.dpi\"] = 150" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "TSC data is stored in ``\"../cherab/phix/plasma/data/**\"`` where each folder named as ``\"phix10\"``, ``\"phix12\"``, etc. \n", "has calculated data. Each data is formated as ``json``.\n", ":obj:`~cherab.phix.plasma.import_equilibrium` is a helper function\n", "to populate an instance of :obj:`~cherab.tools.equilibrium.efit.EFITEquilibrium` in each moedel case." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "eq = import_equilibrium(model_variant=\"phix10\")" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Using :obj:`~cherab.tools.equilibrium.plot.plot_equilibrium` function defined by the `cherab` package allows us to show some plots accrding to equilibrium information." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "nbsphinx-thumbnail" ] }, "outputs": [], "source": [ "plot_equilibrium(eq, resolution=0.005) # resolution = 5mm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The cases of the different coil current conditions are applied as follows:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "model_variant: phix12\n", "---" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "eq = import_equilibrium(model_variant=\"phix12\")\n", "plot_equilibrium(eq, resolution=0.005)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "model_variant: phix13\n", "---" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "eq = import_equilibrium(model_variant=\"phix13\")\n", "plot_equilibrium(eq, resolution=0.005)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "model_variant: phix14\n", "---" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "eq = import_equilibrium(model_variant=\"phix14\")\n", "plot_equilibrium(eq, resolution=0.005)" ] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "cherab-phix-dev", "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.9.15 | packaged by conda-forge | (main, Nov 22 2022, 15:55:03) \n[GCC 10.4.0]" }, "vscode": { "interpreter": { "hash": "2725905a4c02db19e04df9b8fdbbe5ec65a73ea52bebaf9474aa1cc98819834c" } } }, "nbformat": 4, "nbformat_minor": 2 }