{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\nBraginskii coefficients\n=========================\n\nA short example of how to calculate classical transport coefficients\nfrom Bragi\u0144ski's theory.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from astropy import units as u\nfrom plasmapy.physics.transport.braginskii import ClassicalTransport\nimport matplotlib.pyplot as plt\nimport numpy as np"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "We'll use some sample ITER data, without much regard for whether\nthe regime is even fit for classical transport theory:\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "thermal_energy_per_electron = 8.8 * u.keV\nelectron_concentration = 10.1e19 / u.m**3\n\nthermal_energy_per_ion = 8.0 * u.keV\nion_concentration = electron_concentration\nion_particle = 'D+'  # a crude approximation"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "We now make the default ClassicalTransport object:\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "braginskii = ClassicalTransport(thermal_energy_per_electron,\n                                electron_concentration,\n                                thermal_energy_per_ion,\n                                ion_concentration,\n                                ion_particle)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "These variables are calculated during initialization and can be\nreferred to straight away:\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "print(braginskii.coulomb_log_ei)\nprint(braginskii.coulomb_log_ii)\nprint(braginskii.hall_e)\nprint(braginskii.hall_i)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "These quantities are not calculated during initialization and can be\nreferred to via methods. To signify the need to calculate them, we\ncall them via (). They could be made to act like variables via @Property,\nbut I'm not sure that's wise.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "print(braginskii.resistivity())\nprint(braginskii.thermoelectric_conductivity())"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "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.6.5"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}