From e1ddd40e512f7cfad58eaf7e63ae36a27f9fb971 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Mon, 1 Oct 2018 22:59:41 +0000 Subject: As presented at Rutgers on 2018-09-27 --- figs/contour.fig/contour.py | 82 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 figs/contour.fig/contour.py (limited to 'figs/contour.fig/contour.py') diff --git a/figs/contour.fig/contour.py b/figs/contour.fig/contour.py new file mode 100644 index 0000000..102df86 --- /dev/null +++ b/figs/contour.fig/contour.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 + +import cmath +import math +import scipy.special as sp +from scipy import optimize as op +import random +import sys + +# number of roots +nr_roots=4 + +# size of plot +plotsize_x=3 +plotsize_y=3 +# rescale plot (so roots are not too close together) +plotsize_scale_x=1 +plotsize_scale_y=6 + +# numerical values +hbar=6.58e-16 # eV.s +m=9.11e-31 # kg +Vn=9 # eV +En=20e9 # V/m + +V=1 +E=En*hbar/(Vn**1.5*m**0.5)*math.sqrt(1.60e-19) + +# sqrt with branch cut along iR_+ +def sqrt_p(x): + r,p=cmath.polar(x) + if(pplotsize_y): + return(False) + for x in roots: + if(abs(root-x)<1e-12): + return(False) + return(True) + +# find roots +roots=[] +while len(roots)