Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ODE Code Help needed
#1
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...
Reply
#2
ODE - Ohio Department of Education?
Reply
#3
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).
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020