<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2016 - Serge Steer - INRIA
 *
 * 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.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
          xml:lang="en" xml:id="zpk2ss">
    <refnamediv>
        <refname>zpk2ss</refname>
        <refpurpose>Zero pole gain to state space</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>S = zpk2ss(sys)</synopsis>
    </refsynopsisdiv>
    <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>).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>S</term>
                <listitem>
                    <para>
                        The state space representation of sys.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <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")
typeof(sys)

S = zpk2ss(sys)
typeof(S)
 ]]></programlisting>
        <screen><![CDATA[
--> sys = zpk([2;1], [0;-3-%i;-3+%i], 2.5, "c")

 sys = [zpk]

        (s-2) (s-1)  
   2.5 ------------- 
       s (s^2+6s+10) 


--> typeof(sys)

 ans = 

  "zpk"

--> 

--> S = zpk2ss(sys)

 S = [state-space]

  A (matrix) = [0,1,-0.3162278;0,-6,-3.1622777;0,3.1622777,0]
  B (matrix) = [0;1;0]
  C (matrix) = [-5,2.5,-0.7905694]
  D (matrix) = 0
  X0 (initial state) = [0;0;0]
  dt (time domain) = "c"

--> typeof(S)

 ans = 

  "state-space"
]]></screen>
    </refsection>
    <refsection role="see also">
        <title>See Also</title>
        <simplelist type="inline">
            <member>
                <link linkend="zp2ss">zp2ss</link>
            </member>
            <member>
                <link linkend="zpk2tf">zpk2tf</link>
            </member>
        </simplelist>
    </refsection>
    <refsection role="history">
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>6.0</revnumber>
                <revdescription>
                    <para>Function added.</para>
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
