This code determines the ideal MHD stability limit of current-carrying magnetic flux tubes / cylindrical screw pinches. The code integrates Newcomb's Euler-Lagrange equation to determine the external stability of current profiles with a discrete core and skin current.
Flux tube experiments can be classified by the flux tube’s evolution in a configuration space described by a normalized inverse aspect-ratio
- python 2.7.12
- numpy 1.11.2
- numba 0.30.0
- scipy 0.18.1
- matplotlib 1.5.3
- seaborn 0.7.1
- sqlite 3.13
- gitpython 2.1.0
The dependencies can be installed with the anaconda python distribution. gitpython can be installed with pip.
- Create three directories
figures
,output
,source
. - Git clone or copy the repo into
source
.
recreate_paper_data.sh
recreates the data underlying figures 3 and 4 of the paper.
skin_core_scanner.py
is a script file that runs a stability scan over python skin_core_scanner.py --help
.
newcomb.py
determines the external stability of a single equilibrium (single pair of \bar{k} \bar{\lambda}).
paper_figures.py
recreates the figures in the paper. This file has a command line interface. Help can be accessed with python paper_figures.py --help
.
-
Run the bash_script
recreate_paper_data.sh
. This will create a SQL database inoutput
calledoutput.db
that keeps track of all runs and input parameters ofskin_core_scanner.py
and runskin_core_scanner.py
three times to do a stability scan for three values of$\epsilon$ . The output data is stored in dated directories inoutput
.output.db
can be opened e.g. with the Firefox extension SQLite Manager and the run parameters can be inspected. -
The paper figures can be generated with
python paper_figures ../output/[timestamp] ../output/[timestamp] ../output/[timestamp]
, where[timestamp]
is the dated directory name. The order should be from oldest to newest date.
Examines the equilibrium. If the equilibrium has a singularity, the Frobenius method is used to determine a small solution at an r > than instability. If the singularity is Suydam unstable no attempt is made to calulate external stability. If there is no Suydam instability a Frobenius power series solution close to r=0 is chosen or if the integration does not start at r=0 a given xi is used as boundary condition. Only the last interval is integrated. Xi and xi_der are plugged into the potential energy equation to determine stability.
Jens von der Linden jensv@uw.edu