Options allowing to change the default behavior of solvers
... = cvode( ... , options) ... = ida( ... , options) ... = arkode( ... , options)
When calling cvode, arkode or ida the default behavior of the solver can be changed by specifying a sequence of named parameter values. These parameters are the following:
method | The solver method. CVODE accepts "adams" or "bdf", IDA accepts only "bdf". | ||||
rtol | The scalar relative tolerance to control the local error estimator | ||||
atol | The absolute tolerance controlling the local error. Can be a scalar or an array of the same dimension as the differential equation state. | ||||
maxorder | Allows to bound the maximum order of the method. The default maximum order of the method is 5 for the BDF method and 12 for the Adams method and any lower value can be chosen. Cannot be changed when using ARKODE. | ||||
h0 | Proposed initial step. By default the solver computes the initial step by estimating second derivatives. | ||||
hmin | Minimum value of solver time steps. Can make convergence fail if taken too large. | ||||
hmax | Maximum value of solver time steps. Use it with care and only if the solver misses an event (for example a discontinuity) because of a large step. If you need a finer discretization of time span don't use an interval as time span but a vector like | ||||
refine | The number of complimentary time points (plus one) added between two successive solver time points. This option is active when using an interval
![]() |
These options are accepted by all solvers but the prototype of expected functions may vary and is discussed in the relevant pages:
jacobian | See the Jacobian section of the user functions page of CVODE, IDA and ARKODE. |
events | See the Events section of the user functions page of CVODE, IDA and ARKODE. |
intcb | See the Callback section of the user functions page of CVODE, IDA and ARKODE. |
IDA accepts options that only make sense for differential-algebric implicit equations:
calcIC | A string specifying the type of initial condition to compute if |
yIsAlgebric | A vector of integer indices of non-differential states. |
function res=weissinger(t, y, yp) res=t*y^2 * yp^3 - y^3 * yp^2 + t*(t^2 + 1)*yp - t^2 * y; end t0=1; y0=sqrt(3/2); yp0=0; [t,y,yp]=ida(weissinger,[1 10],y0,yp0,calcIc="y0yp0"); | ![]() | ![]() |