Solving coupled 1st ODEs with ODE45 or Runge-Kutta?
Mostra commenti meno recenti
Hi there, I am having to solve a simple problem where I am equating Newtons's Second Law to the Lorenz Force on a particle: F = ma = -eE
d2x/dt2 = (e/m)*E0cos(omega*t) x(t=0)=0; dx/dt(t=0)=0 (so at t=0: posn=0 and velocity=0)
Pretty simple right? Well doesn't seem so! I am getting strange results when I solve this with my RK4 routine.
I split in to two couples 1st ODEs:
x1p = x2 x2p = (e/m)E0cos(omega*t)
where x1=x, x1p=x2, x2p=(d2x/dt2)=(e/m)E0cos(omega*t)
Is it possible to use the ODE45 to solve coupled 1st ODEs? What would your advice be?
Thanks in advance, Martin
Risposte (0)
Categorie
Scopri di più su Ordinary Differential Equations in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!