How to Apply Runge-Kutta to a 2nd Order ODE?

  • Thread starter Thread starter hsong9
  • Start date Start date
  • Tags Tags
    Ode Runge-kutta
hsong9
Messages
71
Reaction score
1
Hi,

Could someone please show me how to solve the following simple problem using the Runge-Kutta (RK4) integration method?

(tw')' + tw = 0 with w(0) = 1, w'(0) = 0 on the interval [0,1]
by introducing the new variable v=tw' and considering the resulting first order differential system involving w and v
computed solution (wh(1),vh(1)) for h=1/10.


I'm trying to understand how to apply Runge-Kutta to this problem.


Thanks for your attention.
 
Physics news on Phys.org
If you let v= tw' then your problem becomes v'+ v= 0 or v'= -v with v(0)= 0. Now, what exactly is your question? What do you know about "Runge-Kutta"?
 
HallsofIvy said:
If you let v= tw' then your problem becomes v'+ v= 0 or v'= -v with v(0)= 0.
Not quite. The problem become v'+tw=0. v is not tw. It is tw'.
 
Ah, I misread the problem!

hSong9, the standard way of applying Runge-Kutta, or any numerical method for first order de's to second order is to rewrite the problem as two first order problems.

The differential equation is tw''+ w'+ tw= 0. If you let u= w' then w''= u' so the equation becomes tu'+ u+ tw= 0 or tu'= -u- tw. We also, of course, have w'= u so we have two first order equations for u and w. Run two simultaneous Runge-Kutta solvers for the two first order equations, at each step using the currrent values you have for both u and w in the formulas.

Your initial values, of course, will be w(0)= 1, w'(0)= u(0)= 0.
 
Thread 'Direction Fields and Isoclines'
I sketched the isoclines for $$ m=-1,0,1,2 $$. Since both $$ \frac{dy}{dx} $$ and $$ D_{y} \frac{dy}{dx} $$ are continuous on the square region R defined by $$ -4\leq x \leq 4, -4 \leq y \leq 4 $$ the existence and uniqueness theorem guarantees that if we pick a point in the interior that lies on an isocline there will be a unique differentiable function (solution) passing through that point. I understand that a solution exists but I unsure how to actually sketch it. For example, consider a...
Back
Top