I don't understand how to properly use runge kutta

77 Views Asked by At

So I am trying to use runge kutta 4, to more acurately calculate forces. I am using code from github and I used their example of rabits and wolves populations. In IntegratorLSODE.cs, in lotkaVolterra(), that is where the customization happens, like the birth and death rate of each animal.

What I am confused about is the equations to calculate dR and dW.

I feel like I am doing this wrong, because I just set the force through another variable, and this ends up (I think) doing the same thing as in Euler's Method! I believe the problem is that I need to create an equation involving x and/or y. I have no idea how to do this.

Here's my code: (I changed it from the guy on github's)enter image description here Note: To compare code, got to the other guy's code on github.

Q: What can I do to accurately predict forces (runge kutta) without just using euler's method?