RungeKutta numerical integration



Hi,

I am having trouble programming the RungeKutta integration method for a set
of differential equations. The issue is:

All the examples and algorithms on the web start by saying x' = f(t, x) - in
my case the x's are vectors. And the examples they give are like x' = 3tx +
2x^2. However I am trying to solve a set of equations in which my x's are
functions of t and I don't know these functions. So I have:

x1'[t] = lambda*x1[t] - mu*x2[t]
x2'[t] = lambda*x2[t] for example.. This is example is totally
imaginary by the way.

with initial conditions x1[0] = 1 x2[0] = 0

With this kind of a problem, when the algorithm asks me to find:

k1 = f(t, x)
k2 = f(t + h/2, x + h/2 * k1) ... and so on, I don't really know what to do
since I can't really add to x1[t] or t, and I get things like x1[h/2] which
doesn't make sense to me. Maybe I am having trouble understanding the
method, but I couldn't really find any examples that do things like this. By
the way, this is the right way to input into Mathematica, and it somehow
solves the system like this..

Any help is appreciated.

Thanks,

Toros


.



Relevant Pages


Quantcast