JSim allows the user to select which ODE solver to use. With ODE solvers, there is usually a trade-off between speed and accuracy--more accurate ODE solvers usually require more computation time. The ODE solvers are listed in order of increasing complexity.

- Euler
- RK2
- RK4
- KM
- Fehlberg
- CVode
- Dopri5
- Radau
- Auto
- Comments or Questions?

## Euler: forward one-step

### Parameters:

- nstep: Subdivides the stepsize of the problem. If the independent variable is "t", the stepsize is t.delta/nstep. Default value is 2. Error is first order (proportional to actual step size).

## RK2: 2nd order Runge-Kutta, also known as modified trapezoidal method

### Parameters:

- nstep: Subdivides the stepsize of the problem. If the independent variable is "t", the stepsize is t.delta/nstep. Default value is 2. Error is second order (proportional to actual step size squared).

## RK4: 4th order Runge-Kutta

### Parameters:

- nstep: Subdivides the stepsize of the problem. If the independent variable is "t", the stepsize is t.delta/nstep. Default value is 2.

## KM: Runge-Kutta Merson with adaptive stepsize

### Parameters:

- minstep: Minimum stepsize for problem. Default value is 1.0e-4.
- maxstep: Maximum stepsize for problem. Default value is 1.0e-1.
- tol: Error tolerance for solution. Default value is 1.0e-6.

## Fehlberg: Runge-Kutta Fehlberg (RKF45)

### Parameters:

- minstep: Minimum stepsize for problem. Default value is 1.0e-4.
- maxstep: Maximum stepsize for problem. Default value is 1.0e-1.
- tol: Error tolerance for solution. Default value is 1.0e-6.

## CVode: BDF and Adams-Moulton methods

### Parameters:

- reltol: Relative tolerance in solution. Default value is 1.0e-7.
- abstol: Absolute tolerance in solution. Default value is 1.0e-8.
- maxsteps: Maximum number of steps. Default value is 100000.
- stiff: checking the box marked "stiff" invokes a BDF (backward differentiation formula) otherwise Adams-Moulton methods are used.

## Dopri5: Dorman Prince 5th order with variable stepsize (explicit Runge-Kutta Method)

### Parameters:

- reltol: Relative error tolerance. Default is 1.0e-7.
- abstol: Absolute error tolerance.Default is 1.0e-7.
- nstep: Number of computed steps. Default is 100000.
- stiff: Test for stiffness after each j*stiff steps, where j is some integer. Default is 1000.
- round: Rounding Unit. Default is 2.3e-16.
- safety: Safety factor in step size prediction. Default is 0.9.
- loselect: Step size selection. The new internal step size is chosen subject to the restriction

loselect less than or equal to (new step size)/(old step size).

Default is 0.2. - hiselect: Step size selection. The new internal step size is chosen subject to the restriction

(new step size)/(old step size) less than or equal to hiselect. Default is 10. - beta: Beta for stabilized step size control. Larger values of beta (less than or equal to 0.1) make the step size control more stable. Default is 0.04.

## Radau: Implicit Runge-Kutta methods with variable order (5,9,13) with step size control

### Parameters:

- reltol: Relative error tolerance. Default is 1.0e-4.
- abstol: Absolute error tolerance.Default is 1.0e-7.
- nstep: Number of computed steps. Default is 100000.
- round: Rounding Unit. Default is 1.0e-16.
- safety: Safety factor in step size prediction. Default is 0.9.
- minord: The minimum order of the problem is 2*minord-1. Possible values are 1, 3, 5, and 7. Default is 3.
- maxord: The maximum order of the problem is 2*maxord-1. Possible values are 1, 3, 5, and 7. Default value is 7.
- initord: The initial order of the problem is 2*initord-1. Possible values are 1, 3, 5, and 7. Default value is 3.
- newton: The maximum number of Newton iterations for the solution of the implicit system in each step is [newton+(order-3)*2.5], where order is the order of the solution (see minord, maxord, initord). Default value is 7.
- jacob: Decides whether the Jacobian should be recomputed; increase jacob to 0.1 when Jacobian evaluations are costly. For small systems, jacob should be smaller (0.001). Negative value forces the code to compute the Jacobian after every step. Default value is 0.001.
- losize: IF [losize LessThan Hnew/Hold LessThan hisize] where Hnew is is the new step size and Hold is the old step size, then the step size is not changed. For small systems use losize=1.0, hisize=1.2. For large systems, try losize=0.99, hisize=2. Default value is 1.0.
- hisize: IF [losize LessThan Hnew/Hold LessThan hisize] where Hnew is is the new step size and Hold is the old step size, then the step size is not changed. For small systems use losize=1.0, hisize=1.2. For large systems, try losize=0.99, hisize=2. Default value is 1.2.
- loselect: The new step size is chosen subject to the restriction [loselect LessThanOrEqualTo Hnew/Hold LessThanOrEqualTo hiselect], where Hnew is is the new step size and Hold is the old step size. Default value is 0.2.
- hiselect: The new step size is chosen subject to the restriction [loselect LessThanOrEqualTo Hnew/Hold LessThanOrEqualTo hiselect], where Hnew is is the new step size and Hold is the old step size. Default value is 8.
- locontract: Order is increased if the contractivity factor is smaller than locontract. Default value is 0.002.
- hicontract: Order is decreased if the contractivity factor is larger than hicontract. Default value is 0.8.
- hiorder: Order is decreased only if the stepsize ratio satisfies [loorder LessThanOrEqualTo Hnew/H LESSThanOrEqualTo hiorder], where Hnew is the new stepsize and H is the initial step size taken to be 1.0E-6. Default value is 1.2.
- loorder: Order is decreased only if the stepsize ratio satisfies [loorder LessThanOrEqualTo Hnew/H LESSThanOrEqualTo hiorder], where Hnew is the new stepsize and H is the initial step size taken to be 1.0E-6. Default value is 0.8.

Comments or Questions?

**Model development and archiving support at https://www.imagwiki.nibib.nih.gov/physiome provided by the following grants:** NIH U01HL122199 Analyzing the Cardiac Power Grid, 09/15/2015 - 05/31/2020, NIH/NIBIB BE08407 Software Integration, JSim and SBW 6/1/09-5/31/13; NIH/NHLBI T15 HL88516-01 Modeling for Heart, Lung and Blood: From Cell to Organ, 4/1/07-3/31/11; NSF BES-0506477 Adaptive Multi-Scale Model Simulation, 8/15/05-7/31/08; NIH/NHLBI R01 HL073598 Core 3: 3D Imaging and Computer Modeling of the Respiratory Tract, 9/1/04-8/31/09; as well as prior support from NIH/NCRR P41 RR01243 Simulation Resource in Circulatory Mass Transport and Exchange, 12/1/1980-11/30/01 and NIH/NIBIB R01 EB001973 JSim: A Simulation Analysis Platform, 3/1/02-2/28/07.