Skip to content

Instantly share code, notes, and snippets.

@Keno
Created September 21, 2013 03:30
Show Gist options
  • Save Keno/6646942 to your computer and use it in GitHub Desktop.
Save Keno/6646942 to your computer and use it in GitHub Desktop.
{
"metadata": {
"language": "Julia",
"name": "PS2"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": "using SIUnits\nconst \u221a = sqrt;",
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": "Problem 8.6"
},
{
"cell_type": "code",
"collapsed": false,
"input": "# Constants\n\u0127 = 1.05457 * 10.0^(-34) * (Joule*Second)\ng = 9.80 * Meter/Second^2\nh = 1Meter\nm = 0.1KiloGram;",
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": "n = m*\u221a(g*h^3)/(3\u03c0*\u0127)",
"language": "python",
"metadata": {},
"outputs": [
{
"latex": "\\[3.1496804725592672\\times 10^{32}\\]",
"metadata": {},
"output_type": "pyout",
"prompt_number": 1,
"text": "3.1496804725592672e32"
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": "Problem 8.16"
},
{
"cell_type": "code",
"collapsed": false,
"input": "# Given quantities\nV_0 = 20 * convert(SIUnits.SIQuantity,ElectronVolt)\na = 10.0^-10 * Meter\nE_ext = 7 * 10.0^6 * Volt/Meter\ne = 1.60218 * 10.0^-19 * Coulomb\nm = 9.10938 * 10.0^-31 * KiloGram;",
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": "\u03b1 = e*E_ext\n\u03b3 = big(\u221a(8m*V_0^3)/(3\u03b1*\u0127))\n(8m*a^2)/(\u03c0*\u0127)*exp(2\u03b3)",
"language": "python",
"metadata": {},
"outputs": [
{
"latex": "\\[2.333792755615162060539210272222841595435920831604973758675418728172482085612561\\times 10^{37891}\\;\\text{s} \\]",
"metadata": {},
"output_type": "pyout",
"prompt_number": 2,
"text": "2.333792755615162060539210272222841595435920831604973758675418728172482085612561e+37890 with 256 bits of precision s "
}
],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": "",
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 4
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment