<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://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="markp2ss">
    <refnamediv>
        <refname>markp2ss</refname>
        <refpurpose>Markov parameters to state-space</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>sl = markp2ss(markpar, n, nout, nin)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>markpar</term>
                <listitem>
                    <para>matrix</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>n,nout,nin</term>
                <listitem>
                    <para>integers</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>Sl</term>
                <listitem>
                    <para>
                        <literal>syslin</literal> list
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            given a set of <literal>n</literal> Markov parameters stacked in the (row)-matrix
            <literal>markpar</literal> of size <literal>nout</literal>X<literal>(n*nin) markp2ss</literal>
            returns a state-space linear system <literal>sl</literal> (<literal>syslin</literal> list)
            such that with <literal>[A,B,C,D]=abcd(sl)</literal>:
        </para>
        <programlisting role=""><![CDATA[
C*B = markpar(1:nout,1:nin),
C*A*B =markpar(1:nout,nin+1:2*nin),....
 ]]></programlisting>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
W=ssrand(2,3,4);   //random system with 2 outputs and 3 inputs
[a,b,c,d]=abcd(W);
markpar=[c*b,c*a*b,c*a^2*b,c*a^3*b,c*a^4*b];
S=markp2ss(markpar,5,2,3);
[A,B,C,D]=abcd(S);
Markpar=[C*B,C*A*B,C*A^2*B,C*A^3*B,C*A^4*B];
norm(markpar-Markpar,1)
//Caution... c*a^5*b is not C*A^5*B !
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="frep2tf">frep2tf</link>
            </member>
            <member>
                <link linkend="tf2ss">tf2ss</link>
            </member>
            <member>
                <link linkend="imrep2ss">imrep2ss</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
