#!/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)