About -- Forum -- Articles -- Tutorials -- Books -- Apparel -- Contact

You are not logged in.

Announcement

#1 2006-12-24 08:25:26

luca-deltodesco
New Member
Registered: 2006-10-21
Posts: 7

runge kutta integration

im having trouble understanding the runge kutta method of integration,

according to wikipedia

LaTeX Image
LaTeX Image
LaTeX Image
LaTeX Image
LaTeX Image
LaTeX Image

what i dont understand about this is the function f:

why is it a function of time, and the variable being integrated for?

Last edited by luca-deltodesco (2006-12-24 08:27:06)

Offline

 

#2 2006-12-24 20:05:31

BenTheMan
Member
From: Columbus, OH
Registered: 2006-08-03
Posts: 147
Website

Re: runge kutta integration

f is a function of time because the differential equation should be written as
LaTeX Image.

Pick an easy differential equation and work it out.  This is only way to really understand these numerical things.  Or you could write a quick computer program to do it.


Sometimes you eat the bahr, and, well, sometimes he eats you. ---Anon

Offline

 

#3 2006-12-24 22:48:45

luca-deltodesco
New Member
Registered: 2006-10-21
Posts: 7

Re: runge kutta integration

well lets pick this sample:

p' = v
v' = s(a-p)  - kv

how would i apply the runge kutta method here for these two connected differential equations?

Offline

 

#4 2006-12-25 04:55:40

BenTheMan
Member
From: Columbus, OH
Registered: 2006-08-03
Posts: 147
Website

Re: runge kutta integration

I don''t think it works for a coupled system of differential equations.

What is it you are trying to do?  This method is only useful for numerical solutions to first order differential equations.


Sometimes you eat the bahr, and, well, sometimes he eats you. ---Anon

Offline

 

#5 2006-12-25 09:01:04

luca-deltodesco
New Member
Registered: 2006-10-21
Posts: 7

Re: runge kutta integration

these are first order differential equations, only that i need to integrate multiple ones thats are interlinked for a physics system.

i took this over to mathsisfun too, and i got told that the runge kutta method is only for implicit differential equations bladibla, however, i did have a try at doing it my own way, and i came up with something that seems to work, i dont know if its technically correct rk4 or what but.

http://www.mathsisfun.com/forum/viewtopic.php?id=5502

as you can see, i tried it out with a simple system, compared to an exact solution to the two differentials with respect to time given the inital values, and it seems to be working fine.

to reiterate what i say at the end


given the state variables, and a known intial value for all states LaTeX Image
and, a 'vector' of differential functions LaTeX Image such that LaTeX Image

then you have

LaTeX Image
LaTeX Image
LaTeX Image
LaTeX Image
LaTeX Image

Last edited by luca-deltodesco (2006-12-25 09:01:52)

Offline

 

#6 2006-12-25 09:49:29

luca-deltodesco
New Member
Registered: 2006-10-21
Posts: 7

Re: runge kutta integration

ive tested this method, and it does seem to hold, and infact, is inline with the defintion of the runge kutta method anyways, it evaluates the slope at the start of the interval, then the slope at half way through the interval using the slope to calculate the midpoint
then calculates a second slope at half way through using the second slope to calculate the midpoint, and then it calculates the slope at the end of the interval using the last slope to calculate the end point, and averages them all together.

and since the functions are functions of all state variables, you can have a system with 20 odd differential equations all interlinked like

x' = a + 2bc - x
a' = xb - (a-c)
c' = b
b' = cx-ab

Offline

 

#7 2006-12-26 18:10:26

BenTheMan
Member
From: Columbus, OH
Registered: 2006-08-03
Posts: 147
Website

Re: runge kutta integration

So, you want to know if your method is valid?


Sometimes you eat the bahr, and, well, sometimes he eats you. ---Anon

Offline

 

#8 2006-12-26 18:35:49

luca-deltodesco
New Member
Registered: 2006-10-21
Posts: 7

Re: runge kutta integration

yes, it does seem to work when testing it, but id like confirmation that its correct

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson



Copyright © J. Christopher Moore Publishing, All Rights Reserved