# 6.5. IDA Constants

Below we list all input and output constants used by the main solver and linear solver modules, together with their numerical values and a short description of their meaning.

## 6.5.1. IDA input constants

Table 6.8 IDA Input Constants

Constant

Value

Description

IDA_NORMAL

1

Solver returns at specified output time.

IDA_ONE_STEP

2

Solver returns after each successful step.

IDA_YA_YDP_INIT

1

Compute $$y_a$$ and $$\dot{y}_d$$, given $$y_d$$.

IDA_Y_INIT

2

Compute $$y$$, given $$\dot{y}$$.

SUN_PREC_NONE

0

No preconditioning

SUN_PREC_LEFT

1

Preconditioning on the left only.

SUN_MODIFIED_GS

1

Use modified Gram-Schmidt procedure.

SUN_CLASSICAL_GS

2

Use classical Gram-Schmidt procedure.

## 6.5.2. IDA output constants

Table 6.9 IDA Output Constants

Constant

Value

Description

IDA_SUCCESS

0

Successful function return.

IDA_TSTOP_RETURN

1

IDASolve succeeded by reaching the specified stopping point.

IDA_ROOT_RETURN

2

IDASolve succeeded and found one or more roots.

IDA_WARNING

99

IDASolve succeeded but an unusual situation occurred.

IDA_TOO_MUCH_WORK

-1

The solver took mxstep internal steps but could not reach tout.

IDA_TOO_MUCH_ACC

-2

The solver could not satisfy the accuracy demanded by the user for some internal step.

IDA_ERR_FAIL

-3

Error test failures occurred too many times during one internal time step or minimum step size was reached.

IDA_CONV_FAIL

-4

Convergence test failures occurred too many times during one internal time step or minimum step size was reached.

IDA_LINIT_FAIL

-5

The linear solver’s initialization function failed.

IDA_LSETUP_FAIL

-6

The linear solver’s setup function failed in an unrecoverable manner.

IDA_LSOLVE_FAIL

-7

The linear solver’s solve function failed in an unrecoverable manner.

IDA_RES_FAIL

-8

The user-provided residual function failed in an unrecoverable manner.

IDA_REP_RES_FAIL

-9

The user-provided residual function repeatedly returned a recoverable error flag, but the solver was unable to recover.

IDA_RTFUNC_FAIL

-10

The rootfinding function failed in an unrecoverable manner.

IDA_CONSTR_FAIL

-11

The inequality constraints were violated and the solver was unable to recover.

IDA_FIRST_RES_FAIL

-12

The user-provided residual function failed recoverably on the first call.

IDA_LINESEARCH_FAIL

-13

The line search failed.

IDA_NO_RECOVERY

-14

The residual function, linear solver setup function, or linear solver solve function had a recoverable failure, but IDACalcIC could not recover.

IDA_NLS_INIT_FAIL

-15

The nonlinear solver’s init routine failed.

IDA_NLS_SETUP_FAIL

-16

The nonlinear solver’s setup routine failed.

IDA_MEM_NULL

-20

The ida_mem argument was NULL.

IDA_MEM_FAIL

-21

A memory allocation failed.

IDA_ILL_INPUT

-22

One of the function inputs is illegal.

IDA_NO_MALLOC

-23

The IDA memory was not allocated by a call to IDAInit.

IDA_BAD_EWT

-24

Zero value of some error weight component.

IDA_BAD_K

-25

The $$k$$-th derivative is not available.

IDA_BAD_T

-26

The time $$t$$ is outside the last step taken.

IDA_BAD_DKY

-27

The vector argument where derivative should be stored is NULL.

IDALS_SUCCESS

0

Successful function return.

IDALS_MEM_NULL

-1

The ida_mem argument was NULL.

IDALS_LMEM_NULL

-2

The IDALS linear solver has not been initialized.

IDALS_ILL_INPUT

-3

The IDALS solver is not compatible with the current N_Vector module.

IDALS_MEM_FAIL

-4

A memory allocation request failed.

IDALS_PMEM_NULL

-5

The preconditioner module has not been initialized.

IDALS_JACFUNC_UNRECVR

-6

The Jacobian function failed in an unrecoverable manner.

IDALS_JACFUNC_RECVR

-7

The Jacobian function had a recoverable error.

IDALS_SUNMAT_FAIL

-8

An error occurred with the current SUNMatrix module.

IDALS_SUNLS_FAIL

-9

An error occurred with the current SUNLinearSolver module.