Hello everybody
I want to solve the radial part of Schrodinger equation by shooting method. In this method I set the initial value of energy and appropriate boundary conditions. By varying the value of energy the best wave function, which satisfies the boundary conditions, is found. My code is:
ClearAll;
ClearSystemCache;
v[x_]:=If[0<x< 10,0,100];
energy=13.3;
xMax=12;
mc2=0.511 * 10^9;
hc = 1240 * 10^3 ;
solution = NDSolve[{x psi''[x]+ 2 psi'[x]== (8 Pi2 (mc2))/hc2 x ( v[x] - energy) psi[x], psi[0.01] == 1, psi'[0.01] == 0.001}, psi, {x, 0.01, xMax}];
Plot[psi[x]/. solution, {x, 0.01, xMax}]
Now I want to make a loop to change the value of energy and again recalculate the wave function until the correct wave function is obtained. I used Do[expr,{i,imin,imax,di}] but it didnt work. Please guide me how to make a loop to change the energy and plot wave functions for each value of energy.