Skip to content

Instantly share code, notes, and snippets.

@certik
Created March 24, 2011 19:20
Show Gist options
  • Save certik/885668 to your computer and use it in GitHub Desktop.
Save certik/885668 to your computer and use it in GitHub Desktop.
Manipulate for Radial Schroedinger Equation
V[r] = -1/r;
Manipulate[
r0 = 10^r0exp;
If[usen,
En = -1/(2*n^2);
];
Plot[
Evaluate[
P[r] /. NDSolve[
{
P''[r] == -2*(En - V[r] - l*(l + 1)/(2*r^2))*P[r],
P[r0] == r0^(l + 1),
P'[r0] == (l + 1)*r0^l
},
P, {r, r0, rmax}
]
],
{r, r0, rmax}, PlotRange -> All
],
{{En, -1/(2*n^2), "E"}, -1, 0},
{l, 0, n, 1},
{n, 1, 10, 1},
{{rmax, 20}, 10, 100, 1},
{{r0exp, -9, "X: r0=10^X"}, -20, -1, 1},
{{usen, True, "Use E=-1/(2n^2)"}, {True, False}}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment