<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Serge STEER
 * 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="show_margins">
    <refnamediv>
        <refname>show_margins</refname>
        <refpurpose>display gain and phase margin  and associated crossover frequencies</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            show_margins(h)
            show_margins(h,'bode')
            show_margins(h,'nyquist')
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>h</term>
                <listitem>
                    <para>
                        a SISO linear system (see :<link linkend="syslin">syslin</link>).
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>Given a SISO linear system in continuous or discrete time,
            <literal>show_margins</literal> display gain and phase margin and
            associated crossover frequencies on a bode (the defaut) or nyquist
            representation of the frequency response of the system.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
//continuous case
h=syslin('c',0.02909+0.11827*%s+0.12823*%s^2+0.35659*%s^3+0.256*%s^4+0.1*%s^5,..
             0.0409+0.1827*%s+1.28225*%s^2+3.1909*%s^3+2.56*%s^4+%s^5);
show_margins(h)
show_margins(h,'nyquist')
 ]]></programlisting>
        <scilab:image localized="true">
            h=syslin('c',0.02909+0.11827*%s+0.12823*%s^2+0.35659*%s^3+0.256*%s^4+0.1*%s^5,..
            0.0409+0.1827*%s+1.28225*%s^2+3.1909*%s^3+2.56*%s^4+%s^5);
            show_margins(h)
            show_margins(h,'nyquist')
        </scilab:image>
        <programlisting role="example"><![CDATA[
//discrete case
h = syslin(0.1,0.01547+0.01599*%z ,%z^2-1.81*%z+0.9048)
show_margins(h)
show_margins(h,'nyquist')
 ]]></programlisting>
        <scilab:image localized="true">
            h = syslin(0.1,0.01547+0.01599*%z ,%z^2-1.81*%z+0.9048)
            show_margins(h)
            show_margins(h,'nyquist')
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="p_margin">p_margin</link>
            </member>
            <member>
                <link linkend="g_margin">g_margin</link>
            </member>
            <member>
                <link linkend="bode">bode</link>
            </member>
            <member>
                <link linkend="nyquist">nyquist</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
