Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.0.0 - Русский


DDaskr

Double-precision Differential Algebraic equations system Solver with Krylov method and Rootfinding: numerical solver providing an efficient and stable method to solve Differential Algebraic Equations systems (DAEs) Initial Value Problems

Description

Called by xcos, DDaskr (short for Double-precision Differential Algebraic equations system Solver with Krylov method and Rootfinding) is a numerical solver providing an efficient and stable method to solve Initial Value Problems of the form:

\begin{eqnarray}
                F(t,y,\dot{y}) = 0, \hspace{2 mm} y(t_0)=y_0, \hspace{2 mm} \dot{y}(t_0)=\dot{y}_0, \hspace{3 mm} y, \hspace{1.5 mm} \dot{y}  \hspace{1.5 mm} and \hspace{1.5 mm} F \in R^N \hspace{10 mm} (1)
                \end{eqnarray}

Before solving the problem, DDaskr runs an implemented routine to find consistent values for y0 and yPrime0 .

Starting then with those y0 and yPrime0 , DDaskr approximates yn+1 with the BDF formula:

\begin{eqnarray}
                \sum_{i=0}^{q} \alpha_{n,i} y_{n-i} = h_n\dot{y}_{n}
                \end{eqnarray}

with, like in CVode, yn the approximation of y(tn) , hn = tn - tn-1 the step size, and the coefficients are fixed, uniquely determined by the method type, its order q ranging from 1 to 5 and the history of the step sizes.

Injecting this formula in (1) yields the system:

G(y_n) \equiv F \left( t_n, \hspace{1.5mm} y_n, \hspace{1.5mm} h_n^{-1}\sum_{i=0}^{q} \alpha_{n,i} y_{n-i} \right) = 0

Its solving is done through a Newton method, but with either direct or preconditioned GMRes Krylov iterations.

  • Direct iteration: start by rewriting the system into:

    J \left[y_{n(m+1)}-y_{n(m)} \right] = -G(y_{n(m)})

    with J an approximation of the Jacobian:

    J = \frac{\partial{G}}{\partial{y}} = \frac{\partial{F}}{\partial{y}}+\alpha\frac{\partial{F}}{\partial{\dot{y}}}, \hspace{4 mm} \alpha = \frac{\alpha_{n,0}}{h_n},

    α changes whenever the step size or the method order varies.

    Then, an implemented direct dense solver is used and we go on to the next step.

  • GMRes Krylov method: first, precondition the system by applying the Jacobian matrix mentioned above.

    Secondly, compute the next Krylov space basis and update the Hessenberg matrix.

    Test for convergence for the first time. If it doesn't pass, calculate the residual, which will lead to a new potential solution, and iterate until that residual satisfies convergence.

DDaskr uses the history array to control the local error yn(m) - yn(0) and recomputes hn if that error is not satisfying.

The function is called in between activations, because a discrete activation may change the system.

Following the criticality of the event (its effect on the continuous problem), we either relaunch the solver with different start and final times as if nothing happened, or, if the system has been modified, we need to "cold-restart" the problem by reinitializing it anew and relaunching the solver.

Averagely, DDaskr accepts tolerances up to 10-11. Beyond that, it returns a Too much accuracy requested error.

As of now, DDaskr can only be applied on systems where the root functions are punctually 0, and not 0-flat.

Example

The 'Modelica Generic' block returns its continuous states, we can evaluate them with DDaskr by running the example:

See also

  • LSodar — LSodar (short for Livermore Solver for Ordinary Differential equations, with Automatic method switching for stiff and nonstiff problems, and with Root-finding) is a numerical solver providing an efficient and stable method to solve Ordinary Differential Equations (ODEs) Initial Value Problems.
  • CVode — CVode (short for C-language Variable-coefficients ODE solver) is a numerical solver providing an efficient and stable method to solve Ordinary Differential Equations (ODEs) Initial Value Problems. It uses either BDF or Adams as implicit integration method, and Newton or Functional iterations.
  • IDA — Implicit Differential Algebraic equations system solver, providing an efficient and stable method to solve Differential Algebraic Equations system (DAEs) Initial Value Problems.
  • Runge-Kutta 4(5) — Runge-Kutta is a numerical solver providing an efficient explicit method to solve Ordinary Differential Equations (ODEs) Initial Value Problems.
  • Dormand-Prince 4(5) — Dormand-Prince is a numerical solver providing an efficient explicit method to solve Ordinary Differential Equations (ODEs) Initial Value Problems.
  • Implicit Runge-Kutta 4(5) — Numerical solver providing an efficient and stable implicit method to solve Ordinary Differential Equations (ODEs) Initial Value Problems.
  • Crank-Nicolson 2(3) — Crank-Nicolson is a numerical solver based on the Runge-Kutta scheme providing an efficient and stable implicit method to solve Ordinary Differential Equations (ODEs) Initial Value Problems. Called by xcos.
  • Comparisons — This page compares solvers to determine which one is best fitted for the studied problem.
  • daskr — DAE solver with zero crossing
  • ode — программа решения обыкновенных дифференциальных уравнений
  • ode_discrete — программа решения обыкновенных дифференциальных уравнений, моделирование дискретного времени
  • ode_root — программа решения обыкновенных дифференциальных уравнений с поиском корней
  • odedc — программа решения дискретно-непрерывных ОДУ
  • impl — дифференциальное алгебраическое уравнение

Bibliography

Netlib storage, documentation inside of the code.

Sundials Documentation

History

ВерсияОписание
5.5.0 DDaskr solver added
Report an issue
<< IDA Solvers Rootfinding >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Oct 24 14:37:13 CEST 2023