How can I approximate a 2nd order ODE using 4th order Runge-Kutta?

  • Thread starter Thread starter scothoward
  • Start date Start date
  • Tags Tags
    2nd order Ode
scothoward
Messages
28
Reaction score
0

Homework Statement



Hey,

I am trying to approximate the solution to a second order ODE using the 4th order Runge-Kutta.

I was told that in order to do this, I have to write the second order ODE and a pair of 1st order ODEs.

Given that my differential equation is

d^2v/dt^2 + adv/dt + bv = 0, where a and b are constant coefficients, I am a little lost on how to do this.

Any advice on how to approach this?

Thanks


The Attempt at a Solution


The ODE I am trying to approximate involves voltage as a function of time. The examples that I have seen involve position, velocity and acceleration - so there is a relationship (x' = v)

I am unsure as how to do this in my case.
 
Physics news on Phys.org
General Method for Homogeneous Linear Equations:
av'' + bv'+ cv = 0 (a != 0)
Write down the characterisitc equation:
av^2 + bv+ c = 0 (a != 0)

Determine what type of response it gives by determining the roots. We just want to use b^2 - 4*a*c as it dictates the ODE's transient response.

1) If both roots are real and distinct (b^2 - 4*a*c > 0) (r1 and r2) then the solution can be written as:
v(t) = c1*e^(r1*t) + c2*e^(r2*t)

2) If both roots are real and identical (b^2 - 4*a*c = 0) (r1):
v(t) = c1*e^(r1*t) + c2*t*e^(r1*t)

2) If both roots are imaginary (b^2 - 4*a*c < 0) (r1 and r2 conjugate):
r1 = r2(conj) = x + iy
x = -b / (2 * a)
y = sqrt(4*a*c - b^2) / (2 * a)

v(t) = c1 * e^(x*t)cos(y*t) + c2 * e^(x*t)sin(y*t)
 
Dietrick, do you understand that what you did there has no relevance at all to the question?

Scothoward, with a differential equation of the form d^2v/dt^2 + adv/dt + bv = 0, let u= dv/dt. Then d^2v/dt^2= du/dt and the equation becomes du/dt+ adv/dt+ bv= du/dt+ au+ bv= 0 or du/dt= -au- bv. Of course, your second equation is dv/dt= u.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top