Modeling forces in a sphere using a system of ODEs
2 views (last 30 days)
Show older comments
Hello,
I'd like to use matlab to model force interactions between 2 electrons in a helium atom. I'm familiar with ode45 but am having a little trouble because my spherical coordinates r,theta,phi need to be redefined every iteration.
I have a starting velocity and position r,theta,phi for each particle and equations of the forces between the nucleus and each electron which should guide the movement. But, I am not sure how to introduce a position vector into an ode and have it change each time step to represent the result of the forces.
Here would be my input:
pos1=[r,theta,phi] % Starting values
velocity= some value
Particle 1 eq:
prt1eq=-k*2*e^2/me*(pos1)^2+k*e^2/me*(pos1-pos2)^2;
Particle 2 eq:
prt2eq=-k*2*e^2/me*(pos2)^2+k*e^2/me*(pos2-pos1)^2;
The equations are coupled. I'd like to do many iterations to map out the force values and corresponding positions.
Can someone point me in the right direction?
Thanks
Answers (0)
See Also
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!