* Bug 16199 fixed [doc]: zpk2tf & zpk2ss examples failed 97/21097/5
Samuel GOUGEON [Sun, 29 Sep 2019 11:05:15 +0000 (13:05 +0200)]
  http://bugzilla.scilab.org/16199

Change-Id: Iba609f94db6553e92fa73b158c9cf67cc8ef4ce4

scilab/CHANGES.md
scilab/modules/cacsd/help/en_US/linear_system_representation/zpk2ss.xml
scilab/modules/cacsd/help/en_US/linear_system_representation/zpk2tf.xml

index 88fa487..303d85f 100644 (file)
@@ -286,6 +286,7 @@ Bug Fixes
 * [#16177](http://bugzilla.scilab.org/show_bug.cgi?id=16177): In the uicontrol help page, the first example was bugged.
 * [#16178](http://bugzilla.scilab.org/show_bug.cgi?id=16178): `sci2exp` yielded an error for any input macro without output argument.
 * [#16197](http://bugzilla.scilab.org/show_bug.cgi?id=16197): result of extraction was not decomplexified when applicable.
+* [#16199](http://bugzilla.scilab.org/show_bug.cgi?id=16199): In the documentation, `zpk2tf` and `zpk2ss` examples yielded an error.
 * [#16200](http://bugzilla.scilab.org/show_bug.cgi?id=16200): Concatenation of transposed cells crashed Scilab.
 * [#16208](http://bugzilla.scilab.org/show_bug.cgi?id=16208): Using 3D string matrix with old C-api gateways may crash Scilab.
 * [#16209](http://bugzilla.scilab.org/show_bug.cgi?id=16209): grand() causes a freeze after several consecutive calls when using default base generator.
@@ -307,4 +308,3 @@ Bug Fixes
 * [#16293](http://bugzilla.scilab.org/show_bug.cgi?id=16293): Some demos run in step-by-step console mode(4) did not focus user's attention to the console to proceed.
 * [#16299](http://bugzilla.scilab.org/show_bug.cgi?id=16299): After `graypolarplot()`, `colorbar()` displayed an empty ungraduated color bar.
 * [#16303](http://bugzilla.scilab.org/show_bug.cgi?id=16303): log10(x) had wrong dimensions when x is an hypermatrix.
-
index a492e89..8243e91 100644 (file)
@@ -9,7 +9,10 @@
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="zpk2ss">
+<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="zpk2ss">
     <refnamediv>
         <refname>zpk2ss</refname>
         <refpurpose>Zero pole gain to state space</refpurpose>
     <refsection>
         <title>Arguments</title>
         <variablelist>
-
             <varlistentry>
                 <term>sys</term>
                 <listitem>
                     <para>
-                        A linear dynamical system in zero-pole-gain
-                        representation (see <link
-                        linkend="zpk">zpk</link>).
+                        A linear dynamical system in zero-pole-gain representation
+                        (see <link linkend="zpk">zpk</link>).
                     </para>
                 </listitem>
             </varlistentry>
@@ -40,9 +41,6 @@
                     </para>
                 </listitem>
             </varlistentry>
-
-
-
         </variablelist>
     </refsection>
     <refsection>
         <para>
             Converts a zero pole gain representation to state space.
         </para>
-
     </refsection>
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-sys=zpk([2;1],0;-3-%i;-3+%i],2.5,"c")
-S=zpk2ss(sys)
+sys = zpk([2;1], [0;-3-%i;-3+%i], 2.5, "c")
+typeof(sys)
+
+S = zpk2ss(sys)
+typeof(S)
  ]]></programlisting>
+        <screen><![CDATA[
+--> sys = zpk([2;1], [0;-3-%i;-3+%i], 2.5, "c")
+ sys  =
+
+        (s-2) (s-1)
+   2.5 -------------
+       s (s^2+6s+10)
+
+
+--> typeof(sys)
+ ans  =
+
+  "zpk"
+
+-->
+
+--> S = zpk2ss(sys)
+ S  =
+
+
+ S(1)  (state-space system:)
+
+  "lss"  "A"  "B"  "C"  "D"  "X0"  "dt"
+
+ S(2)= A matrix =
+
+   0.   1.         -0.3162278
+   0.  -6.         -3.1622777
+   0.   3.1622777   0.
+
+ S(3)= B matrix =
+
+   0.
+   1.
+   0.
+
+ S(4)= C matrix =
+
+  -5.   2.5  -0.7905694
+
+ S(5)= D matrix =
+
+   0.
+
+ S(6)= X0 (initial state) =
+
+   0.
+   0.
+   0.
+
+ S(7)= Time domain =
+
+  "c"
+
+--> typeof(S)
+ ans  =
+
+  "state-space"
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
@@ -81,5 +140,4 @@ S=zpk2ss(sys)
             </revision>
         </revhistory>
     </refsection>
-
 </refentry>
index 335098d..0ecba4f 100644 (file)
@@ -9,7 +9,10 @@
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="zpk2tf">
+<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="zpk2tf">
     <refnamediv>
         <refname>zpk2tf</refname>
         <refpurpose>Zero pole gain to transfer function</refpurpose>
     <refsection>
         <title>Arguments</title>
         <variablelist>
-
             <varlistentry>
                 <term>sys</term>
                 <listitem>
                     <para>
-                        A linear dynamical system in zero-pole-gain
-                        representation (see <link
-                        linkend="zpk">zpk</link>).
+                        A linear dynamical system in zero-pole-gain  representation (see
+                        <link linkend="zpk">zpk</link>).
                     </para>
                 </listitem>
             </varlistentry>
@@ -40,9 +41,6 @@
                     </para>
                 </listitem>
             </varlistentry>
-
-
-
         </variablelist>
     </refsection>
     <refsection>
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-sys=zpk([2;1],0;-3-%i;-3+%i],2.5,"c")
-S=zpk2tf(sys)
+sys = zpk([2;1], [0;-3-%i;-3+%i], 2.5, "c")
+typeof(sys)
+
+S = zpk2tf(sys)
+typeof(S)
  ]]></programlisting>
+        <screen><![CDATA[
+--> sys = zpk([2;1], [0;-3-%i;-3+%i], 2.5, "c")
+ sys  =
+
+        (s-2) (s-1)
+   2.5 -------------
+       s (s^2+6s+10)
+
+
+--> typeof(sys)
+ ans  =
+
+  "zpk"
+
+-->
+
+--> S = zpk2tf(sys)
+ S  =
+
+
+   5 -7.5s +2.5s²
+   --------------
+    10s +6s² +s³
+
+--> typeof(S)
+ ans  =
+
+  "rational"
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
@@ -81,5 +111,4 @@ S=zpk2tf(sys)
             </revision>
         </revhistory>
     </refsection>
-
 </refentry>