* Bug #13748 fixed - printf, sprintf (en,ja): short descriptions and obsolete flags were missing
* Bug #2104 fixed - ode + ode_root argout iw(1:9) and w(1:10) weren't documented
=> ode_optional_output updated
* Bug #14495 fixed - consolebox() help page shew wrong syntaxes and was poor
* xlabel (en,ja): update after http://bugzilla.scilab.org/12481
* iconvert (pt,tu): typos fixed
* members(): grep() added in See also.
* roots (fr): error "f": degree<100 => degree>=100 fixed.
* ode(): missing parameters added and resorted. roles added.
link added for iw,w. See also improved. (pt)=> UTF8.
* part(): typos fixed
Change-Id: I624b28f33a6a937d78dc17229337985401920341
* deletefile can delete multiple files at once.
+* Help pages:
+ - fixed / improved: members, part, ode, ode_optional_output, ode_roots, roots, printf, sprintf, iconvert, stdev, xlabel
+ - rewriten: consolebox, double, isoview, householder
+ - resorted: else, elseif, end, try, sciargs, global, halt, empty, power
+
Installation
============
=========
In 6.0.0:
+* Bug #2104 fixed - iw(1:9) and w(1:10) ode() output parameters were not documented
* Bug #6314 fixed - The identical code of %p_m_r() and %r_m_p() was not factorized
* Bug #13725 fixed - xfpoly polygon filling would may fail for some cases
+* Bug #13748 fixed - printf, sprintf (en,ja): short descriptions and obsolete flags were missing.
+
* Bug #13769 fixed - t = "abc..//ghi" was parsed as a continued + comment
* Bug #13810 fixed - householder(v, k*v) returned column of %nan. Input parameters were not checked. The Householder matrix could not be returned. Help pages were inaccurate and without examples. There was no householder() demo.
* Bug #14476 fixed - Dotmultiplication between polynomials and imaginary numbers was always returning 0
+* Bug #14495 fixed - consolebox() help page shew wrong syntaxes and was poor.
+
* Bug #14499 fixed - getd() did not update already defined functions
* Copyright (C) 2008 - INRIA
* Copyright (C) 2011 - DIGITEO - Michael Baudin
* Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
- *
+ * Copyright (C) 2016 - Samuel GOUGEON
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
y = ode("discrete", y0, k0, kvect, f)
</synopsis>
</refsynopsisdiv>
- <refsection>
+ <refsection role="parameters">
<title>Arguments</title>
<variablelist>
<varlistentry>
<term>y0</term>
<listitem>
- <para>a real vector or matrix, the initial conditions.</para>
+ <para>a real vector or matrix: initial state,
+ at <varname>t0</varname>.</para>
</listitem>
</varlistentry>
<varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>rtol</term>
+ <term>atol, rtol</term>
<listitem>
<para>
- a real constant or real vector of the same size as
- <varname>y</varname>, the relative tolerance.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>atol</term>
- <listitem>
- <para>
- a real constant or real vectors of the same size as
- <varname>y</varname>, the absolute tolerance.
+ absolute and relative tolerances on the final solution
+ <varname>y</varname> (decimal numbers). If each is a
+ single value, it applies
+ to each component of <varname>y</varname>. Otherwise,
+ it must be a vector of same size as size(y), and
+ is applied element-wise to <varname>y</varname>.
</para>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>w, iw</term>
- <listitem>
- <para>real vectors. (INPUT/OUTPUT)</para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term>ng</term>
<listitem>
<para>an integer.</para>
<varlistentry>
<term>y</term>
<listitem>
- <para>a real vector or matrix. (OUTPUT)</para>
+ <para>a real vector or matrix. The solution.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>rd</term>
<listitem>
- <para>a real vector. (OUTPUT)</para>
+ <para>a real vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>real vectors. (INPUT/OUTPUT). See <link linkend="ode_optional_output">ode() optional output</link></para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="description">
<title>Description</title>
<para>
<function>ode</function> solves explicit Ordinary Different Equations defined by:
</varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Examples</title>
<para>
In the following example, we solve the Ordinary Differential Equation
</para>
<programlisting role="example"><![CDATA[
function ydot=f(t,y)
- ydot=y^2-y*sin(t)+cos(t)
+ ydot=y^2-y*sin(t)+cos(t)
endfunction
y0=0;
t0=0;
ode("adams",y0,t0,t,f)
]]></programlisting>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>With a compiler</title>
<para>
The following example requires a C compiler.
<title>See Also</title>
<simplelist type="inline">
<member>
- <link linkend="ode_discrete">ode_discrete</link>
+ <link linkend="odeoptions">odeoptions</link>
+ </member>
+ <member>
+ <link linkend="ode_optional_output">ode_optional_output</link>
</member>
<member>
<link linkend="ode_root">ode_root</link>
</member>
<member>
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
<link linkend="dassl">dassl</link>
</member>
<member>
<link linkend="odedc">odedc</link>
</member>
<member>
- <link linkend="odeoptions">odeoptions</link>
- </member>
- <member>
<link linkend="csim">csim</link>
</member>
<member>
</member>
</simplelist>
</refsection>
- <refsection>
+ <refsection role="bibliography">
<title>Bibliography</title>
<para>
Alan C. Hindmarsh, "lsode and lsodi, two new initial value ordinary
(1980), pp. 10-11.
</para>
</refsection>
- <refsection>
+ <refsection role="references">
<title>Used Functions</title>
<para>
The associated routines can be found in SCI/modules/differential_equations/src/fortran directory:
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* ...
- *
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
<refname>ode_optional_output</refname>
<refpurpose>ode solvers optional outputs description</refpurpose>
</refnamediv>
- <refsection>
+ <refsection role="parameters">
<title>Description</title>
<para>
This page describes the most important values returned in the
optional lhs <link linkend="ode">ode</link> function arguments <literal>w</literal> and
<literal>iw</literal>.
- These are valid only for the <literal>lsode</literal>,
+ These are valid only for the <literal>lsode</literal>,
<literal>lsoda</literal> and <literal>lsodar</literal> ode solver.
For more details, one can look at the solvers fortran code comments in <literal>SCI/modules/differential_equations/src/fortran/lsod*.f</literal>.
</para>
<variablelist>
<varlistentry>
+ <term>w(1:10)</term>
+ <listitem>
+ <para>Solver internal values. Output for technical reasons only. Not supported.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>w(11)</term>
<listitem>
<para> the step size in t last used (successfully).</para>
<listitem>
<para> the value of t at the time of the last method
switch, if any. This value is not significant with
- <literal>lsode</literal> solver.
+ <literal>lsode</literal> solver.
</para>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iw(1:9)</term>
+ <listitem>
+ <para>Solver internal values. Output for technical reasons only. Not supported.</para>
</listitem>
</varlistentry>
<varlistentry>
* Copyright (C) 2008 - INRIA
* Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
* ...
- *
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
<title>Syntax</title>
<synopsis>[y, rd, w, iw] = ode("root", y0, t0, t [,rtol [,atol]], f [,jac], ng, g [,w,iw])</synopsis>
</refsynopsisdiv>
- <refsection>
+ <refsection role="parameters">
<title>Arguments</title>
<variablelist>
<varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>w, iw</term>
- <listitem>
- <para>a real vectors. (INPUT/OUTPUT)</para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term>ng</term>
<listitem>
<para>an integer.</para>
<varlistentry>
<term>y</term>
<listitem>
- <para>a real vector or matrix. (OUTPUT)</para>
+ <para>a real vector or matrix. The solution.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>rd</term>
<listitem>
- <para>a real vector. (OUTPUT)</para>
+ <para>a real vector.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>vectors of real numbers.
+ See <link linkend="ode_optional_output">ode() optional output</link></para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="description">
<title>Description</title>
<para>
With this syntax (first argument equal to <literal>"root"</literal>)
If <literal>g</literal> is a function the syntax should be as
follows:
</para>
- <programlisting role="no-scilab-exec"><![CDATA[
+ <programlisting role="no-scilab-exec"><![CDATA[
z = g(t,y)
]]></programlisting>
<para>
<literal>ode</literal>, see the <link linkend="ode">ode</link> help.
</para>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <programlisting role="example"><![CDATA[
// Integration of the differential equation
// dy/dt=y , y(0)=1, and finds the minimum time t such that y(t)=2
deff("[ydot]=f(t,y)","ydot=y")
deff("[z]=g(t,y)","z=y-2")
y0=1;ng=1;
[y,rd]=ode("roots",y0,0,2,f,ng,g)
-
+
deff("[z]=g(t,y)","z=y-[2;2;33]")
[y,rd]=ode("roots",1,0,2,f,3,g)
]]></programlisting>
<title>See Also</title>
<simplelist type="inline">
<member>
- <link linkend="dasrt">dasrt</link>
+ <link linkend="ode">ode</link>
</member>
<member>
- <link linkend="daskr">daskr</link>
+ <link linkend="ode_optional_output">ode_optional_output</link>
</member>
<member>
- <link linkend="ode">ode</link>
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
+ <link linkend="dasrt">dasrt</link>
+ </member>
+ <member>
+ <link linkend="daskr">daskr</link>
</member>
</simplelist>
</refsection>
<refpurpose>solveur d'équations différentielles ordinaires</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <title>Séquence d'appel</title>
+ <title>Syntaxe</title>
<synopsis>y=ode(y0,t0,t,f)
[y,w,iw]=ode([type],y0,t0,t [,rtol [,atol]],f [,jac] [,w,iw])
[y,rd,w,iw]=ode("root",y0,t0,t [,rtol [,atol]],f [,jac],ng,g [,w,iw])
y=ode("discrete",y0,k0,kvect,f)
</synopsis>
</refsynopsisdiv>
- <refsection>
+ <refsection role="parameters">
<title>Paramètres</title>
<variablelist>
<varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>rtol, atol</term>
+ <term>atol, rtol</term>
<listitem>
- <para>constantes ou vecteurs réels de même taille que
- <literal>y</literal>.
+ <para>
+ tolérances absolue et relative sur les valeurs de la
+ solution
+ <varname>y</varname> (décimaux). Si <varname>atol</varname>
+ ou <varname>rtol</varname> est un scalaire, sa valeur est
+ utilisée pour chaque composante de <varname>y</varname>.
+ Sinon, elle doit être un vecteur de taille size(y), et
+ est appliquée aux composantes respectives de
+ <varname>y</varname>.
</para>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>w, iw</term>
- <listitem>
- <para>vecteurs réels</para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term>ng</term>
<listitem>
<para>entier</para>
<para>vecteur d'entiers.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>y</term>
+ <listitem>
+ <para>vecteur ou matrice réel: la solution.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rd</term>
+ <listitem>
+ <para>vecteur de réels.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>vecteurs de réels. Voir les <link linkend="ode_optional_output">options de sortie</link> de ode().</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="description">
<title>Description</title>
<para>
<literal>ode</literal> est la fonction utilisée pour approcher la
</listitem>
</itemizedlist>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Exemples</title>
<programlisting role="example"><![CDATA[
// ---------- EDO Simple (external : fonction Scilab)
<title>Voir aussi</title>
<simplelist type="inline">
<member>
- <link linkend="ode_discrete">ode_discrete</link>
+ <link linkend="odeoptions">odeoptions</link>
+ </member>
+ <member>
+ <link linkend="ode_optional_output">ode_optional_output</link>
</member>
<member>
<link linkend="ode_root">ode_root</link>
</member>
<member>
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
<link linkend="dassl">dassl</link>
</member>
<member>
<link linkend="odedc">odedc</link>
</member>
<member>
- <link linkend="odeoptions">odeoptions</link>
- </member>
- <member>
<link linkend="csim">csim</link>
</member>
<member>
</member>
</simplelist>
</refsection>
- <refsection>
+ <refsection role="bibliography">
<title>Bibliographie</title>
<para>Alan C. Hindmarsh, lsode and lsodi, two new initial value ordinary
differential equation solvers, acm-signum newsletter, vol. 15, no. 4
(1980), pp. 10-11.
</para>
</refsection>
- <refsection>
+ <refsection role="references">
<title>Fonctions Utilisées</title>
<para>Les sous-programmes associés se trouvent dans le répertoire
SCI/modules/differential_equations/src/fortran/: lsode.f lsoda.f lsodar.f
<?xml version="1.0" encoding="UTF-8"?>
-
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode" xml:lang="ja">
-
<refnamediv>
-
<refname>ode</refname>
-
<refpurpose>常微分方程式ソルバ</refpurpose>
-
</refnamediv>
-
<refsynopsisdiv>
-
<title>呼び出し手順</title>
-
<synopsis>
-
y = ode(y0, t0, t, f)
-
[y, w, iw] = ode([type,] y0, t0, t [,rtol [,atol]], f [,jac] [,w, iw])
-
[y, rd, w, iw] = ode("root", y0, t0, t [,rtol [,atol]], f [,jac],ng, g [,w,iw])
-
y = ode("discrete", y0, k0, kvect, f)
-
</synopsis>
-
</refsynopsisdiv>
-
- <refsection>
-
+ <refsection role="parameters">
<title>引数</title>
-
<variablelist>
-
<varlistentry>
-
<term>y0</term>
-
<listitem>
-
<para>実数ベクトルまたは行列 (初期条件).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>t0</term>
-
<listitem>
-
<para>実数スカラー (初期時間).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>t</term>
-
<listitem>
-
<para>実数ベクトル (解を計算する時間).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>f</term>
-
<listitem>
-
<para>関数, 外部 ,文字列またはリスト, 微分方程式の右辺.</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>type</term>
-
<listitem>
-
<para>
-
- 文字列,使用するソルバ. 利用可能なソルバ:
-
+ 文字列,使用するソルバ. 利用可能なソルバ:
<literal>"adams"</literal>,
-
<literal>"stiff"</literal>, <literal>"rk"</literal>,
-
<literal>"rkf"</literal>, <literal>"fix"</literal>,
-
<literal>"discrete"</literal>, <literal>"roots"</literal>.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
- <term>rtol</term>
-
+ <term>atol, rtol</term>
<listitem>
-
<para>
-
- 実数定数または
-
- <varname>y</varname>と同じ大きさの実数ベクトル.
-
+ absolute and relative tolerances on the final solution
+ <varname>y</varname> (decimal numbers). If each is a
+ single value, it applies
+ to each component of <varname>y</varname>. Otherwise,
+ it must be a vector of same size as size(y), and
+ is applied element-wise to <varname>y</varname>.
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
- <term>atol</term>
-
- <listitem>
-
- <para>
-
- 実数定数または
-
- <varname>y</varname>と同じ大きさの実数ベクトル.
-
- </para>
-
- </listitem>
-
- </varlistentry>
-
- <varlistentry>
-
<term>jac</term>
-
<listitem>
-
<para>
-
関数, 外部 文字列またはリスト, 関数<varname>f</varname>の
-
ヤコビアン.
-
</para>
-
- </listitem>
-
- </varlistentry>
-
- <varlistentry>
-
- <term>w, iw</term>
-
- <listitem>
-
- <para>実数ベクトル. (入力/出力)</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>ng</term>
-
<listitem>
-
<para>整数.</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>g</term>
-
<listitem>
-
<para>外部 (関数または文字列またはリスト).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>k0</term>
-
<listitem>
-
<para>整数 (初期時間).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>kvect</term>
-
<listitem>
-
<para>整数ベクトル.</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>y</term>
-
<listitem>
-
<para>実数のベクトルまたは行列. (出力)</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>rd</term>
-
<listitem>
-
<para>実数ベクトル. (出力)</para>
-
</listitem>
-
</varlistentry>
-
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>実数ベクトル. (入力/出力)
+ See <link linkend="ode_optional_output">ode() optional output</link>
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
-
</refsection>
-
- <refsection>
-
+ <refsection role="description">
<title>説明</title>
-
<para>
-
<function>ode</function>は,以下の陽の
-
常微分方程式を解きます:
-
</para>
-
<para>
-
<latex>
-
\begin{eqnarray}
-
\begin{array}{l}
-
\dfrac{dy}{dt} = f(t,y)\\
-
y(t_0)=y_0
-
\end{array}
-
\end{eqnarray}
-
</latex>
-
</para>
-
<para>
-
この関数は種々のソルバ, 特にODEPACKへのインターフェイスです.
-
</para>
-
<para>
-
- このヘルプでは,
-
+ このヘルプでは,
標準の陽のODEシステム用に<function>ode</function>の使用方法のみを
-
説明します.
-
</para>
-
<para>
-
<function>ode</function>の最も簡単なコールは以下のようになります:
-
- <literal>y = ode(y0,t0,t,f)</literal>
-
+ <literal>y = ode(y0,t0,t,f)</literal>
ただし,<literal>y0</literal> は初期条件ベクトル,
-
<literal>t0</literal> は初期時間,
-
<literal>t</literal> は解 <varname>y</varname>を計算する時間ベクトル,
-
そして,<varname>y</varname>は解ベクトルの行列
-
<literal>y=[y(t(1)),y(t(2)),...]</literal>です.
-
</para>
-
<para>
-
入力ベクトル<varname>f</varname>は1次微分方程式の右辺を
-
定義します.
-
この引数は特定のヘッダを有する関数です.
-
</para>
-
-
<itemizedlist>
-
<listitem>
-
<para>
-
<varname>f</varname> が Scilab 関数の場合,
-
その呼び出し手順は以下のようにします
-
</para>
-
<screen><![CDATA[
ydot = f(t,y)
]]></screen>
-
<para>
-
ただし,<literal>t</literal>は実数スカラー(時間),
-
<varname>y</varname> は実数ベクトル (状態量),
-
<literal>ydot</literal>は実数ベクトル (1次微分dy/dt)です.
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
<varname>f</varname> が文字列の場合,
-
FortranサブルーチンまたはC関数の名前が参照されます.
-
例えば,<literal>ode(y0,t0,t,"fex")</literal>をコールすると,
-
サブルーチン<literal>fex</literal>がコールされます.
-
</para>
-
<para>
-
Fortranルーチンは以下のようなヘッダを有する必要があります:
-
</para>
-
<screen><![CDATA[
fex(n,t,y,ydot)
]]></screen>
-
<para>
-
ただし,<literal>n</literal>は整数, <literal>t</literal>は
-
倍精度スカラー, <varname>y</varname> および
-
<literal>ydot</literal> は倍精度ベクトルです.
-
</para>
-
<para>
-
C関数は以下のようなヘッダを有する必要があります:
-
</para>
-
<screen><![CDATA[
fex(int *n,double *t,double *y,double *ydot)
]]></screen>
-
<para>
-
ただし,<literal>t</literal>は時間, <varname>y</varname>は
-
状態量, <literal>ydot</literal>は状態量の微分
-
(dy/dt)です.
-
</para>
-
<para>
-
この外部ルーチンは,
-
<link linkend="ilib_for_link">ilib_for_link</link>により
-
OSと独立した方法で構築でき,
-
<link linkend="link">link</link>
-
関数によりScilabに動的にリンクできます.
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
シミュレータ<varname>f</varname>が他の引数を
-
必要とする場合も起こりえます.
-
この場合, 以下の機能を使用可能です.
-
<varname>f</varname>の引数を
-
リスト<literal>lst=list(simuf,u1,u2,...un)</literal>とすることも
-
できます.
-
ただし,<literal>simuf</literal>は以下の構造を有するScilab関数です:
-
<literal>ydot = f(t,y,u1,u2,...,un)</literal>
-
ただし,<literal>u1</literal>, <literal>u2</literal>, ...,
-
<literal>un</literal>は,
-
シミュレータ<literal>simuf</literal>に自動的に指定される
-
外部引数です.
-
</para>
-
</listitem>
-
</itemizedlist>
-
<para>
-
- 関数<varname>f</varname>は,ベクトルではなく
-
+ 関数<varname>f</varname>は,ベクトルではなく
p行q列の行列を返すことができます.
-
この行列表記により,
-
<literal>n=p+q</literal>次のODEシステム<literal>dY/dt=F(t,Y)</literal>
-
を解きます.
-
ただし, <literal>Y</literal>は <literal>p x q</literal>の行列です.
-
初期条件 <literal>Y0</literal>も<literal>p x q</literal>の行列
-
- である必要があり, <function>ode</function>の結果は
-
+ である必要があり, <function>ode</function>の結果は
<literal>p行q(T+1)列</literal>
-
の行列 <literal>[Y(t_0),Y(t_1),...,Y(t_T)]</literal>
-
となります.
-
</para>
-
<para>
-
許容誤差<varname>rtol</varname> および <varname>atol</varname> は
-
相対および絶対推定誤差の閾値です.
-
<literal>y(i)</literal>の指定誤差は次のようになります:
-
<literal>rtol(i)*abs(y(i))+atol(i)</literal>
-
そして,状態量の全ての要素に関してこの誤差が小さい場合,
-
積分が行われます.
-
<varname>rtol</varname>または<varname>atol</varname>が定数の場合,
-
<literal>rtol(i)</literal>または<literal>atol(i)</literal>
-
はこの定数値に設定されます.
-
<varname>rtol</varname> および <varname>atol</varname>のデフォルト値は
-
多くのソルバではそれぞれ<literal>rtol=1.d-5</literal> および
-
<literal>atol=1.d-7</literal>,
-
<literal>"rfk"</literal> および <literal>"fix"</literal>では
-
<literal>rtol=1.d-3</literal> および <literal>atol=1.d-4</literal>です.
-
</para>
-
<para>
-
スティッフな問題の場合, RHS関数のヤコビアンを
-
オプションの引数 <varname>jac</varname>として
-
指定する方が良いでしょう.
-
ヤコビアンは,外部,すなわち,指定された構文を有する関数,
-
または指定した呼び出し手順を有するFortranサブルーチンまたは
-
C関数の名前(文字列),またはリストです.
-
</para>
-
<itemizedlist>
-
<listitem>
-
<para>
-
<varname>jac</varname> が関数の場合,
-
構文は
-
<literal>J=jac(t,y)</literal>とする必要があります.
-
ただし, <literal>t</literal> は実数スカラー (時間),
-
- <varname>y</varname>は実数ベクトル (状態量)です.
-
+ <varname>y</varname>は実数ベクトル (状態量)です.
結果の行列
-
<literal>J</literal> は df/dx を評価する必要があります.
-
- ただし, <literal>J(k,i) =dfk/dxi</literal> で
-
+ ただし, <literal>J(k,i) =dfk/dxi</literal> で
<literal>fk</literal> は<varname>f</varname>の
-
<literal>k</literal>番目の要素です.
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
- <varname>jac</varname>が文字列の場合,
-
+ <varname>jac</varname>が文字列の場合,
FortranサブルーチンまたはC関数の名前を指します.
-
</para>
-
<para>
-
このFortranルーチンは以下のようなヘッダを有する必要があります:
-
</para>
-
<screen><![CDATA[
subroutine fex(n,t,y,ml,mu,J,nrpd)
integer n,ml,mu,nrpd
double precision t,y(*),J(*)
]]></screen>
-
<para>
-
このC関数は以下のようなヘッダを有する必要があります:
-
</para>
-
<screen><![CDATA[
void fex(int *n,double *t,double *y,int *ml,int *mu,double *J,int *nrpd,)
]]></screen>
-
<para>
-
多くの場合,
-
<literal>ml</literal>, <literal>mu</literal> および
-
<literal>nrpd</literal>を参照する必要はありません.
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
<varname>jac</varname>がリストの場合,
-
<varname>f</varname>と同様の表記となります.
-
</para>
-
</listitem>
-
</itemizedlist>
-
<para>
-
オプション引数<varname>w</varname>および
-
<varname>iw</varname>は,
-
積分ルーチンにより返される情報を
-
保存するベクトルです(詳細は<link linkend="ode_optional_output">ode_optional_output</link> 参照).
-
これらのベクトルが <function>ode</function>のRHSで提供される場合,
-
積分は前回の停止時と同じパラメータで再開されます.
-
</para>
-
<para>
-
より多くのオプションを<literal>%ODEOPTIONS</literal>変数
-
によりODEPACKソルバに指定することができます.
-
<link linkend="odeoptions">odeoptions</link>を参照ください.
-
</para>
-
</refsection>
-
<refsection>
-
<title>ソルバ</title>
-
<para>
-
解く問題の型と使用する手法は最初のオプション引数
-
<varname>type</varname>の値に依存します.
-
この値には以下の文字列の一つを指定できます:
-
</para>
-
<variablelist>
-
<varlistentry>
-
<term><not given>:</term>
-
<listitem>
-
<para>
-
ODEPACKパッケージの<literal>lsoda</literal> ソルバが
-
デフォルトでコールされます.
-
このソルバは非スティッフな問題用の予測子/修正子 Adams 法と
-
スティッフな問題用の後退差分法(BDF)を自動的に選択します.
-
まず非スティッフな手法が使用され,使用する手法を
-
決定するためにデータを動的にモニタします.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"adams":</term>
-
<listitem>
-
<para>
-
これは非スティッフな問題用です. ODEPACKパッケージの
-
<literal>lsode</literal> ソルバがコールされ, この関数は
-
Adams法を使用します.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"stiff":</term>
-
<listitem>
-
<para>
-
これはスティッフな問題用です. ODEPACKパッケージの
-
<literal>lsode</literal> ソルバがコールされ, BDF法が使用されます.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"rk":</term>
-
<listitem>
-
<para>4次の適応型 Runge-Kutta (RK4) 法.</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"rkf":</term>
-
<listitem>
-
<para>
-
Fehlbergの4次と5次の Runge-Kutta法に基づくShampine および Wattsのプログラム
-
(RKF45) が使用されます.
-
この方法は非スティッフおよびややスティッフな問題用で,
-
微係数の評価コストが低い場合に適しています.
-
この手法は一般にユーザが高い精度を望む場合には使用するべきではありません.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"fix":</term>
-
<listitem>
-
<para>
-
<literal>"rkf"</literal>と同じソルバですがユーザインターフェイスが
-
非常にシンプルで,
-
<varname>rtol</varname> および <varname>atol</varname>パラメータのみを
-
ソルバに指定することが可能です.
-
この手法は使用できる中で最も簡単な手法です.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"root":</term>
-
<listitem>
-
<para>
-
解を得る機能を有するODE ソルバ. ODEPACKパッケージの
-
<literal>lsodar</literal> ソルバが使用されます.
-
使用されているのは<literal>lsoda</literal> ソルバを改変したもので,
-
指定したベクトル関数の根を見つけることができます.
-
詳細は <link linkend="ode_root">ode_root</link> のヘルプを参照してください.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"discrete":</term>
-
<listitem>
-
<para>
-
- 離散時間シミュレーション.
-
+ 離散時間シミュレーション.
詳細は <link linkend="ode_discrete">ode_discrete</link>
-
のヘルプを参照してください.
-
</para>
-
</listitem>
-
</varlistentry>
-
</variablelist>
-
</refsection>
-
<refsection>
-
<title>例</title>
-
<para>
-
以下の例では,初期条件<literal>y(0)=0</literal>で,常微分方程式
-
<literal>dy/dt=y^2-y*sin(t)+cos(t)</literal>を解きます.
-
デフォルトのソルバを使用します.
-
</para>
-
<programlisting role="example"><![CDATA[
function ydot=f(t,y)
- ydot=y^2-y*sin(t)+cos(t)
+ ydot=y^2-y*sin(t)+cos(t)
endfunction
y0=0;
t0=0;
y = ode(y0,t0,t,f);
plot(t,y)
]]></programlisting>
-
<scilab:image>
-
function ydot=f(t,y)
-
ydot=y^2-y*sin(t)+cos(t)
-
endfunction
-
y0=0;
-
t0=0;
-
t=0:0.1:%pi;
-
y = ode(y0,t0,t,f);
-
plot(t,y)
-
</scilab:image>
-
<para>
-
以下の例では,方程式<literal>dy/dt=A*y</literal>を解きます.
-
- 正確な解は<literal>y(t)=expm(A*t)*y(0)</literal>です,
-
+ 正確な解は<literal>y(t)=expm(A*t)*y(0)</literal>です,
ただし
-
<literal>expm</literal> は行列指数関数です.
-
未知量は2行1列の行列 y(t) です.
-
</para>
-
<programlisting role="example"><![CDATA[
function ydot=f(t,y)
ydot=A*y
// Compare with exact solution:
expm(A*t)*y0
]]></programlisting>
-
<para>
-
以下の例では,<literal>u(t)=sin(omega*t)</literal>として,
-
ODE <literal>dx/dt = A x(t) + B u(t)</literal>を解きます.
-
外部引数 <varname>f</varname>に関する注記:
-
<literal>A</literal>, <literal>u</literal>, <literal>B</literal>,
-
<literal>omega</literal>が関数<varname>f</varname>にリストとして
-
指定されます.
-
</para>
-
<programlisting role="example"><![CDATA[
function xdot=linear(t,x,A,u,B,omega)
xdot=A*x+B*u(t,omega)
t=[0.1,0.2,0.5,1];
ode(y0,t0,t,list(linear,A,u,B,omega))
]]></programlisting>
-
<para>
-
以下の例では,リカッチ微分方程式
-
<literal>dX/dt=A'*X + X*A - X'*B*X + C</literal>を解きます.
-
ただし,初期条件<literal>X(0)</literal>は2行2列の単位行列です.
-
</para>
-
<programlisting role="example"><![CDATA[
function Xdot=ric(t,X,A,B,C)
Xdot=A'*X+X*A-X'*B*X+C
t=0:0.1:%pi;
X = ode(y0,t0,t,list(ric,A,B,C))
]]></programlisting>
-
<para>
-
以下の例では,微分方程式
-
<literal>dY/dt=A*Y</literal>を解きます.
-
ただし,未知量<literal>Y(t)</literal>は2行2列の行列です.
-
厳密解は <literal>Y(t)=expm(A*t)</literal>です.
-
ただし,
-
<literal>expm</literal>は行列指数関数です.
-
</para>
-
<programlisting role="example"><![CDATA[
function ydot=f(t,y,A)
ydot=A*y;
expm(A*t)
ode("adams",y0,t0,t,f)
]]></programlisting>
-
</refsection>
-
- <refsection>
-
+ <refsection role="examples">
<title>コンパイラを使用</title>
-
<para>
-
以下の例はCコンパイラを必要とします.
-
</para>
-
<programlisting role="example"><![CDATA[
// ---------- Simple one dimension ODE (C coded external)
ccode=['#include <math.h>'
' ydot[0]=y[0]*y[0]-y[0]*sin(*t)+cos(*t);'
'}']
mputl(ccode,TMPDIR+'/myode.c') //create the C file
+
// Compile
ilib_for_link('myode','myode.c',[],'c',[],TMPDIR+'/loader.sce');
exec(TMPDIR+'/loader.sce') //incremental linking
t0=0;
t=0:0.1:%pi;
y = ode(y0,t0,t,'myode');
-
]]></programlisting>
-
</refsection>
-
<refsection role="see also">
-
<title>参照</title>
-
<simplelist type="inline">
-
<member>
-
- <link linkend="ode_discrete">ode_discrete</link>
-
+ <link linkend="odeoptions">odeoptions</link>
+ </member>
+ <member>
+ <link linkend="ode_optional_output">ode_optional_output</link>
</member>
-
<member>
-
<link linkend="ode_root">ode_root</link>
-
</member>
-
<member>
-
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
<link linkend="dassl">dassl</link>
-
</member>
-
<member>
-
<link linkend="impl">impl</link>
-
</member>
-
<member>
-
<link linkend="odedc">odedc</link>
-
</member>
-
<member>
-
- <link linkend="odeoptions">odeoptions</link>
-
- </member>
-
- <member>
-
<link linkend="csim">csim</link>
-
</member>
-
<member>
-
<link linkend="ltitr">ltitr</link>
-
</member>
-
<member>
-
<link linkend="rtitr">rtitr</link>
-
</member>
-
<member>
-
<link linkend="intg">intg</link>
-
</member>
-
</simplelist>
-
</refsection>
-
- <refsection>
-
+ <refsection role="bibliography">
<title>参考文献</title>
-
<para>
-
Alan C. Hindmarsh, "lsode and lsodi, two new initial value ordinary
-
differential equation solvers", ACM-Signum newsletter, vol. 15, no. 4
-
(1980), pp. 10-11.
-
</para>
-
</refsection>
-
- <refsection>
-
+ <refsection role="references">
<title>使用される関数</title>
-
<para>
-
- 関連する関数は SCI/modules/differential_equations/src/fortran
-
+ 関連する関数は SCI/modules/differential_equations/src/fortran
ディレクトリにあります:
-
lsode.f lsoda.f lsodar.f
-
</para>
-
</refsection>
-
-</refentry>
-
+</refentry>
\ No newline at end of file
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* ...
- *
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
<refname>ode_optional_output</refname>
<refpurpose>ode ソルバのオプション出力の説明</refpurpose>
</refnamediv>
- <refsection>
+ <refsection role="parameters">
<title>説明</title>
<para>
このページは,
<link linkend="ode">ode</link>関数のオプションの左辺引数
<literal>w</literal> および<literal>iw</literal>
に返される最も重要な値について記述するものです.
- これらは, <literal>lsode</literal>
+ これらは, <literal>lsode</literal>
<literal>lsoda</literal> および <literal>lsodar</literal>
ODEソルバの場合のみ有効です.
より詳細については,
</para>
<variablelist>
<varlistentry>
+ <term>w(1:10)</term>
+ <listitem>
+ <para>Not supported. See the discussion <ulink url="http://bugzilla.scilab.org/2104#c2">there</ulink>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>w(11)</term>
<listitem>
<para> 直近に(成功裏に)使用した時間刻み t </para>
<varlistentry>
<term>w(13)</term>
<listitem>
- <para>
+ <para>
ソルバが実際に達した独立変数のカレントの値,
すなわち,tのカレントの内部メッシュ点.
出力される tcur は最低でも引数 t となり,
<varlistentry>
<term>w(14)</term>
<listitem>
- <para>
+ <para>
許容誤差のスケールファクタで,1より大きく,
精度が過剰なリクエストが検出された場合に計算されます
(問題の開始時に検出された場合: istate = -3, その他の場合: istate = -2).
<varlistentry>
<term>w(15)</term>
<listitem>
- <para>
+ <para>
(もしあれば,)直近の手法切替を行った時間における t の値.
この値は <literal>lsode</literal> ソルバでは意味がありません.
</para>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iw(1:9)</term>
+ <listitem>
+ <para>Not supported. See the discussion <ulink url="http://bugzilla.scilab.org/2104#c2">there</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(10)</term>
<listitem>
- <para>
+ <para>
これまでに問題に関して<literal>g</literal>を評価した数.
この値は <literal>lsodar</literal> ソルバでは意味がありません.
</para>
<varlistentry>
<term>iw(13)</term>
<listitem>
- <para>
+ <para>
これまでに問題に関して行われたヤコビアン(および行列のLU分解)の評価の回数.
</para>
</listitem>
<varlistentry>
<term>iw(14)</term>
<listitem>
- <para>
+ <para>
(成功裏に)直近に使用された手法の次数.
</para>
</listitem>
<varlistentry>
<term>iw(15)</term>
<listitem>
- <para>
+ <para>
次のステップで試行される次数.
</para>
</listitem>
<varlistentry>
<term>iw(16)</term>
<listitem>
- <para>
+ <para>
重みつきローカル誤差ベクトル( e(i)/ewt(i) )における
最大の大きさの要素の添字,
エラーの場合に istate = -4 または -5 と共に返されます.
<varlistentry>
<term>iw(17)</term>
<listitem>
- <para>
+ <para>
実際に必要な <literal>w</literal> の長さであり,
rworkの長さが問題の残りの処理で固定され,
切替が発生すると仮定されます.
<varlistentry>
<term>iw(19)</term>
<listitem>
- <para>
+ <para>
直近の処理が成功したステップに関する手法のインジケータです.
1 は adams (非スティッフ), 2 は bdf (スティッフ) を意味します.
この値は <literal>lsode</literal> ソルバでは意味がありません.
<varlistentry>
<term>iw(20)</term>
<listitem>
- <para>
+ <para>
カレントの手法のインジケータです.
1 は adams (非スティッフ), 2 は bdf (スティッフ) を意味します.
この値は次のステップで試行される手法です.
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* ...
- *
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
* 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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode_root" xml:lang="ja">
-
<refnamediv>
-
<refname>ode_root</refname>
-
<refpurpose>求解付きの常微分方程式ソルバ</refpurpose>
-
</refnamediv>
-
<refsynopsisdiv>
-
<title>呼び出し手順</title>
-
<synopsis>
-
[y, rd, w, iw] = ode("root", y0, t0, t [,rtol [,atol]], f [,jac], ng, g [,w,iw])
-
</synopsis>
-
</refsynopsisdiv>
-
- <refsection>
-
+ <refsection role="parameters">
<title>引数</title>
-
<variablelist>
-
<varlistentry>
-
<term>y0</term>
-
<listitem>
-
<para>実数ベクトルまたは行列 (初期条件).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>t0</term>
-
<listitem>
-
<para>実数スカラー (初期時間).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>t</term>
-
<listitem>
-
<para>実数ベクトル (解を計算する時間).</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>f</term>
-
<listitem>
-
<para>外部ルーチン,すなわち,関数または文字列またはリスト.</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>rtol, atol</term>
-
<listitem>
-
<para>
-
実数定数または<literal>y</literal>と同じ大きさの実数ベクトル.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>jac</term>
-
<listitem>
-
<para>外部ルーチン,すなわち,関数または文字列またはリスト.</para>
-
- </listitem>
-
- </varlistentry>
-
- <varlistentry>
-
- <term>w, iw</term>
-
- <listitem>
-
- <para>実数ベクトル.(入力/出力)</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>ng</term>
-
<listitem>
-
<para>整数.</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>g</term>
-
<listitem>
-
<para>外部ルーチン,すなわち,関数または文字列またはリスト.</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>y</term>
-
<listitem>
-
- <para>実数のベクトルまたは行列. (出力)</para>
-
+ <para>実数のベクトルまたは行列.</para>
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>rd</term>
-
<listitem>
-
- <para>実数ベクトル. (出力)</para>
-
+ <para>実数ベクトル.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>実数ベクトル.(入力/出力).
+ See <link linkend="ode_optional_output">ode() optional output</link></para>
</listitem>
-
</varlistentry>
-
</variablelist>
-
</refsection>
-
- <refsection>
-
+ <refsection role="description">
<title>説明</title>
-
<para>
-
この構文により (最初の引数が<literal>"root"</literal>)
-
<literal>ode</literal> は, 状態量<literal>y(t)</literal>が
-
面<literal>g(t,y)=0</literal>と交差するまで
-
微分方程式<literal>dy/dt=f(t,y)</literal>
-
の解を計算します.
-
</para>
-
<para>
-
<literal>g</literal> に面の方程式を指定します.
-
これは指定した構文を有する外部関数,または
-
指定したコール手順を有する
-
FortranサブルーチンまたはC関数(文字列)またはリストです.
-
</para>
-
<para>
-
<literal>g</literal> が関数の場合,その構文は以下のようにする
-
必要があります:
-
</para>
-
- <programlisting role="no-scilab-exec"><![CDATA[
+ <programlisting role="no-scilab-exec"><![CDATA[
z = g(t,y)
]]></programlisting>
-
<para>
-
ただし, <literal>t</literal> はスカラー実数 (時間),
-
<literal>y</literal> は実数ベクトル (状態量). この関数は,
-
<literal>ng</literal>個の拘束条件に対応する
-
大きさ<literal>ng</literal>のベクトルを返します.
-
<literal>g</literal> が文字列の場合,
-
この文字列は, FortranサブルーチンまたはC関数を指しており,
-
以下のようなコール手順となります: <literal>g(n,t,y,ng,gout)</literal>.
-
ただし, <literal>ng</literal>は拘束条件の数,
-
<literal>gout</literal>は<literal>g</literal>の値
-
(プログラムの出力)です.
-
<literal>g</literal> は,
-
<literal>f</literal> と同じ表記のリストです.
-
(<link linkend="ode">ode</link>のヘルプ参照).
-
</para>
-
<para>
-
出力 <literal>rd</literal> は <literal>1 x k</literal> ベクトルです.
-
最初のエントリは,停止時間を含んでいます.
-
他のエントリは,<literal>g</literal>のどの要素の符号が変わったのかを
-
示すエントリです.
-
<literal>k</literal>が2より大きい場合,1以上の面
-
(<literal>(k-1)</literal> 個の面)が同時に符号が変わったことを意味します.
-
</para>
-
<para>他の引数と他のオプションは,
-
<literal>ode</literal>と同じです.<link linkend="ode">ode</link>のヘルプを参照ください.
-
</para>
-
</refsection>
-
- <refsection>
-
+ <refsection role="examples">
<title>例</title>
-
- <programlisting role="example"><![CDATA[
+ <programlisting role="example"><![CDATA[
// 微分方程式の積分
// dy/dt=y , y(0)=1, として y(t)=2 となる最小の時間 t を探します
deff("[ydot]=f(t,y)","ydot=y")
deff("[z]=g(t,y)","z=y-2")
-y0=1;ng=1;
+y0=1;
+ng=1;
[y,rd]=ode("roots",y0,0,2,f,ng,g)
deff("[z]=g(t,y)","z=y-[2;2;33]")
[y,rd]=ode("roots",1,0,2,f,3,g)
]]></programlisting>
-
</refsection>
-
<refsection role="see also">
-
<title>参照</title>
-
<simplelist type="inline">
-
<member>
-
- <link linkend="dasrt">dasrt</link>
-
+ <link linkend="ode">ode</link>
</member>
-
<member>
-
- <link linkend="daskr">daskr</link>
-
+ <link linkend="ode_optional_output">ode_optional_output</link>
</member>
-
<member>
-
- <link linkend="ode">ode</link>
-
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
+ <link linkend="dasrt">dasrt</link>
+ </member>
+ <member>
+ <link linkend="daskr">daskr</link>
</member>
-
</simplelist>
-
</refsection>
-
-</refentry>
-
+</refentry>
\ No newline at end of file
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode" xml:lang="en">
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * Copyright (C) 2016 - Samuel GOUGEON
+ * 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:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode" xml:lang="pt">
<refnamediv>
<refname>ode</refname>
- <refpurpose>Solucionador de equações diferenciais ordinárias</refpurpose>
+ <refpurpose>Solucionador de equações diferenciais ordinárias</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <title>Seqüência de Chamamento</title>
- <synopsis>y=ode(y0,t0,t,f)
- [y,w,iw]=ode([type],y0,t0,t [,rtol [,atol]],f [,jac] [,w,iw])
- [y,rd,w,iw]=ode("root",y0,t0,t [,rtol [,atol]],f [,jac],ng,g [,w,iw])
- y=ode("discrete",y0,k0,kvect,f)
+ <title>Seqüência de Chamamento</title>
+ <synopsis>y = ode(y0,t0,t,f)
+ [y,w,iw] = ode([type],y0,t0,t [,rtol [,atol]],f [,jac] [,w,iw])
+ [y,rd,w,iw] = ode("root",y0,t0,t [,rtol [,atol]],f [,jac],ng,g [,w,iw])
+ y = ode("discrete",y0,k0,kvect,f)
</synopsis>
</refsynopsisdiv>
- <refsection>
- <title>Parâmetros</title>
+ <refsection role="parameters">
+ <title>Parâmetros</title>
<variablelist>
<varlistentry>
<term>y0</term>
<listitem>
- <para>matriz ou vetor de reais (condições iniciais).</para>
+ <para>matriz ou vetor de reais (condições iniciais).</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>t</term>
<listitem>
- <para>vetor de reais (tempos nos quais a solução é
+ <para>vetor de reais (tempos nos quais a solução é
computada).
</para>
</listitem>
<varlistentry>
<term>f</term>
<listitem>
- <para>função externa (função, lista ou string).</para>
+ <para>função externa (função, lista ou string).</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>jac</term>
<listitem>
- <para>função externa (função, lista ou string).</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>w, iw</term>
- <listitem>
- <para>vetores de reais</para>
+ <para>função externa (função, lista ou string).</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>g</term>
<listitem>
- <para>função externa (função, lista ou string).</para>
+ <para>função externa (função, lista ou string).</para>
</listitem>
</varlistentry>
<varlistentry>
<para>vetor de inteiros.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>y</term>
+ <listitem>
+ <para>a real vector or matrix. The solution.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rd</term>
+ <listitem>
+ <para>a real vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>vetores de reais.
+ Ver <link linkend="ode_optional_output">ode() optional output</link>
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsection>
- <refsection>
- <title>Descrição</title>
+ <refsection role="description">
+ <title>Descrição</title>
<para>
- <literal>ode</literal> é a função padrão para se resolver sistemas
- de EDO explícitos definidos por: dy/dt=f(t,y) , y(t0)=y0. É uma interface
- entre vários solucionadores, em particular a ODEPACK. O tipo de problema
- resolvido e o método a ser utilizado dependem do primeiro argumento
+ <literal>ode</literal> é a função padrão para se resolver sistemas
+ de EDO explícitos definidos por: dy/dt=f(t,y) , y(t0)=y0. É uma interface
+ entre vários solucionadores, em particular a ODEPACK. O tipo de problema
+ resolvido e o método a ser utilizado dependem do primeiro argumento
opcional <literal>type</literal> que pode ser um dos strings
seguintes:
</para>
<term><not given>:</term>
<listitem>
<para>
- O solucionador <literal>lsoda</literal> do pacote ODEPACK é
- chamado por padrão. Ele escolhe automaticamente entre o método
- preditor-corretor não-rígido de Adams e a Fórmula de Diferenciação
- Retroativa (FDR) rígida. Ele utiliza o método não rígido
- inicialmente e monitora os dados para decidir qual método
+ O solucionador <literal>lsoda</literal> do pacote ODEPACK é
+ chamado por padrão. Ele escolhe automaticamente entre o método
+ preditor-corretor não-rígido de Adams e a Fórmula de Diferenciação
+ Retroativa (FDR) rígida. Ele utiliza o método não rígido
+ inicialmente e monitora os dados para decidir qual método
utilizar.
</para>
</listitem>
<varlistentry>
<term>"adams":</term>
<listitem>
- <para>Este é para problemas não rígidos. O solucionador
- <literal>lsode</literal> do pacote ODEPACK é chamado e utiliza o
- método de Adams.
+ <para>Este é para problemas não rígidos. O solucionador
+ <literal>lsode</literal> do pacote ODEPACK é chamado e utiliza o
+ método de Adams.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>"stiff":</term>
<listitem>
- <para>Este é para problemas rígidos. O solucionador
- <literal>lsode</literal> do pacote ODEPACK é chamado e é utilizado o
- método FDR.
+ <para>Este é para problemas rígidos. O solucionador
+ <literal>lsode</literal> do pacote ODEPACK é chamado e é utilizado o
+ método FDR.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>"rk":</term>
<listitem>
- <para>Método adaptativo de Runge-Kutta de ordem 4 (RK4).</para>
+ <para>Método adaptativo de Runge-Kutta de ordem 4 (RK4).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>"rkf":</term>
<listitem>
<para>O programa de Shampine e Watts baseado no par Runge-Kutta de
- Fehlberg de ordem 4 e 5 (RKF45) é utilizado. Este é utilizado para
- problemas não-rígidos e mediamente rígidos quando as computações de
- derivação não são custosas. Este método não é recomendado ser
- utilizado quando o usuário requer uma maior precisão.
+ Fehlberg de ordem 4 e 5 (RKF45) é utilizado. Este é utilizado para
+ problemas não-rígidos e mediamente rígidos quando as computações de
+ derivação não são custosas. Este método não é recomendado ser
+ utilizado quando o usuário requer uma maior precisão.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Mesmo solucionador que <literal>"rkf"</literal>, mas a
- interface do usuário é bem
- simples, i.e. apenas os parâmetros <literal>rtol</literal> e
- <literal>atol</literal> podem ser passados ao solucionador. Este é o
- método mais simples a se tentar.
+ interface do usuário é bem
+ simples, i.e. apenas os parâmetros <literal>rtol</literal> e
+ <literal>atol</literal> podem ser passados ao solucionador. Este é o
+ método mais simples a se tentar.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>"root":</term>
<listitem>
- <para>Solucionador de EDOs com capacidade de encontrar raízes. O
- solucionador <literal>lsodar</literal> do pacote ODEPACK é
- utilizado. É uma variante do solucionador <literal>lsoda</literal>
- onde se acha raízes de uma dada função vetorial. Ver ajuda em
+ <para>Solucionador de EDOs com capacidade de encontrar raízes. O
+ solucionador <literal>lsodar</literal> do pacote ODEPACK é
+ utilizado. É uma variante do solucionador <literal>lsoda</literal>
+ onde se acha raízes de uma dada função vetorial. Ver ajuda em
<link linkend="ode_root">ode_root</link> para mais detalhes.
</para>
</listitem>
<term>"discrete":</term>
<listitem>
<para>
- Simulação de tempo discreto. Ver ajuda em <link linkend="ode_discrete">ode_discrete</link> para
+ Simulação de tempo discreto. Ver ajuda em <link linkend="ode_discrete">ode_discrete</link> para
mais detalhes.
</para>
</listitem>
</variablelist>
<para>
Nesta ajuda podemos apenas descrever o uso de <literal>ode</literal>
- para sistemas padrões explícitos EDOs .
+ para sistemas padrões explícitos EDOs .
</para>
<itemizedlist>
<listitem>
<para>
- A chamada mais simples a <literal>ode</literal> é:
- <literal>y=ode(y0,t0,t,f)</literal> onde <literal>y0</literal> é o
- vetor de condições iniciais, <literal>t0</literal> é o tempo inicial,
- <literal>t</literal> é o vetor de tempos onde a solução
- <literal>y</literal> é computada e <literal>y</literal> é a matriz de
- vetores soluções <literal>y=[y(t(1)),y(t(2)),...]</literal>.
+ A chamada mais simples a <literal>ode</literal> é:
+ <literal>y=ode(y0,t0,t,f)</literal> onde <literal>y0</literal> é o
+ vetor de condições iniciais, <literal>t0</literal> é o tempo inicial,
+ <literal>t</literal> é o vetor de tempos onde a solução
+ <literal>y</literal> é computada e <literal>y</literal> é a matriz de
+ vetores soluções <literal>y=[y(t(1)),y(t(2)),...]</literal>.
</para>
<para>
O argumento de entrada <literal>f</literal> define o lado
- direito da equação diferencial de primeira ordem: dy/dt=f(t,y). É uma
- função externa, isto é, uma função com sintaxe especificada, ou o nome
- de uma subrotina Fortran ou uma subfunção C (string) com seqüência de
+ direito da equação diferencial de primeira ordem: dy/dt=f(t,y). É uma
+ função externa, isto é, uma função com sintaxe especificada, ou o nome
+ de uma subrotina Fortran ou uma subfunção C (string) com seqüência de
chamamento especificada, ou uma lista:
</para>
<itemizedlist>
<listitem>
<para>
- Se <literal>f</literal> for uma função do Scilab, a sua
+ Se <literal>f</literal> for uma função do Scilab, a sua
sintaxe deve ser <literal>ydot = f(t,y)</literal>, onde
- <literal>t</literal> é um escalar real (tempo) e
- <literal>y</literal> é um vetor de reais (estado).
- <literal>ydot</literal> é um vetor de reais (dy/dt)
+ <literal>t</literal> é um escalar real (tempo) e
+ <literal>y</literal> é um vetor de reais (estado).
+ <literal>ydot</literal> é um vetor de reais (dy/dt)
</para>
</listitem>
<listitem>
<para>
- Se <literal>f</literal> é um string ele se refere ao nome de
- uma subrotina Fortran ou uma subfunção C, i.e. Se
- <literal>ode(y0,t0,t,"fex")</literal> for o comando, então a
- subrotina <literal>fex</literal> será chamada.
+ Se <literal>f</literal> é um string ele se refere ao nome de
+ uma subrotina Fortran ou uma subfunção C, i.e. Se
+ <literal>ode(y0,t0,t,"fex")</literal> for o comando, então a
+ subrotina <literal>fex</literal> será chamada.
</para>
- <para>A rotina Fortran deve ter a seguinte seqüência de
+ <para>A rotina Fortran deve ter a seguinte seqüência de
chamamento: <literal>fex(n,t,y,ydot)</literal>, com n um inteiro,
- t um escalar de dupla precisão, y e ydot vetores de dupla
- precisão.
+ t um escalar de dupla precisão, y e ydot vetores de dupla
+ precisão.
</para>
<para>
- A função C deve ter o seguinte protótipo: <literal>fex(int
+ A função C deve ter o seguinte protótipo: <literal>fex(int
*n,double *t,double *y,double *ydot)
</literal>
</para>
<para>
- <literal>t</literal> é o tempo, <literal>y</literal> o
+ <literal>t</literal> é o tempo, <literal>y</literal> o
estado e <literal>ydot</literal> a derivada do estado
(dy/dt)
</para>
- <para>Esta função externa pode ser construída em um SO de modo
- indpendente através de <link linkend="ilib_for_link">ilib_for_link</link> e ligada
- dinamicamente através da função do Scilab <link linkend="link">link</link>.
+ <para>Esta função externa pode ser construída em um SO de modo
+ indpendente através de <link linkend="ilib_for_link">ilib_for_link</link> e ligada
+ dinamicamente através da função do Scilab <link linkend="link">link</link>.
</para>
</listitem>
<listitem>
<para>
- O argumento <literal>f</literal> também pode ser uma lista
+ O argumento <literal>f</literal> também pode ser uma lista
com a seguinte estrutura:
<literal>lst=list(realf,u1,u2,...un)</literal> onde
- <literal>realf</literal> é uma função do Scilab com a sintaxe:
+ <literal>realf</literal> é uma função do Scilab com a sintaxe:
<literal>ydot = f(t,y,u1,u2,...,un)</literal>
</para>
- <para>Esta sintaxe permite utilizar parâmetros como argumentos de
+ <para>Esta sintaxe permite utilizar parâmetros como argumentos de
<literal>realf</literal>.
</para>
</listitem>
</itemizedlist>
<para>
- A função <literal>f</literal> pode retornar uma matriz
- <literal>p x q</literal> ao invés de um vetor. Com esta notação de
+ A função <literal>f</literal> pode retornar uma matriz
+ <literal>p x q</literal> ao invés de um vetor. Com esta notação de
matriz, nos resolvemos o sistema <literal>n=p+q</literal> de EDOs
- <literal>dY/dt=F(t,Y)</literal> onde <literal>Y</literal> é uma matriz
- <literal>p x q</literal> matrix. Então, as condições iniciais,
- <literal>Y0</literal>, também devem ser uma matriz <literal>p x
+ <literal>dY/dt=F(t,Y)</literal> onde <literal>Y</literal> é uma matriz
+ <literal>p x q</literal> matrix. Então, as condições iniciais,
+ <literal>Y0</literal>, também devem ser uma matriz <literal>p x
q
</literal>
- eo resultado de <literal>ode</literal> é a matriz
+ eo resultado de <literal>ode</literal> é a matriz
<literal>p x q(T+1)</literal>
<literal>[Y(t_0),Y(t_1),...,Y(t_T)]</literal>.
</para>
</listitem>
<listitem>
<para>Argumentos de entrada opcionais podem ser fornecidos para o erro
- da solução: <literal>rtol</literal> e <literal>atol</literal> são
+ da solução: <literal>rtol</literal> e <literal>atol</literal> são
limiares para os erros relativos e absolutos estimados. O erro
- estimado em <literal>y(i)</literal> é:
+ estimado em <literal>y(i)</literal> é:
<literal>rtol(i)*abs(y(i))+atol(i)</literal>
</para>
- <para>e uma intergração é feita enquanto este erro é pequeno para
+ <para>e uma intergração é feita enquanto este erro é pequeno para
todos os componentes do estado. Se <literal>rtol</literal> e/ou
<literal>atol</literal> for uma constante <literal>rtol(i)</literal>
- e/ou <literal>atol(i)</literal> são ajustados para esta constante. Os
- valores padrões para <literal>rtol</literal> e <literal>atol</literal>
- são respectivamente <literal>rtol=1.d-5</literal> e
+ e/ou <literal>atol(i)</literal> são ajustados para esta constante. Os
+ valores padrões para <literal>rtol</literal> e <literal>atol</literal>
+ são respectivamente <literal>rtol=1.d-5</literal> e
<literal>atol=1.d-7</literal> para a maior parte dos solucionadores
<literal>rtol=1.d-3</literal> e <literal>atol=1.d-4</literal> para
<literal>"rfk"</literal> e <literal>"fix"</literal>.
</para>
</listitem>
<listitem>
- <para>Para problemas rígidos, é melhor fornecer o Jacobiano da função
- do lado direito da equação como o argumento opcional
- <literal>jac</literal>. É uma função externa, istoé i.e. uma função
+ <para>Para problemas rígidos, é melhor fornecer o Jacobiano da função
+ do lado direito da equação como o argumento opcional
+ <literal>jac</literal>. É uma função externa, istoé i.e. uma função
com sintaxe especificada, ou o nome de uma subrotina Fortran ou uma
- subfunção C (string) com seqüência de chamamento especificada, ou uma
+ subfunção C (string) com seqüência de chamamento especificada, ou uma
lista.
</para>
<para>
- Se <literal>jac</literal> for uma função, a sintaxe deve ser
+ Se <literal>jac</literal> for uma função, a sintaxe deve ser
<literal>J=jac(t,y)</literal>
</para>
<para>
- onde <literal>t</literal> é um escalar real (tempo),
- <literal>y</literal> é um vetor de reais (estado). A matriz resultante
+ onde <literal>t</literal> é um escalar real (tempo),
+ <literal>y</literal> é um vetor de reais (estado). A matriz resultante
<literal>J</literal> deve fornecer df/dx i.e. <literal>J(k,i) =
dfk/dxi
</literal>
- com <literal>fk</literal> = k-ésimo componente de
+ com <literal>fk</literal> = k-ésimo componente de
f.
</para>
<para>
Se <literal>jac</literal> for um sting, ele se refere a uma
- subrotina Fortran, ou uma subfunção C, com as seguinte seqüência de
+ subrotina Fortran, ou uma subfunção C, com as seguinte seqüência de
chamamento:
</para>
<para>No caso Fortran:</para>
]]></programlisting>
<para>
<literal>jac(n,t,y,ml,mu,J,nrpd)</literal>. Na maior parte dos
- casos, você não tem que se referir a <literal>ml</literal>,
+ casos, você não tem que se referir a <literal>ml</literal>,
<literal>mu</literal> e <literal>nrpd</literal>.
</para>
<para>
- Se <literal>jac</literal> for uma lista, as mesmas convenções
+ Se <literal>jac</literal> for uma lista, as mesmas convenções
que para <literal>f</literal> se aplicam.
</para>
</listitem>
<listitem>
<para>
Os argumentos opcionais <literal>w</literal> e
- <literal>iw</literal> e vetores para armazenamento de informações
- podem ser retornados pela rotina de integração (ver <link linkend="ode_optional_output">ode_optional_output</link> para
- detalhes). Queando esses vetores são fornecidos no lado direito de
- <literal>ode</literal>, a integração reinicia com os mesmos parâmetros
+ <literal>iw</literal> e vetores para armazenamento de informações
+ podem ser retornados pela rotina de integração (ver <link linkend="ode_optional_output">ode_optional_output</link> para
+ detalhes). Queando esses vetores são fornecidos no lado direito de
+ <literal>ode</literal>, a integração reinicia com os mesmos parâmetros
da parada anteiror.
</para>
</listitem>
<listitem>
- <para>Mais opções podem ser fornecidas a solucionadores ODEPACK
- utilizando-se a variável <literal>%ODEOPTIONS</literal>. Ver <link linkend="odeoptions">odeoptions</link>.
+ <para>Mais opções podem ser fornecidas a solucionadores ODEPACK
+ utilizando-se a variável <literal>%ODEOPTIONS</literal>. Ver <link linkend="odeoptions">odeoptions</link>.
</para>
</listitem>
</itemizedlist>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Exemplos</title>
<programlisting role="example"><![CDATA[
-// ---------- EDO simples de uma dimensão (função externa do Scilab)
+// ---------- EDO simples de uma dimensão (função externa do Scilab)
// dy/dt=y^2-y sin(t)+cos(t), y(0)=0
function ydot=f(t,y),ydot=y^2-y*sin(t)+cos(t),endfunction
y0=0;t0=0;t=0:0.1:%pi;
y=ode(y0,t0,t,f)
plot(t,y)
-// ---------- EDO simples de uma dimensão (função externa codificada em C)
+// ---------- EDO simples de uma dimensão (função externa codificada em C)
ccode=['#include <math.h>'
'void myode(int *n,double *t,double *y,double *ydot)'
'{'
y0=0;t0=0;t=0:0.1:%pi;
y=ode(y0,t0,t,'myode');
-// ---------- Simulação de dx/dt = A x(t) + B u(t) com u(t)=sin(omega*t),
+// ---------- Simulação de dx/dt = A x(t) + B u(t) com u(t)=sin(omega*t),
// x0=[1;0]
-// solução x(t) desejada em t=0.1, 0.2, 0.5 ,1.
-// A e a função u são passados para a função do lado direito em uma lista.
-// B e omega são passados como variáveis globais
+// solução x(t) desejada em t=0.1, 0.2, 0.5 ,1.
+// A e a função u são passados para a função do lado direito em uma lista.
+// B e omega são passados como variáveis globais
function xdot=linear(t,x,A,u),xdot=A*x+B*u(t),endfunction
function ut=u(t),ut=sin(omega*t),endfunction
A=[1 1;0 2];B=[1;1];omega=5;
ode([1;0],0,[0.1,0.2,0.5,1],list(linear,A,u))
-// ---------- Integração com notação matricial da equação diferencial de Ricatti
+// ---------- Integração com notação matricial da equação diferencial de Ricatti
// Xdot=A'*X + X*A - X'*B*X + C , X(0)=Identity
-// Solução em t=[1,2]
+// Solução em t=[1,2]
function Xdot=ric(t,X),Xdot=A'*X+X*A-X'*B*X+C,endfunction
A=[1,1;0,2]; B=[1,0;0,1]; C=[1,0;0,1];
t0=0;t=0:0.1:%pi;
X=ode(eye(A),0,t,ric)
-// ---------- Notação matricial, computação de exp(A)
+// ---------- Notação matricial, computação de exp(A)
A=[1,1;0,2];
function xdot=f(t,x),xdot=A*x;,endfunction
ode(eye(A),0,1,f)
ode("adams",eye(A),0,1,f)
-// ---------- Notação de matriz, computação de exp(A) com matriz rígida, Jacobian fornecida
+// ---------- Notação de matriz, computação de exp(A) com matriz rígida, Jacobian fornecida
A=[10,0;0,-1];
function xdot=f(t,x),xdot=A*x,endfunction
function J=Jacobian(t,y),J=A,endfunction
]]></programlisting>
</refsection>
<refsection role="see also">
- <title>Ver Também</title>
+ <title>Ver Também</title>
<simplelist type="inline">
<member>
- <link linkend="ode_discrete">ode_discrete</link>
+ <link linkend="odeoptions">odeoptions</link>
+ </member>
+ <member>
+ <link linkend="ode_optional_output">ode_optional_output</link>
</member>
<member>
<link linkend="ode_root">ode_root</link>
</member>
<member>
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
<link linkend="dassl">dassl</link>
</member>
<member>
<link linkend="odedc">odedc</link>
</member>
<member>
- <link linkend="odeoptions">odeoptions</link>
- </member>
- <member>
<link linkend="csim">csim</link>
</member>
<member>
</member>
</simplelist>
</refsection>
- <refsection>
+ <refsection role="bibliography">
<title>Bibliografia</title>
<para>Alan C. Hindmarsh, lsode and lsodi, two new initial value ordinary
differential equation solvers, acm-signum newsletter, vol. 15, no. 4
(1980), pp. 10-11.
</para>
</refsection>
- <refsection>
- <title>Funções Utilizadas</title>
- <para>As rotinas associadas podem ser encontradas no diretório
+ <refsection role="references">
+ <title>Funções Utilizadas</title>
+ <para>As rotinas associadas podem ser encontradas no diretório
SCI/modules/differential_equations/src/fortran:
</para>
<para>lsode.f lsoda.f lsodar.f</para>
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* ...
- *
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
* 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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode_optional_output" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode_optional_output" xml:lang="pt">
<refnamediv>
<refname>ode_optional_output</refname>
- <refpurpose>descrição de saídas opcionais de solucionadores de
+ <refpurpose>descrição de saídas opcionais de solucionadores de
EDOs
</refpurpose>
</refnamediv>
<refsection>
- <title>Descrição</title>
- <para>Esta página descreve os valores mais importantes retornados nos
- argumento opcionais do lado esquerdo da função <link linkend="ode">ode</link> <literal>w</literal> e <literal>iw</literal>. São
- válidos apenas para os solucionadores de EDOs <literal>lsode</literal>,
+ <title>Descrição</title>
+ <para>Esta página descreve os valores mais importantes retornados nos
+ argumento opcionais do lado esquerdo da função <link linkend="ode">ode</link> <literal>w</literal> e <literal>iw</literal>. São
+ válidos apenas para os solucionadores de EDOs <literal>lsode</literal>,
<literal>lsoda</literal> e <literal>lsodar</literal>. Para mais detalhes,
- pode se consultar os comentários dos códigos das subrotinas FORTRAN
+ pode se consultar os comentários dos códigos das subrotinas FORTRAN
<literal>SCI/modules/differential_equations/src/fortran/lsod*.f</literal>.
</para>
<variablelist>
<varlistentry>
+ <term>w(1:10)</term>
+ <listitem>
+ <para>Not supported. See the discussion <ulink url="http://bugzilla.scilab.org/2104#c2">there</ulink>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>w(11)</term>
<listitem>
- <para>último tamanho do passo em t utilizado
+ <para>último tamanho do passo em t utilizado
(sucessivamente).
</para>
</listitem>
<varlistentry>
<term>w(12)</term>
<listitem>
- <para>o tamanho do passo a ser tentado no próximo passo </para>
+ <para>o tamanho do passo a ser tentado no próximo passo </para>
</listitem>
</varlistentry>
<varlistentry>
<term>w(13)</term>
<listitem>
- <para>o valor corrente da variável independente alcançado pelo
- solucionador, i.e. o ponto de malha interno t corrente. Ná saída,
- tcur sempre estará pelo menos tão longe quanto o argumento t, mas
- pode estar mais longe (se foi realizada interpolação).
+ <para>o valor corrente da variável independente alcançado pelo
+ solucionador, i.e. o ponto de malha interno t corrente. Ná saída,
+ tcur sempre estará pelo menos tão longe quanto o argumento t, mas
+ pode estar mais longe (se foi realizada interpolação).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>w(14)</term>
<listitem>
- <para>um fator de escala de tolerância, maior que 1.0, computado
- quando se detecta requerer muita precisão (istate = -3 se detectado
- no início do problema, istate = -2, em caso contrário). Se itol for
+ <para>um fator de escala de tolerância, maior que 1.0, computado
+ quando se detecta requerer muita precisão (istate = -3 se detectado
+ no início do problema, istate = -2, em caso contrário). Se itol for
inalterado, mas rtol e atol forem uniformemente escalados por um
- fator de <literal>tolsf=w(14)</literal> para a próxima chamada,
- emtão supõe-se que o solucionador pode continuar. (o usuário também
- pode ignorar <literal>tolsf</literal> e alterar os parâmetros de
- tolerância de qualquer outro modo apropriado.)
+ fator de <literal>tolsf=w(14)</literal> para a próxima chamada,
+ emtão supõe-se que o solucionador pode continuar. (o usuário também
+ pode ignorar <literal>tolsf</literal> e alterar os parâmetros de
+ tolerância de qualquer outro modo apropriado.)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>w(15)</term>
<listitem>
- <para>o valor de t no tempo da última alternação de método, se
- houver. Este valor não é significante com o solucionador
+ <para>o valor de t no tempo da última alternação de método, se
+ houver. Este valor não é significante com o solucionador
<literal>lsode</literal>.
</para>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iw(1:9)</term>
+ <listitem>
+ <para>Not supported. See the discussion <ulink url="http://bugzilla.scilab.org/2104#c2">there</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(10)</term>
<listitem>
<para>
- o número de avaliações de <literal>g</literal> para problema
- até então. Este valor é significante apenas para o solucionador
+ o número de avaliações de <literal>g</literal> para problema
+ até então. Este valor é significante apenas para o solucionador
<literal>lsodar</literal>.
</para>
</listitem>
<varlistentry>
<term>iw(11)</term>
<listitem>
- <para>o número de passos tomados para o problema até então</para>
+ <para>o número de passos tomados para o problema até então</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(12)</term>
<listitem>
- <para>o número de avaliações de f até então</para>
+ <para>o número de avaliações de f até então</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(13)</term>
<listitem>
- <para>o número de avaliações do jacobiano (e de decomposições lu da
- matriz) para o problema até então.
+ <para>o número de avaliações do jacobiano (e de decomposições lu da
+ matriz) para o problema até então.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(14)</term>
<listitem>
- <para>a última ordem do método utilizada (sucessivamente).</para>
+ <para>a última ordem do método utilizada (sucessivamente).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(15)</term>
<listitem>
- <para>a ordem a ser tentada no próximo passo</para>
+ <para>a ordem a ser tentada no próximo passo</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(16)</term>
<listitem>
- <para>o índice do componente de maior magnitude no vetor de erro
+ <para>o índice do componente de maior magnitude no vetor de erro
local ponderado ( e(i)/ewt(i) ), sobre um erro, retorna istate = -4
or -5.
</para>
<para>
o comprimento de <literal>w</literal> realmente requerido,
supondo que o comprimento de rwork deve ser fixado para o resto do
- problema, e que a alternância pode ocorrer. Isto é definido sobre
+ problema, e que a alternância pode ocorrer. Isto é definido sobre
retornos normais e sobre um retorno de entrada ilegal para
armazenamento insuficiente.
</para>
<para>
o comprimento de <literal>iw</literal> realmente requerido,
supondo que o comprimento de <literal>iw</literal> deve ser fixado
- pelo resto do problema, e que a alternância pode ocorrer. Isto é
+ pelo resto do problema, e que a alternância pode ocorrer. Isto é
definido sobre retornos normais e sobre um retorno de entrada ilegal
para armazenamento insuficiente.
</para>
<varlistentry>
<term>iw(19)</term>
<listitem>
- <para>o indicador do método para o último passo realizado com
+ <para>o indicador do método para o último passo realizado com
sucesso. 1 significa adams (nonstiff), 2 significa bdf (stiff). Este
- valor não é significante com o solucionador
+ valor não é significante com o solucionador
<literal>lsode</literal>.
</para>
</listitem>
<varlistentry>
<term>iw(20)</term>
<listitem>
- <para>o indicador do método corrente. 1 significa adams (nonstiff),
- 2 significa bdf (stiff). Este é o método a ser tentado no próximo
+ <para>o indicador do método corrente. 1 significa adams (nonstiff),
+ 2 significa bdf (stiff). Este é o método a ser tentado no próximo
passo. Logo, difere de <literal>iw(19)</literal> apenas se uma
- alternância de métodos foi realizada. Este valor não é significante
+ alternância de métodos foi realizada. Este valor não é significante
com o solucionador <literal>lsode</literal>.
</para>
</listitem>
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* ...
- *
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
* 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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode_root" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ode_root" xml:lang="pt">
<refnamediv>
<refname>ode_root</refname>
- <refpurpose>solucionador de EDOs com busca de raízes</refpurpose>
+ <refpurpose>solucionador de EDOs com busca de raízes</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <title>Seqüência de Chamamento</title>
+ <title>Seqüência de Chamamento</title>
<synopsis>[y,rd,w,iw]=ode("root",y0,t0,t [,rtol [,atol]],f [,jac],ng,g [,w,iw])</synopsis>
</refsynopsisdiv>
- <refsection>
- <title>Parâmemtros</title>
+ <refsection role="parameters">
+ <title>Parâmemtros</title>
<variablelist>
<varlistentry>
<term>y0</term>
<listitem>
- <para>vetor de reais ou matriz (condições iniciais)</para>
+ <para>vetor de reais ou matriz (condições iniciais)</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>t</term>
<listitem>
- <para>vetor de reais (tempos nos quais a solução é
+ <para>vetor de reais (tempos nos quais a solução é
computada).
</para>
</listitem>
<varlistentry>
<term>f</term>
<listitem>
- <para>função externa i.e. função, string ou lista.</para>
+ <para>função externa i.e. função, string ou lista.</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>jac</term>
<listitem>
- <para>função externa i.e. função, string ou lista.</para>
+ <para>função externa i.e. função, string ou lista.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>w, iw</term>
+ <term>ng</term>
<listitem>
- <para>vetores de reais</para>
+ <para>inteiros.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>ng</term>
+ <term>g</term>
<listitem>
- <para>inteiros.</para>
+ <para>função externa i.e. função, string ou lista.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>g</term>
+ <term>y</term>
+ <listitem>
+ <para>a real vector or matrix. The solution.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rd</term>
+ <listitem>
+ <para>a real vector.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
<listitem>
- <para>função externa i.e. função, string ou lista.</para>
+ <para>vetores de reais.
+ See <link linkend="ode_optional_output">ode() optional output</link>
+ </para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
- <refsection>
- <title>Descrição</title>
+ <refsection role="description">
+ <title>Descrição</title>
<para>Com esta sintaxe (primeiro argumento igual a
- <literal>"root"</literal>) <literal>ode</literal> computa a solução da EDO
- <literal>dy/dt=f(t,y)</literal> até que o estado <literal>y(t)</literal>
- cruze a superfície <literal>g(t,y)=0</literal>.
+ <literal>"root"</literal>) <literal>ode</literal> computa a solução da EDO
+ <literal>dy/dt=f(t,y)</literal> até que o estado <literal>y(t)</literal>
+ cruze a superfície <literal>g(t,y)=0</literal>.
</para>
<para>
- <literal>g</literal> deve fornecer a equação da superfície. É uma
- função externa, i.e. uma função com sintaxe especificada, ou o nome de uma
- subrotina FORTRAN ou função C (string) com seqüência de chamamento
+ <literal>g</literal> deve fornecer a equação da superfície. É uma
+ função externa, i.e. uma função com sintaxe especificada, ou o nome de uma
+ subrotina FORTRAN ou função C (string) com seqüência de chamamento
especificada ou uma lista.
</para>
<para>
- Se <literal>g</literal> é uma função, a sintaxe deve ser como
+ Se <literal>g</literal> é uma função, a sintaxe deve ser como
segue:
</para>
- <programlisting role="no-scilab-exec"><![CDATA[
+ <programlisting role="no-scilab-exec"><![CDATA[
z=g(t,y)
]]></programlisting>
<para>
- onde <literal>t</literal> é um escalar real (tempo) e
+ onde <literal>t</literal> é um escalar real (tempo) e
<literal>y</literal> um vetor de reais (estado). Ela retorna um vetor de
- tamanho <literal>ng</literal> que corresponde às <literal>ng</literal>
- restrições. Se <literal>g</literal> é um string, ele se refere a uma
- subrotina FORTRAN ou uma função C, com a seguinte seqüência de chamamento:
- <literal>g(n,t,y,ng,gout)</literal> onde <literal>ng</literal> é o número
- de restrições e <literal>gout</literal> é o valor de <literal>g</literal>
- (saída do programa). Se <literal>g</literal> é uma lista, as mesmas
- convenções para <literal>f</literal> se aplicam (ver ajuda de <link linkend="ode">ode</link>).
+ tamanho <literal>ng</literal> que corresponde às <literal>ng</literal>
+ restrições. Se <literal>g</literal> é um string, ele se refere a uma
+ subrotina FORTRAN ou uma função C, com a seguinte seqüência de chamamento:
+ <literal>g(n,t,y,ng,gout)</literal> onde <literal>ng</literal> é o número
+ de restrições e <literal>gout</literal> é o valor de <literal>g</literal>
+ (saída do programa). Se <literal>g</literal> é uma lista, as mesmas
+ convenções para <literal>f</literal> se aplicam (ver ajuda de <link linkend="ode">ode</link>).
</para>
<para>
- A saída <literal>rd</literal> é um vetor <literal>1 x k</literal> .
- A primeira entrada contém o tempo de parada. Outras entradas indicam que
+ A saída <literal>rd</literal> é um vetor <literal>1 x k</literal> .
+ A primeira entrada contém o tempo de parada. Outras entradas indicam que
componentes de <literal>g</literal> possuem sinal trocado.
- <literal>k</literal> maior que 2 indica que mais de uma superfície
- (<literal>(k-1)</literal> superfícies) foram simultaneamente
+ <literal>k</literal> maior que 2 indica que mais de uma superfície
+ (<literal>(k-1)</literal> superfícies) foram simultaneamente
atravessadas.
</para>
- <para>Outros argumentos e opções são os mesmos que para
- <literal>ode</literal>, ver a página de ajuda de <link linkend="ode">ode</link>.
+ <para>Outros argumentos e opções são os mesmos que para
+ <literal>ode</literal>, ver a página de ajuda de <link linkend="ode">ode</link>.
</para>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Exemplos</title>
- <programlisting role="example"><![CDATA[
-// Integração da equação diferencial
-// dy/dt=y , y(0)=1, e acha o tempo mínimo t tal que y(t)=2
+ <programlisting role="example"><![CDATA[
+// Integração da equação diferencial
+// dy/dt=y , y(0)=1, e acha o tempo mínimo t tal que y(t)=2
deff("[ydot]=f(t,y)","ydot=y")
deff("[z]=g(t,y)","z=y-2")
y0=1;ng=1;
]]></programlisting>
</refsection>
<refsection role="see also">
- <title>Ver Também</title>
+ <title>Ver Também</title>
<simplelist type="inline">
<member>
+ <link linkend="ode">ode</link>
+ </member>
+ <member>
+ <link linkend="ode_optional_output">ode_optional_output</link>
+ </member>
+ <member>
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
<link linkend="dasrt">dasrt</link>
</member>
<member>
- <link linkend="ode">ode</link>
+ <link linkend="daskr">daskr</link>
</member>
</simplelist>
</refsection>
* Copyright (C) 2008 - INRIA
* Copyright (C) 2011 - DIGITEO - Michael Baudin
* Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+ * Copyright (C) 2016 - Samuel GOUGEON
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
y = ode("discrete", y0, k0, kvect, f)
</synopsis>
</refsynopsisdiv>
- <refsection>
+ <refsection role="parameters">
<title>Аргументы</title>
<variablelist>
<varlistentry>
<listitem>
<para>
строка, тип используемой программы решения. Имеются следующие типы
- программ решения: <literal>"adams"</literal>,
+ программ решения: <literal>"adams"</literal>,
<literal>"stiff"</literal>, <literal>"rk"</literal>,
<literal>"rkf"</literal>, <literal>"fix"</literal>,
<literal>"discrete"</literal>, <literal>"roots"</literal>.
</listitem>
</varlistentry>
<varlistentry>
- <term>rtol</term>
- <listitem>
- <para>
- вещественная константа либо вещественный вектор того же размера,
- что и <varname>y</varname>, относительный допуск.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>atol</term>
+ <term>atol, rtol</term>
<listitem>
<para>
- вещественная константа либо вещественный вектор того же размера,
- что и <varname>y</varname>, абсолютный допуск.
+ absolute and relative tolerances on the final solution
+ <varname>y</varname> (decimal numbers). If each is a
+ single value, it applies
+ to each component of <varname>y</varname>. Otherwise,
+ it must be a vector of same size as size(y), and
+ is applied element-wise to <varname>y</varname>.
</para>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>w, iw</term>
- <listitem>
- <para>вещественные векторы (ВХОДНЫЕ/ВЫХОДНЫЕ).</para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term>ng</term>
<listitem>
<para>целое число.</para>
<para>вещественный вектор (ВЫХОДНОЙ).</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>вещественные векторы (ВХОДНЫЕ/ВЫХОДНЫЕ).
+ See <link linkend="ode_optional_output">ode() optional output</link>
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="description">
<title>Описание</title>
<para>
<function>ode</function> решает явные обыкновенные
</varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Примеры</title>
<para>
В следующем примере мы решим обыкновенное дифференциальное уравнение
</para>
<programlisting role="example"><![CDATA[
function ydot=f(t,y)
- ydot=y^2-y*sin(t)+cos(t)
+ ydot=y^2-y*sin(t)+cos(t)
endfunction
y0=0;
t0=0;
<title>Смотрите также</title>
<simplelist type="inline">
<member>
- <link linkend="ode_discrete">ode_discrete</link>
+ <link linkend="odeoptions">odeoptions</link>
+ </member>
+ <member>
+ <link linkend="ode_optional_output">ode_optional_output</link>
</member>
<member>
<link linkend="ode_root">ode_root</link>
</member>
<member>
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
<link linkend="dassl">dassl</link>
</member>
<member>
<link linkend="odedc">odedc</link>
</member>
<member>
- <link linkend="odeoptions">odeoptions</link>
- </member>
- <member>
<link linkend="csim">csim</link>
</member>
<member>
</member>
</simplelist>
</refsection>
- <refsection>
+ <refsection role="bibliography">
<title>Литература</title>
<para>
Alan C. Hindmarsh, "lsode and lsodi, two new initial value ordinary
(1980), pp. 10-11.
</para>
</refsection>
- <refsection>
+ <refsection role="references">
<title>Используемые функции</title>
<para>
Связанные процедуры могут быть найдены в директории
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* ...
- *
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
описание необязательных выходных данных программы решения ОДУ
</refpurpose>
</refnamediv>
- <refsection>
+ <refsection role="parameters">
<title>Описание</title>
<para>
- Эта страница описывает большинство важных значений, возвращаемых в необязательных
- аргументах левой части <link linkend="ode">ОДУ</link> <literal>w</literal> и
- <literal>iw</literal>. Они корректны только для программы решения ОДУ
- <literal>lsode</literal>, <literal>lsoda</literal> и <literal>lsodar</literal>. Больше
- подробностей можно узнать в комментариях к fortran-коду программы решения в
+ Эта страница описывает большинство важных значений, возвращаемых в необязательных
+ аргументах левой части <link linkend="ode">ОДУ</link> <literal>w</literal> и
+ <literal>iw</literal>. Они корректны только для программы решения ОДУ
+ <literal>lsode</literal>, <literal>lsoda</literal> и <literal>lsodar</literal>. Больше
+ подробностей можно узнать в комментариях к fortran-коду программы решения в
<literal>SCI/modules/differential_equations/src/fortran/lsod*.f</literal>.
</para>
<variablelist>
<varlistentry>
+ <term>w(1:10)</term>
+ <listitem>
+ <para>Not supported. See the discussion <ulink url="http://bugzilla.scilab.org/2104#c2">there</ulink>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>w(11)</term>
<listitem>
<para> размер шага в последнее используемое t (успешно).</para>
<varlistentry>
<term>w(13)</term>
<listitem>
- <para>
- текущее значение независимой переменной, которое программа решения фактически
- достигла, то есть текущая внутренняя точка сетки в t. На выходе tcur будет всегда по
- меньшей мере до аргумента t, но может быть и дальше (если была сделана
+ <para>
+ текущее значение независимой переменной, которое программа решения фактически
+ достигла, то есть текущая внутренняя точка сетки в t. На выходе tcur будет всегда по
+ меньшей мере до аргумента t, но может быть и дальше (если была сделана
интерполяция).
</para>
</listitem>
<term>w(14)</term>
<listitem>
<para>
- масштабный коэффициент допуска более 1.0, вычисленный, когда был обнаружен
- запрос на гораздо бОльшую точность (istate = -3, если обнаружено в начале задачи, в
- противном случае istate = -2). Если itol оставлена неизменной, а rtol и atol одинаково
- увеличены на коэффициент <literal>tolsf=w(14)</literal> для следующего вызова, то
- считается, что программа решения достигла цели. (Пользователь может также
- игнорировать <literal>tolsf</literal> и менять параметры допусков любым иным
+ масштабный коэффициент допуска более 1.0, вычисленный, когда был обнаружен
+ запрос на гораздо бОльшую точность (istate = -3, если обнаружено в начале задачи, в
+ противном случае istate = -2). Если itol оставлена неизменной, а rtol и atol одинаково
+ увеличены на коэффициент <literal>tolsf=w(14)</literal> для следующего вызова, то
+ считается, что программа решения достигла цели. (Пользователь может также
+ игнорировать <literal>tolsf</literal> и менять параметры допусков любым иным
подходящим способом.)
</para>
</listitem>
<term>w(15)</term>
<listitem>
<para>
- значение t в момент времени переключения последнего метода, если оно было. Эта
- величина не важна с программой решения <literal>lsode</literal>.
+ значение t в момент времени переключения последнего метода, если оно было. Эта
+ величина не важна с программой решения <literal>lsode</literal>.
</para>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iw(1:9)</term>
+ <listitem>
+ <para>Not supported. See the discussion <ulink url="http://bugzilla.scilab.org/2104#c2">there</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>iw(10)</term>
<listitem>
- <para>
+ <para>
количество вычислений <literal>g</literal> для задачи на данное время. Это значение важно только для программы решения <literal>lsodar</literal>.
</para>
</listitem>
<varlistentry>
<term>iw(11)</term>
<listitem>
- <para>
+ <para>
количество шагов, выполненных на данный момент для задачи.
</para>
</listitem>
<varlistentry>
<term>iw(12)</term>
<listitem>
- <para>
+ <para>
количество вычислений f для задачи на данный момент.
</para>
</listitem>
<varlistentry>
<term>iw(13)</term>
<listitem>
- <para>
- количество вычислений якобиана (и LU-разложения матрицы) для задачи на текущий
+ <para>
+ количество вычислений якобиана (и LU-разложения матрицы) для задачи на текущий
момент.
</para>
</listitem>
<term>iw(16)</term>
<listitem>
<para>
- индекс элемента с наибольшей амплитудой в векторе взвешенной местной ошибки
+ индекс элемента с наибольшей амплитудой в векторе взвешенной местной ошибки
( e(i)/ewt(i) ), на возврат ошибки с istate = -4 или -5.
</para>
</listitem>
<varlistentry>
<term>iw(17)</term>
<listitem>
- <para>
- фактически требуемая длина <literal>w</literal> в предположении, что длина rwork
- будет фиксирована для остатка задачи, и что может произойти переключение. Это
- определяется на нормальных возвратах и на некорректном вводе возврата для
+ <para>
+ фактически требуемая длина <literal>w</literal> в предположении, что длина rwork
+ будет фиксирована для остатка задачи, и что может произойти переключение. Это
+ определяется на нормальных возвратах и на некорректном вводе возврата для
неполного хранения.
</para>
</listitem>
<varlistentry>
<term>iw(18)</term>
<listitem>
- <para>
+ <para>
фактически требуемая длина <literal>iw</literal> в предположении, что длина <literal>iw</literal> будет фиксирована для остатка задачи, и что может произойти переключение. Это определяется на нормальных возвратах и на некорректном вводе возврата для неполного хранения.
</para>
</listitem>
<varlistentry>
<term>iw(19)</term>
<listitem>
- <para>
- индикатор метода для последнего успешного шага. 1 означает adams (нежёсткий), 2
+ <para>
+ индикатор метода для последнего успешного шага. 1 означает adams (нежёсткий), 2
означает bdf (жёсткий). Это значение не важно для программы решения
<literal>lsode</literal>.
</para>
<varlistentry>
<term>iw(20)</term>
<listitem>
- <para>
- индикатор текущего метода. 1 означает adams (нежёсткий), 2
- означает bdf (жёсткий). Это метод, который предпримут на следующем шаге. Таким
- образом, он отличается от <literal>iw(19)</literal> только если переключение метода
- было сделано только что. Это значение не важно для программы решения
+ <para>
+ индикатор текущего метода. 1 означает adams (нежёсткий), 2
+ означает bdf (жёсткий). Это метод, который предпримут на следующем шаге. Таким
+ образом, он отличается от <literal>iw(19)</literal> только если переключение метода
+ было сделано только что. Это значение не важно для программы решения
<literal>lsode</literal>.
</para>
</listitem>
* Copyright (C) 2008 - INRIA
* Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
* ...
-*
+*
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
<title>Последовательность вызова</title>
<synopsis>[y, rd, w, iw] = ode("root", y0, t0, t [,rtol [,atol]], f [,jac], ng, g [,w, iw])</synopsis>
</refsynopsisdiv>
- <refsection>
+ <refsection role="parameters">
<title>Аргументы</title>
<variablelist>
<varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>w, iw</term>
- <listitem>
- <para>
- векторы вещественных значений (ВХОДНЫЕ/ВЫХОДНЫЕ).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term>ng</term>
<listitem>
<para>целое число.</para>
<para>вещественный вектор (ВЫХОДНОЙ).</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>w, iw</term>
+ <listitem>
+ <para>
+ векторы вещественных значений.
+ See <link linkend="ode_optional_output">ode() optional output</link>
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="description">
<title>Описание</title>
<para>
С таким синтаксисом (первый аргумент равен <literal>"root"</literal>) <literal>ode</literal> вычисляет решение дифференциального уравнения <literal>dy/dt=f(t,y)</literal> до тех пор, пока состояние <literal>y(t)</literal> не пересечёт поверхность <literal>g(t,y)=0</literal>.
<para>
Если <literal>g</literal> является функцией, то её синтаксис должен быть следующим:
</para>
- <programlisting role="no-scilab-exec"><![CDATA[
+ <programlisting role="no-scilab-exec"><![CDATA[
z = g(t,y)
]]></programlisting>
<para>
Другие аргументы и другие опции те же самые, что и для <literal>ode</literal>, см. справку по <link linkend="ode">ode</link>.
</para>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Примеры</title>
- <programlisting role="example"><![CDATA[
+ <programlisting role="example"><![CDATA[
// Интегрирование дифференциального уравнения
// dy/dt=y , y(0)=1, и поиск такого минимального времени t, что y(t)=2
deff("[ydot]=f(t,y)","ydot=y")
deff("[z]=g(t,y)","z=y-2")
y0=1;ng=1;
[y,rd]=ode("roots",y0,0,2,f,ng,g)
-
+
deff("[z]=g(t,y)","z=y-[2;2;33]")
[y,rd]=ode("roots",1,0,2,f,3,g)
]]></programlisting>
<title>Смотрите также</title>
<simplelist type="inline">
<member>
+ <link linkend="ode">ode</link>
+ </member>
+ <member>
+ <link linkend="ode_optional_output">ode_optional_output</link>
+ </member>
+ <member>
+ <link linkend="ode_discrete">ode_discrete</link>
+ </member>
+ <member>
<link linkend="dasrt">dasrt</link>
</member>
<member>
- <link linkend="ode">ode</link>
+ <link linkend="daskr">daskr</link>
</member>
</simplelist>
</refsection>
<link linkend="intersect">intersect</link>
</member>
<member>
+ <link linkend="grep">grep</link>
+ </member>
+ <member>
<link linkend="find">find</link>
</member>
<member>
<link linkend="intersect">intersect</link>
</member>
<member>
+ <link linkend="grep">grep</link>
+ </member>
+ <member>
<link linkend="find">find</link>
</member>
<member>
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2013 - Samuel GOUGEON
* 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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="members" xml:lang="ja">
-
<refnamediv>
-
<refname>members</refname>
-
<refpurpose>
-
配列の各要素または他の配列の行または列を数える(及び位置を調べる)
-
</refpurpose>
-
</refnamediv>
-
<refsynopsisdiv>
-
<title>呼び出し手順</title>
-
<synopsis>
-
[nb [,loc]] = members(N, H)
-
[nb [,loc]] = members(N, H, "last")
-
[nb [,loc]] = members(N, H, "rows"|"cols")
-
[nb [,loc]] = members(N, H, "rows"|"cols", "last")
-
[nb [,loc]] = members(N, H, "rows"|"cols", "shuffle")
-
[nb [,loc]] = members(N, H, "rows"|"cols", "shuffle", "last")
-
</synopsis>
-
</refsynopsisdiv>
-
<refsection>
-
<title>引数</title>
-
<variablelist>
-
<varlistentry>
-
<term>N</term>
-
<listitem>
-
<para>
-
Needles: 論理値, 整数エンコードされた数値, 実数または複素数の10進数, 多項式またはテキストの行列またはハイパー行列.
-
"rows"または"cols"モードでは,
-
ハイパー行列は指定できません.
-
指定した値(または行または列)は<literal>N</literal>の中に
-
複数回配置することができます.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>H</term>
-
<listitem>
-
<para>
-
- Haystack:
-
- <literal>N</literal>と同じデータ型の行列またはハイパー行列.
-
+ Haystack:
+ <literal>N</literal>と同じデータ型の行列またはハイパー行列.
"rows" または "cols" モードの場合, ハイパー行列は指定できません.
-
<literal>N</literal> および <literal>H</literal>
-
はそれぞれ同じ列または行の数を有する必要があります.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>オプション:</term>
-
<listitem>
-
<para>以下の1から3個のオプションを順を問わず指定可能です:
-
<variablelist>
-
<varlistentry>
-
<term>"last"</term>
-
<listitem>
-
<para>
-
<literal>N</literal>から
-
needlesの<literal>H</literal>の位置を<literal>loc</literal>で
-
検索した場合,
-
デフォルトで<literal>H</literal>の中でそれぞれが最初に現れる位置が返されます.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"rows", "cols"</term>
-
<listitem>
-
<para>
-
デフォルトで, <literal>N</literal>の各要素<literal>N(i, j, ...)</literal>
-
は <literal>H</literal>の中で検索する際のneedleとみなされます.
-
- <literal>"rows"</literal> が検索された場合,
-
+ <literal>"rows"</literal> が検索された場合,
<literal>N</literal>の各行はneedleとみなされ, 全体として,
-
<literal>H</literal>の行で検索が行われます.
-
<literal>"cols"</literal> が使用された場合,
-
<literal>"cols"</literal>が
-
<literal>N</literal> 及び <literal>H</literal>の列に適用されます.
-
<literal>"cols"</literal> を使用した場合,
-
<literal>N</literal> 及び <literal>H</literal> の列数と同じ部分に
-
適用されます.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>"shuffle"</term>
-
<listitem>
-
<para>
-
- <literal>"rows"</literal>または<literal>"cols"</literal> モードの場合,
-
+ <literal>"rows"</literal>または<literal>"cols"</literal> モードの場合,
行/列の要素のデフォルトの順序が考慮されます: 例えば,<literal>N</literal>
-
- の <literal>[ 7 3 5 ]</literal> は,
-
+ の <literal>[ 7 3 5 ]</literal> は,
<literal>H</literal>の<literal>[3 5 7]</literal>にマッチしません.
-
- <literal>"shuffle"</literal> が指定された場合,
-
+ <literal>"shuffle"</literal> が指定された場合,
例えば<literal>[3 5 7]</literal>の交換は
-
<literal>N</literal>の<literal>[3 5 7]</literal>行に一致すると
-
みなされます.
-
このオプションは多項式の場合,無視されます.
-
</para>
-
</listitem>
-
</varlistentry>
-
</variablelist>
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>nb</term>
-
<listitem>
-
<para>
-
通常モードの場合: <literal>nb(i, j, ...)</literal> は(実数として)
-
<literal>H</literal>における<literal>N(i, j, ...)</literal>の出現回数
-
を表します.
-
- <literal>nb</literal> および <literal>N</literal> は同じ形式です.
-
- <literal>H</literal> が空の場合, ゼロ行列が返されます.
-
+ <literal>nb</literal> および <literal>N</literal> は同じ形式です.
+ <literal>H</literal> が空の場合, ゼロ行列が返されます.
<literal>N</literal> が空の場合, 空の行列 <literal>[]</literal> が返されます.
-
</para>
-
<para>
-
- <literal>"rows"</literal> または <literal>"cols"</literal> モードの場合:
-
+ <literal>"rows"</literal> または <literal>"cols"</literal> モードの場合:
<literal>nb</literal> は <literal>N</literal> が有する行/列と同じ数の要素を
-
- 有する実数の行です.
-
+ 有する実数の行です.
<literal>nb(i)</literal> は,<literal>H(., :)</literal> の中で
-
<literal>N(i, :)</literal> が生じた数
-
(または<literal>H(:, .)</literal>の中で<literal>N(:, i)</literal>)を返します.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>loc</term>
-
<listitem>
-
<para>
-
- 通常のモードの場合:
-
- <literal>loc</literal> および<literal>N</literal> は同じ形式を有します.
-
+ 通常のモードの場合:
+ <literal>loc</literal> および<literal>N</literal> は同じ形式を有します.
<literal>loc(i, j, ...)</literal> は,
-
<literal>N(i, j, ...)</literal> がある場所として
-
<literal>H</literal>に最小の線形化された添字を返します.
-
<literal>"last"</literal>フラグが使用された場合,
-
替りに最大の線形化された添字の最大値が返されます.
-
<literal>H</literal>の中に <literal>N(i, j, ...)</literal>が見つかれない場合,
-
<literal>loc(i, j, ...)</literal> は <literal>0</literal>に設定されます.
-
</para>
-
<para>
-
- <literal>"rows"</literal> または <literal>"cols"</literal> モードの場合:
-
+ <literal>"rows"</literal> または <literal>"cols"</literal> モードの場合:
<literal>loc</literal> は<literal>N</literal>が有する行及び列と同じ
-
数の要素を有する実数の行です.
-
<literal>loc(i)</literal> は,
-
<literal>N(i, :)</literal>に一致する最初の
-
行<literal>H(loc(i), :)</literal>の添字
-
(または <literal>N(:, i)</literal>に一致する最初の列
-
<literal>H(:, loc(i))</literal> の添字)を返します.
-
<literal>"shuffle"</literal>フラグが追加で指定された場合,
-
行/列に基づく要素の順番は考慮されません.
-
</para>
-
</listitem>
-
</varlistentry>
-
</variablelist>
-
</refsection>
-
<refsection>
-
<title>説明</title>
-
<para>
-
- <literal>nb = members(N, H [,"rows"|"cols"])</literal>
-
+ <literal>nb = members(N, H [,"rows"|"cols"])</literal>
は各要素または<literal>H</literal>の中にある
-
<literal>N</literal>の行または列の発生回数を返します.
-
要素が見つからない場合, 0 が返されます.
-
<literal>N(i,j,...)</literal>が現れる最初(デフォルト)または
-
<literal>"last"</literal>(最後)の<literal>H</literal>の添字を,
-
2番目のオプションの出力<literal>loc</literal>により取得できます.
-
- <literal>"rows"</literal> または <literal>"cols"</literal>
-
+ <literal>"rows"</literal> または <literal>"cols"</literal>
の一致するものを探す場合,
-
オプション<literal>"shuffle"</literal>を使用することにより,
-
一致の際の要素の順番を無視することができます.
-
</para>
-
<para>
-
- 値 <literal>%inf</literal> および <literal>-%inf</literal>
-
+ 値 <literal>%inf</literal> および <literal>-%inf</literal>
を<literal>N</literal>の中および<literal>H</literal>の中で
-
使用することができます.
-
ノーマルモードでは,
-
<literal>%nan</literal>が<literal>N</literal>の中では
-
- サポートされますが,<literal>H</literal>の中ではサポートされません.
-
- <literal>"rows"</literal> または <literal>"cols"</literal> モードの場合,
-
+ サポートされますが,<literal>H</literal>の中ではサポートされません.
+ <literal>"rows"</literal> または <literal>"cols"</literal> モードの場合,
<literal>%nan</literal> はどこでもサポートされます.
-
</para>
-
<para>
-
通常の要素毎のモードの場合, members(..) は,
-
論理値,
-
整数エンコードされた数値(8-16-32ビット長の符号ありまたは無し)
-
および実数を高速に処理するために
-
<link linkend="dsearch">dsearch(..)</link> を使用します.
-
計算時間が長い場合, 進行状況の棒グラフが表示されます.
-
</para>
-
</refsection>
-
<refsection>
-
<title>例</title>
-
<programlisting role="example"><![CDATA[
N = [1 8 4 5 2 1];
H = [9 7 4 2 1 4];
+
[nb, loc] = members(N, H, "last")
// nb = [1 0 2 0 1 1] を返す: 例えば, Hの中に4が2回現れる.
// そして loc = [5 0 6 0 4 5]: 4が最後に現れるのはHの6番目の位置
+
[nb, loc] = members(N, H)
// loc = [5 0 3 0 4 5]を返す: 4が最初に現れるのはHの3番目の位置
+
// ハイパー行列の場合. 前記の N 及び Hを利用:
N = matrix(N, [3 1 2]);
H = matrix(H, [3 1 2]);
[nb, loc] = members(N, H, "last")
+
// 整数の場合:
N = int8(grand(3, 2, "uin", -5, 5));
H = int8(grand(4, 4, "uin", -5, 5));
[nb, loc] = members(N, H)
+
// 多項式の場合 (複素数の係数を指定可能):
z = %z;
N = [z (1-z)^2 ; -4 %i*z ];
H = [2 %i*z -z 3-z z z^3 z];
[nb, loc] = members(N, H)
+
// テキストの場合:
N = [ "Hi" "Hu" "Allo"];
H = [ "Hello" "Bonjour" "Allo"
"Holà" "Allo" "Hallo"
"Hi" "Hé" "Salud" ];
[nb, loc] = members(N, H, "last")
+
// 行の場合:
H = [
3 3 0
[nb, loc] = members(N, H, "rows")
[nb, loc] = members(N, H, "rows","last")
[nb, loc] = members(N, H, "rows","shuffle") // [4 1 0], [0 1 4] 及び [0 4 1] は同一とみなされる
-// 列の場合: 定義済みの N 及び H を利用:
+
+ // 列の場合: 定義済みの N 及び H を利用:
N = N.', H = H.'
[nb, loc] = members(N, H, "cols", "shuffle")
]]></programlisting>
-
</refsection>
-
<refsection role="see also">
-
<title>参照</title>
-
<simplelist type="inline">
-
<member>
-
<link linkend="dsearch">dsearch</link>
-
</member>
-
<member>
-
<link linkend="intersect">intersect</link>
-
</member>
-
<member>
-
+ <link linkend="grep">grep</link>
+ </member>
+ <member>
<link linkend="find">find</link>
-
</member>
-
<member>
-
<link linkend="vectorfind">vectorfind</link>
-
</member>
-
</simplelist>
-
</refsection>
-
<refsection>
-
<title>履歴</title>
-
<revhistory>
-
<revision>
-
<revnumber>5.5.0</revnumber>
-
<revremark>members() 関数が導入されました.</revremark>
-
</revision>
-
</revhistory>
-
</refsection>
-
</refentry>
-
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) DIGITEO - 2011 - Allan CORNET
- *
+ * Copyright (C) 2016 - Samuel GOUGEON
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
- <synopsis>xlabel([axis_handle], label, [property_name, property_value,...])</synopsis>
- <synopsis>ylabel([axis_handle], label, [property_name, property_value,...])</synopsis>
- <synopsis>zlabel([axis_handle], label, [property_name, property_value,...])</synopsis>
+ <synopsis>
+ xlabel([axes_handle], label, [property_name, property_value,...])
+ ylabel([axes_handle], label, [property_name, property_value,...])
+ zlabel([axes_handle], label, [property_name, property_value,...])
+ </synopsis>
</refsynopsisdiv>
- <refsection>
+ <refsection role="parameters">
<title>Arguments</title>
<variablelist>
<varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term>axis_handle</term>
+ <term>axes_handle</term>
<listitem>
<para>an optional handle, to specify the axes for which the label is set.</para>
</listitem>
</listitem>
<listitem>
<para>
- <literal>"fontsize"</literal>: size of font (constant)
+ <literal>"fontsize", "font_size"</literal>: size of font (constant)
</para>
</listitem>
<listitem>
<para>
- <literal>"fontname"</literal>: ten font names are available
+ <literal>"fontname", "font_style"</literal>: ten font names are available
(case unsensitive string or related id number):
- "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
- "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
+ "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
+ "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
"helvetica italic" | 7, "helvetica bold" | 8, "helvetica bold italic" | 9.
</para>
</listitem>
<listitem>
<para>
- <literal>"rotation"</literal>: angle in degrees (constant)
+ <literal>"rotation", "font_angle"</literal>: angle in degrees (constant)
</para>
</listitem>
<listitem>
</listitem>
<listitem>
<para>
- <literal>"color"</literal>: the color of font (a string value chosen among <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>, or a RGB matrix value)
+ <literal>"color", "font_foreground"</literal>:
+ the color of font (a string value chosen among
+ <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>,
+ or a RGB matrix value)
</para>
</listitem>
<listitem>
<para>
- <literal>"edgecolor"</literal>: the color of line around the text (a string value chosen among <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>, or a RGB matrix value)
+ <literal>"edgecolor", "foreground"</literal>:
+ the color of line around the text (a string value chosen among
+ <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>,
+ or a RGB matrix value)
</para>
</listitem>
<listitem>
<para>
- <literal>"background"</literal>: the color of background around the text (a string value chosen among <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>, or a RGB matrix value)
+ <literal>"backgroundcolor", "background"</literal>:
+ the color of background around the text (a string value chosen among
+ <literal>["red","green","blue","cyan","magenta","yellow","black","white"]</literal>,
+ or a RGB matrix value)
</para>
</listitem>
</itemizedlist>
</varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="description">
<title>Description</title>
<para>xlabel, ylabel, zlabel are used to label the x-, y-, and z-axis, respectively.
</para>
plot and to the side or beneath the axis in a three-dimensional plot.
</para>
</refsection>
- <refsection>
+ <refsection role="examples">
<title>Examples</title>
- <programlisting role="example">
- t = linspace(-2*%pi, 2*%pi, 30);
-
- subplot(2,1,1);
- plot(t, sin(t), "r");
- xlabel("t", "fontsize", 2);
- ylabel("sin(t)");
- axis1_handle = gca();
-
- subplot(2,1,2);
- plot(t, cos(t), "b");
- xlabel("t", "fontsize", 2);
- ylabel("cos(t)", "fontsize", 6, "color", "blue");
-
- ylabel(axis1_handle, "sin(t)", "fontsize", 6, "color", "red");
- </programlisting>
+ <programlisting role="example"><![CDATA[
+t = linspace(-2*%pi, 2*%pi, 30);
+
+subplot(2,1,1);
+plot(t, sin(t), "r");
+xlabel("t", "fontsize", 2);
+ylabel("sin(t)");
+axes_handle = gca();
+
+subplot(2,1,2);
+plot(t, cos(t), "b");
+xlabel("t", "fontsize", 2);
+ylabel("cos(t)", "fontsize", 6, "color", "blue");
+
+ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
+]]> </programlisting>
<scilab:image>
t = linspace(-2*%pi, 2*%pi, 50);
subplot(2,1,1);
plot(t, sin(t), "r");
xlabel("t", "fontsize", 2);
ylabel("sin(t)");
- axis1_handle = gca();
+ axes_handle = gca();
subplot(2,1,2);
plot(t, cos(t), "b");
xlabel("t", "fontsize", 2);
ylabel("cos(t)", "fontsize", 6, "color", "blue");
- ylabel(axis1_handle, "sin(t)", "fontsize", 6, "color", "red");
+ ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
</scilab:image>
</refsection>
<refsection role="see also">
<title>See Also</title>
<simplelist type="inline">
<member>
+ <link linkend="label_properties">label_properties</link>
+ </member>
+ <member>
+ <link linkend="xtitle">xtitle</link>
+ </member>
+ <member>
<link linkend="title">title</link>
</member>
</simplelist>
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
-
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-
* Copyright (C) DIGITEO - 2011 - Allan CORNET
-
- *
-
-
+ * Copyright (C) 2016 - Samuel GOUGEON
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
* 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:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="xlabel" xml:lang="ja">
-
<refnamediv>
-
<refname>xlabel</refname>
-
<refpurpose>x軸ラベルを付加する</refpurpose>
-
</refnamediv>
-
<refnamediv xml:id="ylabel">
-
<refname>ylabel</refname>
-
<refpurpose>y軸ラベルを付加する</refpurpose>
-
</refnamediv>
-
<refnamediv xml:id="zlabel">
-
<refname>zlabel</refname>
-
<refpurpose>z軸ラベルを付加する</refpurpose>
-
</refnamediv>
-
<refsynopsisdiv>
-
<title>呼び出し手順</title>
-
- <synopsis>xlabel([axis_handle], label, [property_name, property_value,...])</synopsis>
-
- <synopsis>ylabel([axis_handle], label, [property_name, property_value,...])</synopsis>
-
- <synopsis>zlabel([axis_handle], label, [property_name, property_value,...])</synopsis>
-
+ <synopsis>
+ xlabel([axes_handle], label, [property_name, property_value,...])
+ ylabel([axes_handle], label, [property_name, property_value,...])
+ zlabel([axes_handle], label, [property_name, property_value,...])
+ </synopsis>
</refsynopsisdiv>
-
- <refsection>
-
+ <refsection role="parameters">
<title>引数</title>
-
<variablelist>
-
<varlistentry>
-
<term>label</term>
-
<listitem>
-
<para>文字列, ラベルの値を有する</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
- <term>axis_handle</term>
-
+ <term>axes_handle</term>
<listitem>
-
<para>
-
オプションのハンドルで, ラベルを設定する軸を指定します.
-
</para>
-
</listitem>
-
</varlistentry>
-
<varlistentry>
-
<term>[property_name, property_value,...]</term>
-
<listitem>
-
<para>
-
オプションの名前-値の組の並びで,
-
(<link linkend="text_properties">ここ</link>に記述されたtextプロパティに関係する)
-
ラベルのtextプロパティを指定します.
-
</para>
-
<para>利用可能なx-y-zラベルのプロパティを以下に示します:
-
<itemizedlist>
-
<listitem>
-
<para>
-
<literal>"visible"</literal>: <literal>"on"</literal> または <literal>"off"</literal>
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
- <literal>"fontsize"</literal>: フォントの大きさ (定数)
-
+ <literal>"fontsize", "font_size"</literal>: フォントの大きさ (定数)
</para>
-
</listitem>
-
<listitem>
-
<para>
-
- <literal>"fontname"</literal>: 利用可能な10種類のフォント名
-
+ <literal>"fontname", "font_style"</literal>: 利用可能な10種類のフォント名
(大文字小文字を区別しない文字列または関係するid番号):
-
- "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
-
- "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
-
+ "courrier" | 0, "symbol" | 1, "times" | 2, "times italic" | 3,
+ "times bold" | 4, "times bold italic" | 5, "helvetica" | 6,
"helvetica italic" | 7, "helvetica bold" | 8, "helvetica bold italic" | 9.
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
- <literal>"rotation"</literal>: 角度 (単位:deg) (定数)
-
+ <literal>"rotation", "font_angle"</literal>: 角度 (単位:deg) (定数)
</para>
-
</listitem>
-
<listitem>
-
<para>
-
<literal>"position"</literal>: ラベルの位置 (2次元ベクトル)
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
- <literal>"color"</literal>: フォントの色
-
+ <literal>"color", "font_foreground"</literal>: フォントの色
(<literal>["red","green","blue","cyan","magenta","yellow",
-
"black","white"]
</literal>
,または RGB行列の値から選んだ文字列の値)
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
- <literal>"edgecolor"</literal>:
-
- テキスト周囲の線の色
-
+ <literal>"edgecolor", "foreground"</literal>:
+ テキスト周囲の線の色
(<literal>["red","green","blue","cyan","magenta","yellow",
-
"black","white"]
</literal>
,または RGB行列の値から選んだ文字列の値)
-
</para>
-
</listitem>
-
<listitem>
-
<para>
-
- <literal>"background"</literal>:
-
- テキスト周囲の背景色
-
+ <literal>"backgroundcolor", "background"</literal>:
+ テキスト周囲の背景色
(<literal>["red","green","blue","cyan","magenta","yellow",
-
"black","white"]
</literal>
,または RGB行列の値から選んだ文字列の値)
-
</para>
-
</listitem>
-
</itemizedlist>
-
</para>
-
</listitem>
-
</varlistentry>
-
</variablelist>
-
</refsection>
-
- <refsection>
-
+ <refsection role="description">
<title>説明</title>
-
<para>
-
xlabel, ylabel, zlabel は,それぞれ,x, y, およびz軸に
-
ラベルを付けるために使用します.
-
</para>
-
<para>
-
このラベルは2次元プロットでは対応する軸の下,
-
3次元プロットでは軸の横または下に表示されます.
-
</para>
-
</refsection>
-
- <refsection>
-
+ <refsection role="examples">
<title>例</title>
-
- <programlisting role="example">
-
- t = linspace(-2*%pi, 2*%pi, 30);
-
-
-
- subplot(2,1,1);
-
- plot(t, sin(t), "r");
-
- xlabel("t", "fontsize", 2);
-
- ylabel("sin(t)");
-
- axis1_handle = gca();
-
-
-
- subplot(2,1,2);
-
- plot(t, cos(t), "b");
-
- xlabel("t", "fontsize", 2);
-
- ylabel("cos(t)", "fontsize", 6, "color", "blue");
-
-
-
- ylabel(axis1_handle, "sin(t)", "fontsize", 6, "color", "red");
-
- </programlisting>
-
+ <programlisting role="example"><![CDATA[
+t = linspace(-2*%pi, 2*%pi, 30);
+
+subplot(2,1,1);
+plot(t, sin(t), "r");
+xlabel("t", "fontsize", 2);
+ylabel("sin(t)");
+axes_handle = gca();
+
+subplot(2,1,2);
+plot(t, cos(t), "b");
+xlabel("t", "fontsize", 2);
+ylabel("cos(t)", "fontsize", 6, "color", "blue");
+
+ylabel(axes_handle, "sin(t)", "fontsize", 6, "color", "red");
+]]> </programlisting>
<scilab:image>
-
t = linspace(-2*%pi, 2*%pi, 50);
-
subplot(2,1,1);
-
plot(t, sin(t), "r");
-
xlabel("t", "fontsize", 2);
-
ylabel("sin(t)");
-
- axis1_handle = gca();
-
+ axes1_handle = gca();
subplot(2,1,2);
-
plot(t, cos(t), "b");
-
xlabel("t", "fontsize", 2);
-
ylabel("cos(t)", "fontsize", 6, "color", "blue");
-
- ylabel(axis1_handle, "sin(t)", "fontsize", 6, "color", "red");
-
+ ylabel(axes1_handle, "sin(t)", "fontsize", 6, "color", "red");
</scilab:image>
-
</refsection>
-
<refsection role="see also">
-
<title>参照</title>
-
<simplelist type="inline">
-
<member>
-
+ <link linkend="label_properties">label_properties</link>
+ </member>
+ <member>
+ <link linkend="xtitle">xtitle</link>
+ </member>
+ <member>
<link linkend="title">title</link>
-
</member>
-
</simplelist>
-
</refsection>
-
-</refentry>
-
+</refentry>
\ No newline at end of file
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="iconvert" xml:lang="en">
<refnamediv>
<refname>iconvert</refname>
- <refpurpose>conversão para representação inteira de 1 a 8
- bytes
+ <refpurpose>conversão para representação inteira de 1 a 8 bytes
</refpurpose>
</refnamediv>
<refsynopsisdiv>
- <title>Seqüência de Chamamento</title>
+ <title>Seqüência de Chamamento</title>
<synopsis>y=iconvert(X,itype)</synopsis>
</refsynopsisdiv>
<refsection>
- <title>Parâmetros</title>
+ <title>Parâmetros</title>
<variablelist>
<varlistentry>
<term>X</term>
</variablelist>
</refsection>
<refsection>
- <title>Descrição</title>
+ <title>Descrição</title>
<para>Converte e armazena dados para inteiros de 1, 2, 4 ou 8 bytes.</para>
<variablelist>
<varlistentry>
<term>itype=0</term>
<listitem>
- <para>retorna números em ponto flutuante </para>
+ <para>retorna números em ponto flutuante </para>
</listitem>
</varlistentry>
<varlistentry>
<term>itype=1</term>
<listitem>
- <para>retorna números int8 no intervalo [-128,127] </para>
+ <para>retorna números int8 no intervalo [-128,127] </para>
</listitem>
</varlistentry>
<varlistentry>
<term>itype=11</term>
<listitem>
- <para>retorna números uint8 no intervalo [0,255]</para>
+ <para>retorna números uint8 no intervalo [0,255]</para>
</listitem>
</varlistentry>
<varlistentry>
<term>itype=2</term>
<listitem>
- <para>retorna números int16 no intervalo [-32768,32767] </para>
+ <para>retorna números int16 no intervalo [-32768,32767] </para>
</listitem>
</varlistentry>
<varlistentry>
<term>itype=12</term>
<listitem>
- <para>retorna números uint16 no intervalo [0, 65535] </para>
+ <para>retorna números uint16 no intervalo [0, 65535] </para>
</listitem>
</varlistentry>
<varlistentry>
<term>itype=4</term>
<listitem>
- <para>retorna números int32 no intervalo [-2147483648,2147483647]
+ <para>retorna números int32 no intervalo [-2147483648,2147483647]
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>itype=14</term>
<listitem>
- <para>retorna números uint32 no intervalo [0, 4294967295]</para>
+ <para>retorna números uint32 no intervalo [0, 4294967295]</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>itype=4</term>
+ <term>itype=8</term>
<listitem>
- <para>retorna números int32 no intervalo [-9223372036854775808,9223372036854775807]
+ <para>retorna números int64 no intervalo [-9223372036854775808,9223372036854775807]
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>itype=14</term>
+ <term>itype=18</term>
<listitem>
- <para>retorna números uint32 no intervalo [0, 18446744073709551616]</para>
+ <para>retorna números uint64 no intervalo [0, 18446744073709551616]</para>
</listitem>
</varlistentry>
</variablelist>
<refsection>
<title>Exemplos</title>
<programlisting role="example"><![CDATA[
-b=int32([1 -120 127 312])
-y=iconvert(b,1)
+b = int32([1 -120 127 312])
+y = iconvert(b,1)
]]></programlisting>
</refsection>
<refsection role="see also">
- <title>Ver Também</title>
+ <title>Ver Também</title>
<simplelist type="inline">
<member>
<link linkend="double">double</link>
<term>itype = 8</term>
<listitem>
<para>
- возвращает числа <literal>int32</literal> в диапазоне <literal>[-9223372036854775808,9223372036854775807]</literal>
+ возвращает числа <literal>int64</literal> в диапазоне <literal>[-9223372036854775808,9223372036854775807]</literal>
</para>
</listitem>
</varlistentry>
<term>itype = 18</term>
<listitem>
<para>
- возвращает числа <literal>uint32</literal> в диапазоне <literal>[0, 18446744073709551616]</literal>
+ возвращает числа <literal>uint64</literal> в диапазоне <literal>[0, 18446744073709551616]</literal>
</para>
</listitem>
</varlistentry>
<refsection>
<title>Примеры</title>
<programlisting role="example"><![CDATA[
-b=int32([1 -120 127 312])
-y=iconvert(b,1)
+b = int32([1 -120 127 312])
+y = iconvert(b,1)
typeof(b)
typeof(y)
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="mprintf" xml:lang="en">
<refnamediv>
<refname>mprintf</refname>
- <refpurpose>converts, formats, and writes data to the main scilab
- window
+ <refpurpose>converts, formats, and writes data to the main scilab window
</refpurpose>
</refnamediv>
<refnamediv xml:id="printf">
<refname>printf</refname>
+ <refpurpose>converts, formats, and writes data to the main scilab window (obsolete)
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
</refnamediv>
<refnamediv xml:id="sprintf">
<refname>sprintf</refname>
+ <refpurpose>converts, formats, and writes data in a string (obsolete)</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
- <synopsis>str=msprintf(format,a1,...,an);</synopsis>
+ <synopsis>str = msprintf(format,a1,...,an);</synopsis>
</refsynopsisdiv>
<refsection>
<title>Arguments</title>
</refnamediv>
<refnamediv xml:id="printf">
<refname>printf</refname>
+ <refpurpose>
+ 変換, 整形し,
+ Scilab主ウインドウにデータを書き込む (廃止)
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>呼び出し手順</title>
</refnamediv>
<refnamediv xml:id="sprintf">
<refname>sprintf</refname>
+ <refpurpose>データを変換,整形し,文字列に書き込む (廃止)</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>呼び出し手順</title>
- <synopsis>str=msprintf(format,a1,...,an);</synopsis>
+ <synopsis>str = msprintf(format,a1,...,an);</synopsis>
</refsynopsisdiv>
<refsection>
<title>パラメータ</title>
<term>p</term>
<listitem>
<para>
- un polynôme réel ou complexe, ou
- une m-par-1 or 1-par-m matrice de doubles, les coefficients du polynômes par ordre de puissance décroissante.
+ un polynôme réel ou complexe ; ou un vecteur de nombres
+ décimaux ou complexes = les coefficients du polynôme
+ par ordre de puissances décroissantes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>algo</term>
<listitem>
- <para>
- une chaîne de caractères, l'algorithme à utiliser (défaut algo="e").
- Si algo="e", alors les valeurs propres de la matrice compagnion sont utilisées.
- Si algo="f", alors l'algorithme de Jenkins-Traub est utilisé (si les coefficients
- du polynôme sont réels et que le degré du polynôme est plus petit que 100).
- Si algo="f" et que le polynôme est complexe, alors une erreur est générée.
- Si algo="f" et que le polynôme est de degré inférieur à 100, alors une erreur est
- générée.
+ <para>un caractère désignant l'algorithme à utiliser :
+ <itemizedlist>
+ <listitem>"e" (par défaut) : les valeurs propres de
+ la matrice compagnon sont utilisées.
+ </listitem>
+ <listitem>"f" : si isreal(p) et degree(p)<100 :
+ l'algorithme de Jenkins-Traub est utilisé.
+ </listitem>
+ <listitem>"f" : si isreal(p) et degree(p)>=100: une
+ erreur est émise.
+ </listitem>
+ <listitem>"f" : si ~isreal(p), une erreur est émise.
+ </listitem>
+ </itemizedlist>
</para>
</listitem>
</varlistentry>
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
+ * Copyright (C) INRIA -
* Copyright (C) Samuel GOUGEON - 2013 : $ is now supported. More examples.
*
* Copyright (C) 2012 - 2016 - Scilab Enterprises
<term>v</term>
<listitem>
<para>
- a vector of integer values containing the indices of characters to be extracted.
+ a vector of integer values containing the indices of characters to be extracted.
<literal>$</literal> is accepted and means length(strings_in).
</para>
</listitem>
<refsection>
<title>Description</title>
<para>
- This function extracts characters from strings. The characters to be
+ This function extracts characters from strings. The characters to be
extracted are referred to by their indices contained in <literal>v</literal>.
</para>
-
+
<para>
- <literal>strings_out</literal> is filled with whitespace characters when indices
+ <literal>strings_out</literal> is filled with whitespace characters when indices
are beyond the input string's length.
</para>
<para>
- <literal>v</literal> may contain <literal>$</literal> symbol which stands for the
+ <literal>v</literal> may contain <literal>$</literal> symbol which stands for the
length of <literal>string_in</literal>.
</para>
</refsection>
c=part(['a', 'abc', 'abcd'], [1, 1, 2])
-part(['a', 'abc', 'abcd'], [1]) // => ['a' 'a' 'a']
-part(['a', 'abc', 'abcd'], [1, 1]) // => ['aa' 'aa' 'aa']
-part(['a', 'abc', 'abcd'], [1, 1, 2]) // => ['aa' 'aab' 'aab']
+part(['a', 'abc', 'abcd'], [1]) // => ['a' 'a' 'a']
+part(['a', 'abc', 'abcd'], [1 1]) // => ['aa' 'aa' 'aa']
+part(['a', 'abc', 'abcd'], [1 1 2]) // => ['aa ' 'aab' 'aab']
// Repeating a character N times:
-N = 10; part('-', ones(1:N)) // => '----------'
+N = 10; part('-', ones(1:N)) // => '----------'
// Repeating a pattern N times:
-N = 6; pat = '- ';
+N = 6; pat = '- ';
part(pat, ones(1:N).*.(1:length(pat))) // => '- - - - - - '
-// Using $ = implicit length of strings:
+// Using $ = implicit length of strings:
// 1)
part(['a string' 'another longer one'], $-2:$ ) // => [ 'ing' 'one']
// 2) Another implementation for strrev():
-part('Hello world', $:-1:1) // => 'dlrow olleH'
+part('Hello world', $:-1:1) // => 'dlrow olleH'
// 3) With unranging $:
-part('Hello world', [ $ 4:5 ]) // => 'dlo'
+part('Hello world', [ $ 4:5 ]) // => 'dlo'
// 4) Mixing scalar or unrangin $ with ranging ones is not possible:
-part("Hello", [ 1 $-1:$ $ ]) // => error
+part("Hello", [ 1 $-1:$ $ ]) // => error
]]></programlisting>
</refsection>
<refsection role="see also">
</member>
</simplelist>
</refsection>
-
+
<refsection>
<title>History</title>
<revhistory>
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
- *
+ * Copyright (C) INRIA -
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
</refsection>
<refsection>
<title>例</title>
- <programlisting role="example"><![CDATA[
+ <programlisting role="example"><![CDATA[
// 位置 8 から 11 の文字を返します
part("How to use ""part"" ?", 8:11)
// 各要素の位置2から4の文字を返します
c = part(['abcdefg', 'hijklmn', 'opqrstu'], [4, 1:7, 4]);
// 位置1の文字に位置1の文字を再度追加,位置2の文字を追加して返す
c=part(['a', 'abc', 'abcd'], [1, 1, 2])
-part(['a', 'abc', 'abcd'], [1]) // => ['a' 'a' 'a']
-part(['a', 'abc', 'abcd'], [1, 1]) // => ['aa' 'aa' 'aa']
-part(['a', 'abc', 'abcd'], [1, 1, 2]) // => ['aa' 'aab' 'aab']
+part(['a', 'abc', 'abcd'], [1]) // => ['a' 'a' 'a']
+part(['a', 'abc', 'abcd'], [1 1]) // => ['aa' 'aa' 'aa']
+part(['a', 'abc', 'abcd'], [1 1 2]) // => ['aa ' 'aab' 'aab']
// 文字をN回反復
-N = 10; part('-', ones(1:N)) // => '----------'
+N = 10; part('-', ones(1:N)) // => '----------'
// パターンをN回反復:
-N = 6; pat = '- ';
-part(pat, ones(1:N).*.(1:length(pat))) // => '- - - - - - '
-// $ = 暗黙的な文字列長 を使用:
+N = 6; pat = '- ';
+part(pat, ones(1:N).*.(1:length(pat))) // => '- - - - - - '
+// $ = 暗黙的な文字列長 を使用:
// 1)
part(['a string' 'another longer one'], $-2:$ ) // => [ 'ing' 'one']
// 2) strrev()の別の実装:
-part('Hello world', $:-1:1) // => 'dlrow olleH'
+part('Hello world', $:-1:1) // => 'dlrow olleH'
// 3) 範囲を示さない$を使用:
-part('Hello world', [ $ 4:5 ]) // => 'dlo'
+part('Hello world', [ $ 4:5 ]) // => 'dlo'
// 4) 範囲を示す$が使用できない状況でスカラーと範囲ではない$を混用:
part("Hello", [ 1 $-1:$ $ ]) // => エラー
]]></programlisting>
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
- *
+ * Copyright (C) INRIA -
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
</refsection>
<refsection>
<title>Exemplos</title>
- <programlisting role="example"><![CDATA[
+ <programlisting role="example"><![CDATA[
// retorna caracteres da posição 8 a 11
part("Como usar ""part"" ?",8:11)
// retorna o caractere da posição 1, adiciona de novo o caractere da posição 1 e o caractere da posição 2
c=part(['a','abc','abcd'],[1,1,2])
-// a a a
+// a a a
part(['a','abc','abcd'],[1])
-// aa aa aa
-part(['a','abc','abcd'],[1,1])
+// aa aa aa
+part(['a','abc','abcd'],[1 1])
-// aa aab aab
-part(['a','abc','abcd'],[1,1,2])
+// "aa " aab aab
+part(['a','abc','abcd'],[1 1 2])
]]></programlisting>
</refsection>
<refsection>
<link linkend="string">string</link>
</member>
<member>
+ <link linkend="strsplit">strsplit</link>
+ </member>
+ <member>
<link linkend="length">length</link>
</member>
</simplelist>
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
- *
+ * Copyright (C) INRIA -
+ *
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
// возвращает символы с 2 по 4 для каждого элемента
// отсутствие символов заменяется ''
-c = part(['a','abc','abcd'],2:4)
+c = part(['a','abc','abcd'], 2:4)
// возвращает 1-й символ каждого элемента плюс символы с
// 4 по 7 каждого элемента
-c = part(['abcdefg','hijklmn','opqrstu'],[1,4:7]);
+c = part(['abcdefg','hijklmn','opqrstu'], [1,4:7]);
// возвращает 4-й символ каждого элемента, плюс символы с
// 1 по 7 и плюс 4-й символ каждого элемента
-c = part(['abcdefg','hijklmn','opqrstu'],[4,1:7,4]);
+c = part(['abcdefg','hijklmn','opqrstu'], [4,1:7,4]);
// возвращает 1-й символ плюс ещё 1-й символ и плюс
// 2-й символ
-c=part(['a','abc','abcd'],[1,1,2])
+c=part(['a','abc','abcd'], [1,1,2])
// a a a
-part(['a','abc','abcd'],[1])
+part(['a','abc','abcd'], [1])
// aa aa aa
-part(['a','abc','abcd'],[1,1])
+part(['a','abc','abcd'], [1 1])
-// aa aab aab
-part(['a','abc','abcd'],[1,1,2])
+// "aa " aab aab
+part(['a','abc','abcd'], [1 1 2])
]]></programlisting>
</refsection>
<refsection role="see also">
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) INRIA - Allan CORNET
- *
+ * Copyright (C) 2016 - Samuel GOUGEON
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
<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" xml:id="consolebox">
<refnamediv>
<refname>consolebox</refname>
- <refpurpose>show or hide console box (Windows)</refpurpose>
+ <refpurpose>show or hide the OS window running Scilab (MS Windows)</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
- <synopsis>state1=console(state2)
- state1=console()
+ <synopsis>
+ consolebox on
+ consolebox off
+ status = consolebox("toogle")
+ status = consolebox()
</synopsis>
</refsynopsisdiv>
- <refsection>
+ <refsection role="parameters">
<title>Arguments</title>
<variablelist>
<varlistentry>
- <term>state1</term>
- <listitem>
- <para>returns console's state 'on' or 'off'</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>state2</term>
+ <term>status</term>
<listitem>
- <para>'on' or 'off' set console's state</para>
- <para>'toggle' to switch between console's state</para>
+ <para><varname>"on" | "off"</varname> :
+ visibility of the OS window
+ after the call to <function>consolebox</function>.
+ </para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
- <refsection>
+ <refsection role="description">
<title>Description</title>
- <para>show or hide console box (Windows).</para>
+ <itemizedlist>
+ <listitem><literal>consolebox on</literal> : makes the OS window visible
+ and adds its button in the task bar. The consolebox
+ black window lays on the background, and then may be masked
+ by other windows of the OS desktop.
+ </listitem>
+ <listitem><literal>consolebox off</literal> : masks the OS window and
+ its button from the task bar.
+ </listitem>
+ <listitem><literal>consolebox toogle</literal> : toogles the OS window's
+ visibility.
+ </listitem>
+ <listitem><literal>status = consolebox()</literal> : queries
+ the visibility of the OS window.
+ </listitem>
+ </itemizedlist>
+ <para>The "consolebox" black window is the "hidden" terminal of the
+ Operating system from
+ which the current Scilab session has been run. It is somewhat the
+ "dark side" of your session :) Each Scilab session
+ has its own "consolebox". Its lifetime is the Scilab session lifetime:
+ The consolebox of a session is killed
+ when the Scilab session is quit.
+ </para>
+ <para>Some low level Scilab functions (such as the documentation builder
+ or other ones) send most of their errors messages in this window. They
+ would be considered as some spam in the Scilab console. Nevertheless,
+ these messages are very helpful for
+ debugging. <literal>consolebox on</literal> make them visible.
+ </para>
+ <para>The "consolebox" black window can't be closed interactively:
+ its X-cross at the upper-right corner is disabled. Killing it kills Scilab session.
+ </para>
+ <para>
+ When some external OS instructions are send to the operating
+ system through
+ <link linkend="host">host(..)</link> or equivalently
+ <link linkend="unix">unix(..)</link>, or any other
+ <link linkend="unix_w">unix_w(..)</link>,
+ <link linkend="unix_g">unix_g(..)</link>,
+ <link linkend="unix_s">unix_s(..)</link>, or
+ <link linkend="unix_x">unix_x(..)</link> Scilab function,
+ these OS instructions are processed within the Scilab consolebox.
+ <para><literal>host(..)</literal> and
+ <literal>unix(..)</literal> show the results in the consolebox itself
+ </para>
+ <para><literal>unix_g, unix_w, unix_x, unix_s</literal> catch results
+ returned by the OS and cancel any display in the consolebox:
+ <itemizedlist>
+ <listitem>
+ <literal>r = unix_g(..)</literal>
+ <emphasis role="bold">g</emphasis>rabs and returns the
+ results in any variable <literal>r</literal>.
+ </listitem>
+ <listitem>
+ <literal>unix_w(..)</literal> displays results in Scilab's console,
+ and returns nothing.
+ </listitem>
+ <listitem>
+ <literal>unix_x(..)</literal> displays results in a messagebox.
+ </listitem>
+ <listitem>
+ <literal>unix_s(..)</literal> runs
+ <emphasis role="bold">s</emphasis>ilently: it returns and
+ displays no results returned from the OS.
+ </listitem>
+ </itemizedlist>
+ </para>
+ </para>
+ <note><literal>host("cls")</literal> clears the consolebox screen</note>
</refsection>
<refsection>
<title>Examples</title>
- <programlisting role="example"><![CDATA[
-consolebox('off')
-state=consolebox()
-consolebox()
+ <programlisting role="example"><![CDATA[
+consolebox on
+mprintf("See the consolebox button appearing in the task bar.\n"+..
+ "Click on it to bring the consolebox on the foreground.\n");
+sleep(10,"s")
consolebox('toggle')
+sleep(5,"s")
consolebox('toggle')
+consolebox on
+consolebox()
+
+// Instructions passed to host() or unix() or other unix_#() functions are
+// processed in the consolebox:
+host("echo Test of output") // displays "Test of output" in the consolebox
+host("cls") // clears the consolebox screen
+host("set") // lists all defined MS Windows environnement variables
+
+// Other unix_#() commands catch results returned by the Operating System
+// instead of displaying them in the consolebox:
+host("cls")
+unix_w("echo Test of output") // "Test of output" is now displayed in Scilab console
+r = unix_g("set"); // Environment variables are returned in r.
+r // Nothing is displayed in the consolebox
+unix_x("set"); // Results are displayed in a messagebox. Nothing in consolebox
+
]]></programlisting>
</refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="host">host</link>
+ </member>
+ <member>
+ <link linkend="unix_w">unix_w</link>
+ </member>
+ <member>
+ <link linkend="unix_g">unix_g</link>
+ </member>
+ <member>
+ <link linkend="unix_x">unix_x</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>