<?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="ltitr">
    <refnamediv>
        <refname>ltitr</refname>
        <refpurpose>discrete time response (state space)  </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            [xf, X] = ltitr(A, B, U)
            [xf, X] = ltitr(A, B, U, x0)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>A,B</term>
                <listitem>
                    <para>real  matrices of appropriate dimensions</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>U,X</term>
                <listitem>
                    <para>real  matrices</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>x0,xf</term>
                <listitem>
                    <para>
                        real vectors (default value=0 for <literal>x0</literal>))
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            calculates the time response of the discrete time system
        </para>
        <programlisting role=""><![CDATA[
x[t+1] = Ax[t] + Bu[t].
 ]]></programlisting>
        <para>
            The inputs <literal>ui</literal>'s are the columns of the <literal>U</literal> matrix
        </para>
        <programlisting role=""><![CDATA[
U=[u0,u1,...,un];
 ]]></programlisting>
        <para>
            <literal>x0</literal> is the vector of initial state (default value : 0) ;
        </para>
        <para>
            <literal>X</literal> is the matrix of outputs (same number of columns as <literal>U</literal>).
        </para>
        <programlisting role=""><![CDATA[
X=[x0,x1,x2,...,xn]
 ]]></programlisting>
        <para>
            <literal>xf</literal> is the vector of final state <literal>xf=X[n+1]</literal>
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
A=eye(2,2);B=[1;1];
x0=[-1;-2];
u=[1,2,3,4,5];
x=ltitr(A,B,u,x0)
x1=A*x0+B*u(1)
x2=A*x1+B*u(2)
x3=A*x2+B*u(3) //....
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="rtitr">rtitr</link>
            </member>
            <member>
                <link linkend="flts">flts</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
