-
Notifications
You must be signed in to change notification settings - Fork 0
/
schro_equation.py
45 lines (38 loc) · 1.41 KB
/
schro_equation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""This file contains the simplified deuteron equation we must solve to
get the eigenvalue and the eigenfunction.
Important information about units of measurements:
Units used:
- Distances: fm
- Mass: MeV / c**2
- Energy: MeV
We defined the reduced Planck constant with the next dimensions:
h_bar * c = 197.327 MeV * fm
"""
import numpy as np
from scipy.integrate import solve_ivp
from scipy.optimize import root_scalar
import potential as pot
def radial_equation(r, y, E):
"""This function defines from our 2nd order differential equation a
system of 2 1st order ODEs, created to later solve the problem with
SciPy.
We have the eigenfunction 'us' representing the l=0 s-wave. From
there, we define:
dus: 1st derivative of us, which will be named as vs
dvs: 2nd derivative of us (1st derivative of vs)
Inputs:
r: distance between both nucleons
E: energy value
y: vector which will contain the variables [us, vs]
Output:
[dus, dvs]: the system of 1st order ODEs which will be solved
with SciPy
"""
us, vs = y
# Definition of needed parameters
h_bar = 197.327 # Reduced Planck constant
M = 938.918 # Twice the reduced mass of deuteron
# System of equations we want to solve
dus = vs
dvs = (M / (h_bar**2)) * (pot.V_c_squarewell(r) - E) * us
return [dus, dvs]