views:

205

answers:

1

I was given three functions:

dx/dt = a(y-x)
dy/dt = x(b-z)-y
dz/dt = xy-cz

All the variables are set by the user. I can do it if its just the basic one-equation problem. But now, i need to make a program using the improved Euler's method. Can the method solve three functions at the same time? Or can I use the Runge-Kutta method?

+2  A: 

According to this description the improved Euler's method is just the second-order Runge-Kutta method... anyway I don't see any reason you couldn't use the improved Euler's method with three equations. Just apply the same procedure to each variable separately, for example

x(i+1) = x(i) + 0.5 * dt * (
                a*(y(i)-x(i)) +
                a*(
                   y(i)-x(i) +
                   dt*a*(y(i)-x(i))
                )
         )

and similarly for y and z.

David Zaslavsky