<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA -
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
          xml:lang="en" xml:id="ss2tf">
    <refnamediv>
        <refname>ss2tf</refname>
        <refpurpose>conversion from state-space to transfer function</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            h = ss2tf(sl)
            h = ss2tf(sl,"b")
            h = ss2tf(sl,rmax)
            [Ds, NUM, chi] = ss2tf(..)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>sl</term>
                <listitem>
                    <para>
                        linear system (<literal>syslin</literal> list)
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>h</term>
                <listitem>
                    <para>transfer matrix</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            Called with three outputs <literal>[Ds,NUM,chi]=ss2tf(sl)</literal> returns
            the numerator polynomial matrix <literal>NUM</literal>, the characteristic
            polynomial <literal>chi</literal> and the polynomial part <literal>Ds</literal> separately i.e.:
        </para>
        <programlisting role=""><![CDATA[
h = NUM/chi + Ds
 ]]></programlisting>
        <para>
            Method:
        </para>
        <para>
            One uses the characteristic polynomial and
            <literal>det(A+Eij)=det(A)+C(i,j)</literal> where <literal>C</literal> is the adjugate
            matrix of <literal>A</literal>.
        </para>
        <para>
            With <literal>rmax</literal> or <literal>"b"</literal> argument uses a block diagonalization of
            sl.A matrix and applies "Leverrier" algorithm on blocks.
            If given, <literal>rmax</literal> controls the conditioning (see bdiag).
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
s=poly(0,'s');
h=[1,1/s;1/(s^2+1),s/(s^2-2)]
sl=tf2ss(h);
h=clean(ss2tf(sl))
[Ds,NUM,chi]=ss2tf(sl)
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="tf2ss">tf2ss</link>
            </member>
            <member>
                <link linkend="syslin">syslin</link>
            </member>
            <member>
                <link linkend="nlev">nlev</link>
            </member>
            <member>
                <link linkend="glever">glever</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
