Download data/help/6-IDA.xml from notsn/XCos_MCP: direct link, hf CLI and curl.
- Browser
- Download file 8.66 kB
-
https://huggingface.co/spaces/notsn/XCos_MCP/resolve/main/data/help/6-IDA.xml
- Command line
-
hf download hf://spaces/notsn/XCos_MCP/data/help/6-IDA.xml
-
curl -L -o 6-IDA.xml https://huggingface.co/spaces/notsn/XCos_MCP/resolve/main/data/help/6-IDA.xml
8.66 kB
| <!-- | |
| * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab | |
| * Copyright (C) Scilab Enterprises - 2012 - Paul Bignier | |
| * | |
| * Copyright (C) 2012 - 2016 - Scilab Enterprises | |
| * | |
| * This file is hereby licensed under the terms of the GNU GPL v2.0, | |
| * pursuant to article 5.3.4 of the CeCILL v.2.1. | |
| * This file was originally licensed under the terms of the CeCILL v2.1, | |
| * and continues to be available under such terms. | |
| * For more information, see the COPYING file which you should have received | |
| * along with this program. | |
| --> | |
| <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en_US" xml:id="IDA"> | |
| <refnamediv> | |
| <refname>IDA</refname> | |
| <refpurpose> | |
| Implicit Differential Algebraic equations system solver, providing an efficient and stable method to solve Differential Algebraic Equations system (DAEs) Initial Value Problems. | |
| </refpurpose> | |
| </refnamediv> | |
| <refsection> | |
| <title>Description</title> | |
| <para> | |
| Called by <link linkend="xcos">xcos</link>, <emphasis>IDA</emphasis> (short for Implicit Differential Algebraic equations system solver) is a numerical solver providing an efficient and stable method to solve Initial Value Problems of the form: | |
| </para> | |
| <para> | |
| <latex> | |
| \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} | |
| </latex> | |
| </para> | |
| <para> | |
| </para> | |
| Before solving the problem, <emphasis>IDA</emphasis> runs an internal routine to find consistent values for | |
| <emphasis> | |
| y<subscript>0</subscript> | |
| </emphasis> | |
| and | |
| <emphasis> | |
| yPrime<subscript>0</subscript> | |
| </emphasis> | |
| . | |
| <para> | |
| Starting then with those | |
| <emphasis> | |
| y<subscript>0</subscript> | |
| </emphasis> | |
| and | |
| <emphasis> | |
| yPrime<subscript>0</subscript> | |
| </emphasis> | |
| , <emphasis>IDA</emphasis> approximates | |
| <emphasis> | |
| y<subscript>n+1</subscript> | |
| </emphasis> | |
| with the <emphasis>BDF</emphasis> formula: | |
| </para> | |
| <para> | |
| <latex> | |
| \begin{eqnarray} | |
| \sum_{i=0}^{q} \alpha_{n,i} y_{n-i} = h_n\dot{y}_{n} | |
| \end{eqnarray} | |
| </latex> | |
| <para> | |
| with, like in <link linkend="CVode">CVode</link>, | |
| <emphasis> | |
| y<subscript>n</subscript> | |
| </emphasis> | |
| the approximation of | |
| <emphasis> | |
| y(t<subscript>n</subscript>) | |
| </emphasis> | |
| , | |
| <emphasis> | |
| h<subscript>n</subscript> | |
| </emphasis> | |
| = | |
| <emphasis> | |
| t<subscript>n</subscript> - t<subscript>n-1</subscript> | |
| </emphasis> | |
| the step size, and the coefficients are fixed, uniquely determined by the method type, its order <emphasis>q</emphasis> ranging from 1 to 5 and the history of the step sizes. | |
| </para> | |
| </para> | |
| <para> | |
| Injecting this formula in <emphasis>(1)</emphasis> yields the system: | |
| </para> | |
| <para> | |
| <latex> | |
| 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 | |
| </latex> | |
| </para> | |
| <para> | |
| To apply <emphasis>Newton</emphasis> iterations to it, we rewrite it into: | |
| </para> | |
| <para> | |
| <latex> | |
| J \left[y_{n(m+1)}-y_{n(m)} \right] = -G(y_{n(m)}) | |
| </latex> | |
| </para> | |
| <para> | |
| with <emphasis>J</emphasis> an approximation of the Jacobian: | |
| </para> | |
| <para> | |
| <latex> | |
| 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}, | |
| </latex> | |
| </para> | |
| <para> | |
| <emphasis>α</emphasis> changes whenever the step size or the method order varies. | |
| </para> | |
| <para> | |
| An implemented direct dense solver is used and we go on to the next step. | |
| </para> | |
| <para> | |
| <emphasis>IDA</emphasis> uses the history array to control the local error | |
| <emphasis> | |
| y<subscript>n(m)</subscript> - y<subscript>n(0)</subscript> | |
| </emphasis> | |
| and recomputes | |
| <emphasis> | |
| h<subscript>n</subscript> | |
| </emphasis> | |
| if that error is not satisfying. | |
| </para> | |
| <para> | |
| The function is called in between activations, because a discrete activation may change the system. | |
| </para> | |
| <para> | |
| 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. | |
| </para> | |
| <para> | |
| Averagely, <emphasis>IDA</emphasis> accepts tolerances up to 10<superscript>-11</superscript>. Beyond that, it returns a <emphasis>Too much accuracy</emphasis> requested error. | |
| </para> | |
| </refsection> | |
| <refsection id="Example_IDA"> | |
| <title>Example</title> | |
| <para> | |
| The 'Modelica Generic' block returns its continuous states, we can evaluate them with <emphasis>IDA</emphasis> by running the example: | |
| </para> | |
| <para> | |
| <link type="scilab" linkend="scilab.xcos/xcos/examples/solvers/DAE_Example.zcos"> | |
| <inlinemediaobject> | |
| <imageobject> | |
| <imagedata align="center" fileref="../../../examples/solvers/DAE_Example.zcos" valign="middle"/> | |
| </imageobject> | |
| </inlinemediaobject> | |
| </link> | |
| <scilab:image localized="true"><![CDATA[ | |
| loadScicos(); | |
| loadXcosLibs(); | |
| importXcosDiagram(SCI + "/modules/xcos/examples/solvers/DAE_Example.zcos"); | |
| // Redefining messagebox() to avoid popup | |
| function messagebox(msg, Title) | |
| disp(Title); | |
| disp(msg); | |
| endfunction | |
| try xcos_simulate(scs_m, 4); catch disp(lasterror()); end | |
| ]]></scilab:image> | |
| </para> | |
| </refsection> | |
| <refsection role="see also"> | |
| <title>See also</title> | |
| <simplelist type="inline"> | |
| <member> | |
| <link linkend="LSodar">LSodar</link> | |
| </member> | |
| <member> | |
| <link linkend="CVode">CVode</link> | |
| </member> | |
| <member> | |
| <link linkend="RK">Runge-Kutta 4(5)</link> | |
| </member> | |
| <member> | |
| <link linkend="DoPri">Dormand-Prince 4(5)</link> | |
| </member> | |
| <member> | |
| <link linkend="ImpRK">Implicit Runge-Kutta 4(5)</link> | |
| </member> | |
| <member> | |
| <link linkend="CRANI">Crank-Nicolson 2(3)</link> | |
| </member> | |
| <member> | |
| <link linkend="DDaskr">DDaskr</link> | |
| </member> | |
| <member> | |
| <link linkend="Comparisons">Comparisons</link> | |
| </member> | |
| <member> | |
| <link linkend="ode">ode</link> | |
| </member> | |
| <member> | |
| <link linkend="ode_discrete">ode_discrete</link> | |
| </member> | |
| <member> | |
| <link linkend="ode_root">ode_root</link> | |
| </member> | |
| <member> | |
| <link linkend="odedc">odedc</link> | |
| </member> | |
| <member> | |
| <link linkend="dae">dae</link> | |
| </member> | |
| </simplelist> | |
| </refsection> | |
| <refsection> | |
| <title>Bibliography</title> | |
| <para> | |
| <ulink url="https://computation.llnl.gov/casc/sundials/documentation/documentation.html">Sundials Documentation</ulink> | |
| </para> | |
| </refsection> | |
| </refentry> | |