Sausage Instabilities on Top of Kinking Lengthening Current-Carrying Magnetic Flux Tubes - Code used for analysis and to generate figures 1-4
Description
Background
This is the code used in the analysis and to generate figures 1-4 of the paper "Sausage Instabilities on Top of Kinking Lengthening Current-Carrying Magnetic Flux Tubes".
Flux tube experiments can be classified by the flux tube’s evolution in a configuration space described by a normalized inverse aspect-ratio k̄ and current-to-magnetic flux ratio λ̄. A lengthening current-carrying magnetic flux tube traverses this k̄ - λ̄ space and crosses stability boundaries. We derive a single general criterion for the onset of the sausage and kink instabilities in idealized magnetic flux tubes with core and skin currents. The criterion indicates a dependence of the stability boundaries on current
profiles and shows overlapping kink and sausage unstable regions in the k̄ - λ̄ space with two free parameters. Numerical investigation of the stability criterion reduces the number of free parameters to a single one that describes the current profile, and confirms the overlapping sausage and kink unstable regions in k̄ - λ̄ space. A lengthening, ideal current-carrying magnetic flux tube can therefore become sausage unstable after it becomes kink unstable.
Dependencies
- 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.
Setup
Create three directories figures, output, source. Git clone or copy the repo into source.
Important files
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 k̄ - λ̄ for an equilibrium defined by a core skin current profile of a given core current to total current ratio \(\epsilon\). This file has a command line interface. Help can be accessed with python skin_core_scanner.py --help. newcomb.py determines the external stability of a single equilibrium (single pair of k̄ - λ̄ ).
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
-
Run the bash_script recreate_paper_data.sh. This will create a SQL database in output called output.db that keeps track of all runs and input parameters of skin_core_scanner.py and run skin_core_scanner.py three times to do a stability scan for three values of \(\epsilon\). The output data is stored in dated directories in output.output.db can be opened e.g. with the Firefox extension SQLite Manager and the run parameters can be inspected.
-
Generate paper figures 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.
newcomb.py description
Examines the equilibrium. If the equilibrium has a singularity, the Frobenius method is used to determine a small solution at an \(r>\) than the radius of the singularity. 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'\)are plugged into the potential energy equation to determine stability.
Contact
Jens von der Linden jensv@uw.edu
Notes
Files
jensv/fluxtubestability-v1.0.1.zip
Files
(46.6 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:0a44ff9c6089401c55b9788e1ceed90b
|
46.6 kB | Preview Download |
Additional details
Related works
- Compiles
- 10.5281/zenodo.230611 (DOI)
- Is cited by
- 10.1063/1.4981231 (DOI)
- Is new version of
- 10.5281/zenodo.220323 (DOI)
- Is supplement to
- https://github.com/jensv/fluxtubestability/tree/v1.0.1 (URL)