Runge-Kutta vs Euler: Solving Two-Dimensional Differential Equation

1 reply · 7K views · last reply
mrsvan
Messages
2
Reaction score
0
Hi, I don't know if this is the right forum to address, but I will try nevertheless
Im solving a simple two-dimensional differential equation:

dx/dt = (-y,x)

which will give a circle when integrating over time.

Now, the problem is that the simple euler scheme seems to be a lot more precise than the runge-kutta fourth order method. I've spend two whole days trying to debug my code and I feel stuck. so, are there some special cases where rk is worse than euler -- or is there no other explanation than I have made a mistake somewhere (it's four lines of code and my supervisors have had a look without the error popping up.)
 
great monday... just after complaining in here i found that I've messed an extra time-increment in somewhere in the code :p sorry for the inconvenience