#!/usr/bin/env python
"""
Created on Sun 3 Mar 2019/Magne Guttormsen/Fabio Zeiser
"""
import numpy as np
from numpy import sqrt, sin, cos, exp, pi
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import sys
import scipy.integrate as integrate
# some constants
mc2 = 939.56563 # MeV
hbarc = 197.3 #MeV fm
a = 1.2 * 235**(1/3.) # fm
V0 = 10. # MeV
def square_well(E):
""" Potential and solutions to the finite square well
Args:
E : Energy in MeV
Returns:
psi (function): wave function in [1/fm^0.5]
V (function): potential in MeV
"""
k = sqrt(2*mc2*E) / hbarc
l = sqrt(2*mc2*(E+V0)) / hbarc
A = 1.
F = exp(-2j*k*a) * A \
/ (cos(2*l*a) - 1j*sin(2*l*a)/(2*k*l) * (k**2+l**2))
B = 1j*sin(2*l*a)/(2*k*l) * (l**2-k**2) * F
C = (sin(l*a) + 1j*k/l*cos(l*a)) * exp(1j*k*a) * F
D = (cos(l*a) - 1j*k/l*sin(l*a)) * exp(1j*k*a) * F
# print a
# print A
# print B
# print C
# print D
# print F
Trans = np.abs(F)**2 / np.abs(A)**2
# Definer boks potensialet
def boks1(x):
return 0.0
def boks2(x):
return 0.0
def boks3(x):
return -V0
def V(x):
conds = [x<-a, x>a, (x>-a) & (xa, (x>-a) & (xa, (x>-a) & (x