https://zenodo.org/badge/DOI/10.5281/zenodo.2302057.svg Documentation Status https://travis-ci.org/dstansby/nhdspy.svg?branch=master https://codecov.io/gh/dstansby/nhdspy/branch/master/graph/badge.svg

nhdspy is a wrapper for the NHDS dispersion relation solver. For the original NHDS code see https://github.com/danielver02/NHDS.

If you use this software to produce data for publication, please cite the NHDS paper: http://iopscience.iop.org/article/10.3847/2515-5172/aabfe3


To install nhdspy, run

pip install nhdspy


NHDS is written in fortran, so requires a working fortran compiler. When nhdspy is first run it attempts to compile NHDS; if it is not successfully it gracefully exits and prints the fortran compile error.


import nhdspy
import matplotlib.pyplot as plt

electrons = nhdspy.Species(-1, 1 / 1836, 1, 0, 1, 1)
protons = nhdspy.Species(1, 1, 1, 0, 1, 1)

va = 1e-4
theta_kB = 0.001
omega_0 = 0.009 - 0.0001 * 1j
kzmin = 0.01
kzmax = 0.2
input = nhdspy.InputParams([electrons, protons], omega_0, theta_kB,
                           va, kzmin, kzmax)
output = nhdspy.run(input)

fig, ax = plt.subplots()
ax.plot(output.kz, output.omega_real, label='Real part')
ax.plot(output.kz, output.omega_imag, label='Imaginary part')
ax.set_ylabel(r'$\omega / \Omega_{p}$')


Indices and tables