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

  • Context: Graduate 
  • 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.
 
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.
 

Similar threads

  • · Replies 65 ·
3
Replies
65
Views
10K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 31 ·
2
Replies
31
Views
8K