- #1

- 21

- 0

I am using adaptive stepsize Runge Kutta (order4) method to solve a set of Lotka Volterra system of equations.

But I am getting the errors

1) Step size too small

2) Too many steps in the routine

Can somebody please help me on this.

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter gradnu
- Start date

- #1

- 21

- 0

I am using adaptive stepsize Runge Kutta (order4) method to solve a set of Lotka Volterra system of equations.

But I am getting the errors

1) Step size too small

2) Too many steps in the routine

Can somebody please help me on this.

- #2

HallsofIvy

Science Advisor

Homework Helper

- 41,847

- 966

It would seem obvious from the second "error message" that their is a limit ion how many steps you can use in whatever program you are using. Of course, since the stepsize is the length of the interval divided by number of steps, using too many steps will cause the stepsize to be too small.

Do you have the documentation for your software? Is there a limit on how many steps you can use? If so, make sure your number of steps is below that limit. If not, try smaller numbers of steps until you don't get those error messages. The move it back up to find the limit.

- #3

- 15,415

- 687

This has nothing to do with mathematics!

You purists! Of course it does. Applied mathematics is a very important part of mathematics.

Back on topic:

First, you are using something in addition to fourth-order RK. For example, an RK4/5 adaptive step size integrator uses a fifth order RK integrator to act as a check on the fourth order integrtor. The step size is adjusted to make the fifth order integrator more-or-less agree with the fourth order integrator. Too little agreement and the step size is reduced; too much and the step size is increased.

Two possible causes of the error:

- You formulated the derivative function incorrectly. This can make the integrator try to find a numerical solution to an insoluble problem.
- The problem is inherently stiff. Adaptive RK integrators fare poorly against stiff systems.

- #4

- 21

- 0

I am using the code in 'C' from numerical recipes.

It works for small limits of integration but starts giving errors if I increase the interval of integration.

- #5

Integral

Staff Emeritus

Science Advisor

Gold Member

- 7,212

- 56

You have the code, do you not understand it? Seems like it is time to read through the code with the goal of understanding exactly what it is doing. That may mean doing some research on the RK method. This will also be an opportunity to improve your C skills.

You should be able to find in the code what the limits on your step size and number of steps is. You can then use the software as the programmer intended.

- #6

- 15,415

- 687

This disclaimer in Numerical Recipes in C section 16.2 is pertenant: "The routine odeint should be customized to the problem at hand". The Numerical Recipes routines use single-precision floating point

- #7

- 21

- 0

I apologize for posting the problem in Diff. Eq. section.

Thanks D H for the suggestions.

Thanks D H for the suggestions.

Share: