6.1. Introduction

IDAS is part of a software family called SUNDIALS: SUite of Nonlinear and DIfferential/ALgebraic equation Solvers [81]. This suite consists of CVODE, ARKODE, KINSOL, and IDAS, and variants of these with sensitivity analysis capabilities, CVODES and IDAS.

IDAS is a general purpose solver for the initial value problem (IVP) for systems of differential-algebraic equations (DAEs). The name IDAS stands for Implicit Differential-Algebraic solver with Sensitivity capabilities. IDAS is an extension of the IDA solver within SUNDIALS, itself based on on DASPK [26, 27], but is written in ANSI-standard C rather than Fortran77. Its most notable features are that, (1) in the solution of the underlying nonlinear system at each time step, it offers a choice of Newton/direct methods and a choice of Inexact Newton/Krylov (iterative) methods; and (2) it is written in a data-independent manner in that it acts on generic vectors and matrices without any assumptions on the underlying organization of the data. Thus IDAS shares significant modules previously written within CASC at LLNL to support the ordinary differential equation (ODE) solvers CVODE [41, 84] and PVODE [32, 33], and also the nonlinear system solver KINSOL [85].

At present, IDAS may utilize a variety of Krylov methods provided in SUNDIALS that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) [122], FGMRES (Flexible Generalized Minimum RESidual) [121], Bi-CGStab (Bi-Conjugate Gradient Stabilized) [157], TFQMR (Transpose-Free Quasi-Minimal Residual) [64], and PCG (Preconditioned Conjugate Gradient) [76] linear iterative methods. As Krylov methods, these require little matrix storage for solving the Newton equations as compared to direct methods. However, the algorithms allow for a user-supplied preconditioner, and, for most problems, preconditioning is essential for an efficient solution.

For very large DAE systems, the Krylov methods are preferable over direct linear solver methods, and are often the only feasible choice. Among the Krylov methods in SUNDIALS, we recommend GMRES as the best overall choice. However, users are encouraged to compare all options, especially if encountering convergence failures with GMRES. Bi-CGFStab and TFQMR have an advantage in storage requirements, in that the number of workspace vectors they require is fixed, while that number for GMRES depends on the desired Krylov subspace size. FGMRES has an advantage in that it is designed to support preconditioners that vary between iterations (e.g. iterative methods). PCG exhibits rapid convergence and minimal workspace vectors, but only works for symmetric linear systems.

IDAS is written with a functionality that is a superset of that of IDA. Sensitivity analysis capabilities, both forward and adjoint, have been added to the main integrator. Enabling forward sensitivity computations in IDAS will result in the code integrating the so-called sensitivity equations simultaneously with the original IVP, yielding both the solution and its sensitivity with respect to parameters in the model. Adjoint sensitivity analysis, most useful when the gradients of relatively few functionals of the solution with respect to many parameters are sought, involves integration of the original IVP forward in time followed by the integration of the so-called adjoint equations backward in time. IDAS provides the infrastructure needed to integrate any final-condition ODE dependent on the solution of the original IVP (in particular the adjoint system).

6.1.1. Changes to SUNDIALS in release 6.7.0

New Features and Enhancements

The default number of stages for the SSP Runge-Kutta methods ARKODE_LSRK_SSP_S_2 and ARKODE_LSRK_SSP_S_3 in LSRKStep were changed from 10 and 9, respectively, to their minimum allowable values of 2 and 4. Users may revert to the previous values by calling LSRKStepSetNumSSPStages().

Added the optional function ARKodeInit() to ARKODE to enable data allocation before the first call to ARKodeEvolve() (but after all other optional input routines have been called), to support users who measure memory usage before beginning a simulation.

Added the function ARKodeGetStageIndex() that returns the index of the stage currently being processed, and the total number of stages in the method, for users who wish to compute auxiliary quantities in their IVP right-hand side functions during some stages and not others (e.g., in all but the first or last stage).

Added the functions ARKodeGetLastTime() and ARKodeGetLastState() to return the last successful time and state achieved by ARKODE, respectively.

ARKODE now allows users to supply functions that will be called before each internal time step attempt (ARKodeSetPreStepFn()), after each successful time step (ARKodeSetPostStepFn()), before right-hand side routines are called on an updated state (ARKodeSetPreRhsFn()), and/or once each internal step/stage is computed (ARKodeSetPostprocessStepFn()/ ARKodeSetPostprocessStageFn()). These are considered advanced functions, as they should treat the state vector as read-only, otherwise all theoretical guarantees of solution accuracy and stability will be lost. As a result of these new functions, the values of multiple ARKODE return codes (e.g., ARK_INTERP_FAIL) have been updated; users who key off of the named constants will not be affected, but users who rely on the values themselves should update their codes accordingly.

Note to users utilizing the previously undocumented ARKodeSetPostprocessStepFn() function, the supplied function is now called on the newly computed state vector for all step attempts not just successful steps. To obtain the previous behavior of only calling a function on successful steps, switch to using ARKodeSetPostStepFn().

Added SUNLogger_Set{Error,Warning,Info,Debug}File functions to allow setting logger output streams with a FILE*.

Updated the Kokkos N_Vector to support Kokkos 5.x versions.

Bug Fixes

Fixed a CMake bug where the SuperLU_MT interface would not be built and installed without setting the SUPERLUMT_WORKS option to TRUE.

Fixed the embedded coefficients for the ARKODE_TSITOURAS_7_4_5 Butcher table.

Fixed a bug in LSRKStep where an incorrect state vector could be passed to a user-supplied dominant eigenvalue function on the first step unless the output vector passed to ARKodeEvolve() contained the initial condition and when an eigenvalue estimate is requested on the first step in a subsequent call to ARKodeEvolve() unless the output vector passed contained the most recently returned solution.

Fixed a potential bug in LSRKStep’s ARKODE_LSRK_SSP_S_3 method, where a real number was used instead of an integer, potentially resulting in a rounding error.

Fixed a bug in MRIStep for estimating the first “slow” time step in an adaptive multirate calculation.

Fixed a bug in MRIStep when using a custom inner integrator that relies on the input state being the initial condition for the fast integration rather than retaining the result from the last inner integration or most recent reset call and the output vector passed to ARKodeEvolve() does not contain the initial condition on the first call or the last returned solution on subsequent calls.

Added a missing call to SUNNonlinSolSetup() in MRIStep when using an IMEX-MRI-SR method.

Fixed a bug in the ARKODE discrete adjoint checkpointing where an incorrect state would be stored on the first step if the output vector passed to ARKodeEvolve() did not contain the initial condition on the first call.

Removed extraneous copy of output vector when using ARKODE in ARK_ONE_STEP mode.

Removed an extraneous copy of the output vector in each step with SplittingStep.

Fixed a bug in logging output from ARKODE, where for some time stepping modules, the current “time” output in the logger was incorrect.

Fixed a bug where passing an empty string to SUNLogger_Set{Error,Warning,Info,Debug}Filename did not disable the corresponding logging stream Issue #844.

Deprecation Notices

The CVodeSetMonitorFn and CVodeSetMonitorFrequency functions have been deprecated and will be removed in the next major release.

Several CMake options have been deprecated in favor of namespaced versions prefixed with SUNDIALS_ to avoid naming collisions in applications that include SUNDIALS directly within their CMake builds. Additionally, a consistent naming convention (SUNDIALS_ENABLE) is now used for all boolean options. The table below lists the old CMake option names and the new replacements.

Old Option

New Option

BUILD_ARKODE

SUNDIALS_ENABLE_ARKODE

BUILD_CVODE

SUNDIALS_ENABLE_CVODE

BUILD_CVODES

SUNDIALS_ENABLE_CVODES

BUILD_IDA

SUNDIALS_ENABLE_IDA

BUILD_IDAS

SUNDIALS_ENABLE_IDAS

BUILD_KINSOL

SUNDIALS_ENABLE_KINSOL

ENABLE_MPI

SUNDIALS_ENABLE_MPI

ENABLE_OPENMP

SUNDIALS_ENABLE_OPENMP

ENABLE_OPENMP_DEVICE

SUNDIALS_ENABLE_OPENMP_DEVICE

OPENMP_DEVICE_WORKS

SUNDIALS_ENABLE_OPENMP_DEVICE_CHECKS

ENABLE_PTHREAD

SUNDIALS_ENABLE_PTHREAD

ENABLE_CUDA

SUNDIALS_ENABLE_CUDA

ENABLE_HIP

SUNDIALS_ENABLE_HIP

ENABLE_SYCL

SUNDIALS_ENABLE_SYCL

ENABLE_LAPACK

SUNDIALS_ENABLE_LAPACK

LAPACK_WORKS

SUNDIALS_ENABLE_LAPACK_CHECKS

ENABLE_GINKGO

SUNDIALS_ENABLE_GINKGO

GINKGO_WORKS

SUNDIALS_ENABLE_GINKGO_CHECKS

ENABLE_MAGMA

SUNDIALS_ENABLE_MAGMA

MAGMA_WORKS

SUNDIALS_ENABLE_MAGMA_CHECKS

ENABLE_SUPERLUDIST

SUNDIALS_ENABLE_SUPERLUDIST

SUPERLUDIST_WORKS

SUNDIALS_ENABLE_SUPERLUDIST_CHECKS

ENABLE_SUPERLUMT

SUNDIALS_ENABLE_SUPERLUMT

SUPERLUMT_WORKS

SUNDIALS_ENABLE_SUPERLUMT_CHECKS

ENABLE_KLU

SUNDIALS_ENABLE_KLU

KLU_WORKS

SUNDIALS_ENABLE_KLU_CHECKS

ENABLE_HYPRE

SUNDIALS_ENABLE_HYPRE

HYPRE_WORKS

SUNDIALS_ENABLE_HYPRE_CHECKS

ENABLE_PETSC

SUNDIALS_ENABLE_PETSC

PETSC_WORKS

SUNDIALS_ENABLE_PETSC_CHECKS

ENABLE_TRILINOS

SUNDIALS_ENABLE_TRILINOS

ENABLE_RAJA

SUNDIALS_ENABLE_RAJA

ENABLE_XBRAID

SUNDIALS_ENABLE_XBRAID

XBRAID_WORKS

SUNDIALS_ENABLE_XBRAID_CHECKS

ENABLE_ONEMKL

SUNDIALS_ENABLE_ONEMKL

ONEMKL_WORKS

SUNDIALS_ENABLE_ONEMKL_CHECKS

ENABLE_CALIPER

SUNDIALS_ENABLE_CALIPER

ENABLE_ADIAK

SUNDIALS_ENABLE_ADIAK

ENABLE_KOKKOS

SUNDIALS_ENABLE_KOKKOS

KOKKOS_WORKS

SUNDIALS_ENABLE_KOKKOS_CHECKS

ENABLE_KOKKOS_KERNELS

SUNDIALS_ENABLE_KOKKOS_KERNELS

KOKKOS_KERNELS_WORKS

SUNDIALS_ENABLE_KOKKOS_KERNELS_CHECKS

BUILD_FORTRAN_MODULE_INTERFACE

SUNDIALS_ENABLE_FORTRAN

SUNDIALS_BUILD_WITH_PROFILING

SUNDIALS_ENABLE_PROFILING

SUNDIALS_BUILD_WITH_MONITORING

SUNDIALS_ENABLE_MONITORING

SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS

SUNDIALS_ENABLE_PACKAGE_FUSED_KERNELS

EXAMPLES_ENABLE_C

SUNDIALS_ENABLE_C_EXAMPLES

EXAMPLES_ENABLE_CXX

SUNDIALS_ENABLE_CXX_EXAMPLES

EXAMPLES_ENABLE_F2003

SUNDIALS_ENABLE_FORTRAN_EXAMPLES

EXAMPLES_ENABLE_CUDA

SUNDIALS_ENABLE_CUDA_EXAMPLES

EXAMPLES_INSTALL

SUNDIALS_ENABLE_EXAMPLES_INSTALL

EXAMPLES_INSTALL_PATH

SUNDIALS_EXAMPLES_INSTALL_PATH

BUILD_BENCHMARKS

SUNDIALS_ENABLE_BENCHMARKS

BENCHMARKS_INSTALL_PATH

SUNDIALS_BENCHMARKS_INSTALL_PATH

SUNDIALS_BENCHMARK_OUTPUT_DIR

SUNDIALS_BENCHMARKS_OUTPUT_DIR

SUNDIALS_BENCHMARK_CALIPER_OUTPUT_DIR

SUNDIALS_BENCHMARKS_CALIPER_OUTPUT_DIR

SUNDIALS_BENCHMARK_NUM_CPUS

SUNDIALS_BENCHMARKS_NUM_CPUS

SUNDIALS_BENCHMARK_NUM_GPUS

SUNDIALS_BENCHMARKS_NUM_GPUS

ENABLE_ALL_WARNINGS

SUNDIALS_ENABLE_ALL_WARNINGS

ENABLE_WARNINGS_AS_ERRORS

CMAKE_COMPILE_WARNING_AS_ERROR

ENABLE_ADDRESS_SANITIZER

SUNDIALS_ENABLE_ADDRESS_SANITIZER

ENABLE_MEMORY_SANITIZER

SUNDIALS_ENABLE_MEMORY_SANITIZER

ENABLE_LEAK_SANITIZER

SUNDIALS_ENABLE_LEAK_SANITIZER

Following the updated CMake options, the macros listed below have been deprecated and replaced with versions that align with the new CMake options.

Old Macro

New Macro

SUNDIALS_BUILD_WITH_PROFILING

SUNDIALS_ENABLE_PROFILING

SUNDIALS_BUILD_WITH_MONITORING

SUNDIALS_ENABLE_MONITORING

SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS

SUNDIALS_ENABLE_PACKAGE_FUSED_KERNELS

For changes in prior versions of SUNDIALS see §18.

6.1.2. Reading this User Guide

The structure of this document is as follows:

  • In Chapter §6.2, we give short descriptions of the numerical methods implemented by IDAS for the solution of initial value problems for systems of DAEs, along with short descriptions of preconditioning (§6.2.3) and rootfinding (§6.2.4).

  • The following chapter describes the software organization of the IDAS solver (§6.3).

  • Chapter §6.4.1 is the main usage document for IDAS for simulation applications. It includes a complete description of the user interface for the integration of DAE initial value problems. Readers that are not interested in using IDAS for sensitivity analysis can then skip the next two chapters.

  • Chapter §6.4.4 describes the usage of IDAS for forward sensitivity analysis as an extension of its IVP integration capabilities. We begin with a skeleton of the user main program, with emphasis on the steps that are required in addition to those already described in Chapter §6.4.1. Following that we provide detailed descriptions of the user-callable interface routines specific to forward sensitivity analysis and of the additional optional user-defined routines.

  • Chapter §6.4.5 describes the usage of IDAS for adjoint sensitivity analysis. We begin by describing the IDAS checkpointing implementation for interpolation of the original IVP solution during integration of the adjoint system backward in time, and with an overview of a user’s main program. Following that we provide complete descriptions of the user-callable interface routines for adjoint sensitivity analysis as well as descriptions of the required additional user-defined routines.

  • Chapter §8 gives a brief overview of the generic N_Vector module shared among the various components of SUNDIALS, as well as details on the N_Vector implementations provided with SUNDIALS.

  • Chapter §9 gives a brief overview of the generic SUNMatrix module shared among the various components of SUNDIALS, and details on the SUNMatrix implementations provided with SUNDIALS.

  • Chapter §10 gives a brief overview of the generic SUNLinearSolver module shared among the various components of SUNDIALS. This chapter contains details on the SUNLinearSolver implementations provided with SUNDIALS. The chapter also contains details on the SUNLinearSolver implementations provided with SUNDIALS that interface with external linear solver libraries.

  • Chapter §11 describes the SUNNonlinearSolver API and nonlinear solver implementations shared among the various components of SUNDIALS.

  • Finally, in the appendices, we provide detailed instructions for the installation of IDAS, within the structure of SUNDIALS (Appendix §1.1), as well as a list of all the constants used for input to and output from IDAS functions (Appendix §6.5).

6.1.3. SUNDIALS License and Notices

All SUNDIALS packages are released open source, under the BSD 3-Clause license for more details see the LICENSE and NOTICE files provided with all SUNDIALS packages.