Python Forum

Full Version: ODE Code Help needed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I dont know how to code the following ODE

Output:
dU/dR = -k*R^2*V(R)[j(kR)-y(kR)U(R)]^2
When i find U®
, i have:
Output:
nl(r)=arctan(U(r))
In order to find nl i need to take limit of $r→∞$ so I need to continue integration until a big number for R...


Some background: j and y are spherical Bessel functions which I know is coded using scipy.spcecial somehow...
I have been given k=0.05 and k=0.5...
Output:
V(R)=A^2/R^4 where A =35.3 and R=7.0
I think U(0) should be zero as r tends to 0?

Im really in need of a solution to this code as it is for a project that I am working on with a group and my coding skills are poor to say the least. Any help would be great.

also sorry if this is hard to follow I don't know how the input works in this text box...
ODE - Ohio Department of Education?
Take a look at odeint function from Scipy package.

Also, you can probably simplify the ordinary differential equation (ODE): you wrote that V(R)=A^2/R^4, so the term -k*R^2*V(R) can be simplified.

It would be great, if you showed your attempts here, e.g. code of the function to be integrated (as it is shown in Scipy docs).