<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scicos
- *
+ *
* Copyright (C) INRIA - METALAU Project <scicos@inria.fr> (HTML version)
* Copyright (C) DIGITEO - Scilab Consortium (XML Docbook version)
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
+ *
* See the file ./license.txt
-->
<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:id="INTRPLBLK_f">
<title>Description</title>
<para>The output of this block is a function of the input obtained by linear
interpolation. This block has a single scalar input and a single scalar
- output port. The coord. and coord. give respectively the
+ output port. The coord. and coord. give respectively the
coordinate and the coordinate of the data points to be interpolated.
</para>
<para>
<refsection id="Example_INTRPLBLK_f">
<title>Example</title>
<para>
- The following example translate the sinus input signal to a different range and cut part of it.
+ The following example translate the sine input signal to a different range and cut part of it.
<link type="scilab" linkend="scilab.zcos/xcos/examples/lookuptables_pal/en_US/INTRPLBLK_f_en_US.zcos">
Open this example in Xcos.
</link>
The basic scheme used is to check for sign changes of any <emphasis>g(t)</emphasis> over each time step taken, and then (when a sign change is found) to home in on the root (or roots) with a modified secant method.
</para>
<para>
- After suitable checking and adjusting has been done, the roots are to be sought within
+ After suitable checking and adjusting has been done, the roots are to be sought within
<emphasis>
[t<subscript>lo</subscript>, t<subscript>hi</subscript>]
</emphasis>
root to within a rather tight tolerance, given by the <emphasis>unit roudoff</emphasis>, the <emphasis>current time</emphasis> and the <emphasis>step size</emphasis>.
</para>
<para>
- We then determine which root function is more likely to have its roots occur first by comparing the secant method values, and set a new value
+ We then determine which root function is more likely to have its roots occur first by comparing the secant method values, and set a new value
<emphasis>
t<subscript>mid</subscript>
</emphasis>
- and restrain the research interval to either
+ and restrain the research interval to either
<emphasis>
[t<subscript>lo</subscript>, t<subscript>mid</subscript>]
</emphasis>
- or
+ or
<emphasis>
[t<subscript>mid</subscript>, t<subscript>hi</subscript>]
</emphasis>
]]></scilab:image>
</para>
<para>
- Simple example of a Sinus crossing zero several times:
+ Simple example of a Sine crossing zero several times:
</para>
<para>
<programlisting language="example"><![CDATA[
Now, in the two following scripts, we test the computational overhead of the rootfinding with <emphasis>LSodar</emphasis>:
</para>
<para>
- First, a Sinus that crosses zero every π period:
+ First, a Sine function that crosses zero every π period:
<link type="scilab" linkend ="scilab.scinotes/xcos/examples/solvers/Rootfinding.sce">
Open the script
</link>
]]></screen>
</para>
<para>
- Following the number of zero crossings, the aspect of the function near these crossings, the tolerances, ..., the computational overhead ranges between 25% and 45%.
+ Following the number of zero crossings, the aspect of the function near these crossings, the tolerances, ..., the computational overhead ranges between 25% and 45%.
</para>
</refsection>
<refsection>
</para>
<para>
In the following script, we compare the time difference between the solvers by running the example with the eight solvers in turn (<emphasis>IDA</emphasis> doesn't handle this kind of problem):
- <link type="scilab" linkend ="scilab.scinotes/xcos/examples/solvers/benchSinus.sce">
+ <link type="scilab" linkend ="scilab.scinotes/xcos/examples/solvers/benchSine.sce">
Open the script
</link>
</para>
<tr>
<td align="center"> </td>
<td align="center">
- <emphasis>BDF / Newton</emphasis>
+ <emphasis>BDF / Newton</emphasis>
</td>
<td align="center">
- <emphasis>BDF / Functional</emphasis>
+ <emphasis>BDF / Functional</emphasis>
</td>
<td align="center">
- <emphasis>Adams / Newton</emphasis>
+ <emphasis>Adams / Newton</emphasis>
</td>
<td align="center">
- <emphasis>Adams / Functional</emphasis>
+ <emphasis>Adams / Functional</emphasis>
</td>
<td align="center">
- <emphasis>Dormand-Prince</emphasis>
+ <emphasis>Dormand-Prince</emphasis>
</td>
<td align="center">
- <emphasis>Runge-Kutta</emphasis>
+ <emphasis>Runge-Kutta</emphasis>
</td>
<td align="center">
- <emphasis>Implicit Runge-Kutta</emphasis>
+ <emphasis>Implicit Runge-Kutta</emphasis>
</td>
</tr>
<tr>
<td align="center">
- <emphasis>LSodar</emphasis>
+ <emphasis>LSodar</emphasis>
</td>
<td align="center"> 3.1x </td>
<td align="center"> 3x </td>
</tr>
<tr>
<td align="center">
- <emphasis>BDF / Newton</emphasis>
+ <emphasis>BDF / Newton</emphasis>
</td>
<td align="center"> </td>
<td align="center"> 0.1x </td>
</tr>
<tr>
<td align="center">
- <emphasis>BDF / Functional</emphasis>
+ <emphasis>BDF / Functional</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Adams / Newton</emphasis>
+ <emphasis>Adams / Newton</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Adams / Functional</emphasis>
+ <emphasis>Adams / Functional</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Dormand-Prince</emphasis>
+ <emphasis>Dormand-Prince</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Runge-Kutta</emphasis>
+ <emphasis>Runge-Kutta</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
<tr>
<td align="center"> </td>
<td align="center">
- <emphasis>BDF / Newton</emphasis>
+ <emphasis>BDF / Newton</emphasis>
</td>
<td align="center">
- <emphasis>BDF / Functional</emphasis>
+ <emphasis>BDF / Functional</emphasis>
</td>
<td align="center">
- <emphasis>Adams / Newton</emphasis>
+ <emphasis>Adams / Newton</emphasis>
</td>
<td align="center">
- <emphasis>Adams / Functional</emphasis>
+ <emphasis>Adams / Functional</emphasis>
</td>
<td align="center">
- <emphasis>Dormand-Prince</emphasis>
+ <emphasis>Dormand-Prince</emphasis>
</td>
<td align="center">
- <emphasis>Runge-Kutta</emphasis>
+ <emphasis>Runge-Kutta</emphasis>
</td>
<td align="center">
- <emphasis>Implicit Runge-Kutta</emphasis>
+ <emphasis>Implicit Runge-Kutta</emphasis>
</td>
</tr>
<tr>
<td align="center">
- <emphasis>LSodar</emphasis>
+ <emphasis>LSodar</emphasis>
</td>
<td align="center"> 2.8x </td>
<td align="center"> 2.6x </td>
</tr>
<tr>
<td align="center">
- <emphasis>BDF / Newton</emphasis>
+ <emphasis>BDF / Newton</emphasis>
</td>
<td align="center"> </td>
<td align="center"> 0.9x </td>
</tr>
<tr>
<td align="center">
- <emphasis>BDF / Functional</emphasis>
+ <emphasis>BDF / Functional</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Adams / Newton</emphasis>
+ <emphasis>Adams / Newton</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Adams / Functional</emphasis>
+ <emphasis>Adams / Functional</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Dormand-Prince</emphasis>
+ <emphasis>Dormand-Prince</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Runge-Kutta</emphasis>
+ <emphasis>Runge-Kutta</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
<tr>
<td align="center"> </td>
<td align="center">
- <emphasis>BDF / Newton</emphasis>
+ <emphasis>BDF / Newton</emphasis>
</td>
<td align="center">
- <emphasis>BDF / Functional</emphasis>
+ <emphasis>BDF / Functional</emphasis>
</td>
<td align="center">
- <emphasis>Adams / Newton</emphasis>
+ <emphasis>Adams / Newton</emphasis>
</td>
<td align="center">
- <emphasis>Adams / Functional</emphasis>
+ <emphasis>Adams / Functional</emphasis>
</td>
<td align="center">
- <emphasis>Dormand-Prince</emphasis>
+ <emphasis>Dormand-Prince</emphasis>
</td>
<td align="center">
- <emphasis>Runge-Kutta</emphasis>
+ <emphasis>Runge-Kutta</emphasis>
</td>
<td align="center">
- <emphasis>Implicit Runge-Kutta</emphasis>
+ <emphasis>Implicit Runge-Kutta</emphasis>
</td>
</tr>
<tr>
<td align="center">
- <emphasis>LSodar</emphasis>
+ <emphasis>LSodar</emphasis>
</td>
<td align="center"> 2.1x </td>
<td align="center"> 1.6x </td>
</tr>
<tr>
<td align="center">
- <emphasis>BDF / Newton</emphasis>
+ <emphasis>BDF / Newton</emphasis>
</td>
<td align="center"> </td>
<td align="center"> 0.75x </td>
</tr>
<tr>
<td align="center">
- <emphasis>BDF / Functional</emphasis>
+ <emphasis>BDF / Functional</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Adams / Newton</emphasis>
+ <emphasis>Adams / Newton</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Adams / Functional</emphasis>
+ <emphasis>Adams / Functional</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Dormand-Prince</emphasis>
+ <emphasis>Dormand-Prince</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center">
- <emphasis>Runge-Kutta</emphasis>
+ <emphasis>Runge-Kutta</emphasis>
</td>
<td align="center"> </td>
<td align="center"> </td>
<tr>
<td align="center"> </td>
<td align="center">
- <emphasis>IDA</emphasis>
+ <emphasis>IDA</emphasis>
</td>
<td align="center">
- <emphasis>DDaskr G</emphasis>
+ <emphasis>DDaskr G</emphasis>
</td>
</tr>
<tr>
<td align="center">
- <emphasis>DDaskr N</emphasis>
+ <emphasis>DDaskr N</emphasis>
</td>
<td align="center"> 1.39x </td>
<td align="center"> 1.9x </td>
<tr>
<td align="center"> </td>
<td align="center">
- <emphasis>IDA</emphasis>
+ <emphasis>IDA</emphasis>
</td>
<td align="center">
- <emphasis>DDaskr G</emphasis>
+ <emphasis>DDaskr G</emphasis>
</td>
</tr>
<tr>
<td align="center">
- <emphasis>DDaskr N</emphasis>
+ <emphasis>DDaskr N</emphasis>
</td>
<td align="center"> 3.75x </td>
<td align="center"> 1.06x </td>
Le schéma utilisé est de vérifier les traversées de zéro de <emphasis>g(t)</emphasis> sur chaque pas de temps, puis (changement de signe détecté) de zoomer sur cette traversée (ou racine) grâce à une méthode des sécantes modifiée.
</para>
<para>
- Après des vérifications et ajustements corrects, les racines sont recherchées dans
+ Après des vérifications et ajustements corrects, les racines sont recherchées dans
<emphasis>
[t<subscript>lo</subscript>, t<subscript>hi</subscript>]
</emphasis>
la racine suivant une tolérance acceptable, donnée par <emphasis>l'arrondi de la machine</emphasis>, le <emphasis>temps actuel</emphasis> et le <emphasis>pas de temps</emphasis>.
</para>
<para>
- On détermine alors quelle fonction racine a le plus de chances de voir sa racine arriver en première en comparant les valeurs de la méthode des sécantes, et on donne une nouvelle valeur
+ On détermine alors quelle fonction racine a le plus de chances de voir sa racine arriver en première en comparant les valeurs de la méthode des sécantes, et on donne une nouvelle valeur
<emphasis>
t<subscript>mid</subscript>
</emphasis>
- et on restreint l'intervalle de recherche à
+ et on restreint l'intervalle de recherche à
<emphasis>
[t<subscript>lo</subscript>, t<subscript>mid</subscript>]
</emphasis>
- ou
+ ou
<emphasis>
[t<subscript>mid</subscript>, t<subscript>hi</subscript>]
</emphasis>
]]></scilab:image>
</para>
<para>
- Exemple simple d'un Sinus traversant zéro plusieurs fois :
+ Exemple simple d'une fonction Sinus traversant zéro plusieurs fois :
</para>
<para>
<programlisting language="example"><![CDATA[
loadXcosLibs();
importXcosDiagram("SCI/modules/xcos/demos/Threshold_ZeroCrossing.zcos");
- // Lancement du chrono, de la simulation et affichage du temps
+ // Lancement du chronomètre, de la simulation et affichage du temps
tic();
try xcos_simulate(scs_m, 4); catch disp(lasterror()); end
t = toc();
]]></screen>
</para>
<para>
- Suivant le nombre de racines, l'aspect de la fonction à l'approche de ces racines, les tolérances, ..., le surplus de temps de calcul va de 25% à 45%.
+ Suivant le nombre de racines, l'aspect de la fonction à l'approche de ces racines, les tolérances, ..., le surplus de temps de calcul va de 25% à 45%.
</para>
</refsection>
<refsection>