~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/cacsd/help/en_US/format_representation/frep2tf.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!--
 
3
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 
4
 * Copyright (C) INRIA - 
 
5
 * 
 
6
 * This file must be used under the terms of the CeCILL.
 
7
 * This source file is licensed as described in the file COPYING, which
 
8
 * you should have received as part of this distribution.  The terms
 
9
 * are also available at    
 
10
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
11
 *
 
12
 -->
 
13
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="frep2tf">
 
14
    <refnamediv>
 
15
        <refname>frep2tf</refname>
 
16
        <refpurpose> transfer function realization from frequency response</refpurpose>
 
17
    </refnamediv>
 
18
    <refsynopsisdiv>
 
19
        <title>Calling Sequence</title>
 
20
        <synopsis>[h [,err]]=frep2tf(frq,repf,dg [,dom,tols,weight])</synopsis>
 
21
    </refsynopsisdiv>
 
22
    <refsection>
 
23
        <title>Arguments</title>
 
24
        <variablelist>
 
25
            <varlistentry>
 
26
                <term>frq</term>
 
27
                <listitem>
 
28
                    <para>vector of frequencies in Hz.</para>
 
29
                </listitem>
 
30
            </varlistentry>
 
31
            <varlistentry>
 
32
                <term>repf</term>
 
33
                <listitem>
 
34
                    <para>vector of frequency response</para>
 
35
                </listitem>
 
36
            </varlistentry>
 
37
            <varlistentry>
 
38
                <term>dg</term>
 
39
                <listitem>
 
40
                    <para>degree of linear system</para>
 
41
                </listitem>
 
42
            </varlistentry>
 
43
            <varlistentry>
 
44
                <term>dom</term>
 
45
                <listitem>
 
46
                    <para>
 
47
                        time domain (<literal>'c'</literal> or <literal>'d'</literal> or <literal>dt</literal>)
 
48
                    </para>
 
49
                </listitem>
 
50
            </varlistentry>
 
51
            <varlistentry>
 
52
                <term>tols</term>
 
53
                <listitem>
 
54
                    <para>
 
55
                        a vector of size 3 giving the relative and absolute tolerance  and the maximum number of iterations (default values are <literal>rtol=1.e-2; atol=1.e-4, N=10</literal>).
 
56
                    </para>
 
57
                </listitem>
 
58
            </varlistentry>
 
59
            <varlistentry>
 
60
                <term>weight</term>
 
61
                <listitem>
 
62
                    <para>vector of weights on frequencies</para>
 
63
                </listitem>
 
64
            </varlistentry>
 
65
            <varlistentry>
 
66
                <term>h</term>
 
67
                <listitem>
 
68
                    <para>SISO transfer function</para>
 
69
                </listitem>
 
70
            </varlistentry>
 
71
            <varlistentry>
 
72
                <term>err</term>
 
73
                <listitem>
 
74
                    <para>
 
75
                        error (for example if <literal>dom='c'</literal> <literal>sum(abs(h(2i*pi*frq) - rep)^2)/size(frq,*)</literal>)
 
76
                    </para>
 
77
                </listitem>
 
78
            </varlistentry>
 
79
        </variablelist>
 
80
    </refsection>
 
81
    <refsection>
 
82
        <title>Description</title>
 
83
        <para>
 
84
            Frequency response to  transfer function conversion. The order of <literal>h</literal>
 
85
            is a priori given in <literal>dg</literal> which must be provided.
 
86
            The following linear system is solved in the least square sense.
 
87
        </para>
 
88
        <programlisting role=""><![CDATA[ 
 
89
 weight(k)*(n( phi_k) - d(phi_k)*rep_k)=0, k=1,..,n
 
90
 ]]></programlisting>
 
91
        <para>
 
92
            where <literal>phi_k= 2*%i*%pi*frq</literal> when <literal>dom='c'</literal> and <literal>phi_k=exp(2*%i*%pi*dom*frq</literal> if not. If the <literal>weight</literal> vector is not given a default 
 
93
            penalization is used (when <literal>dom='c'</literal>).
 
94
        </para>
 
95
        <para>
 
96
            A stable and minimum phase system can be obtained by using function <literal>factors</literal>.
 
97
        </para>
 
98
    </refsection>
 
99
    <refsection>
 
100
        <title>Examples</title>
 
101
        <programlisting role="example"><![CDATA[ 
 
102
s=poly(0,'s');
 
103
h=syslin('c',(s-1)/(s^3+5*s+20))
 
104
frq=0:0.05:3;repf=repfreq(h,frq);
 
105
clean(frep2tf(frq,repf,3))
 
106
 
 
107
Sys=ssrand(1,1,10); 
 
108
frq=logspace(-3,2,200);
 
109
[frq,rep]=repfreq(Sys,frq);  //Frequency response of Sys
 
110
[Sys2,err]=frep2tf(frq,rep,10);Sys2=clean(Sys2)//Sys2 obtained from freq. resp of Sys
 
111
[frq,rep2]=repfreq(Sys2,frq); //Frequency response of Sys2
 
112
clf();bode(frq,[rep;rep2])   //Responses of Sys and Sys2
 
113
[gsort(spec(Sys('A'))),gsort(roots(Sys2('den')))] //poles
 
114
 
 
115
 
 
116
dom=1/1000; // Sampling time 
 
117
z=poly(0,'z');
 
118
h=syslin(dom,(z^2+0.5)/(z^3+0.1*z^2-0.5*z+0.08))
 
119
frq=(0:0.01:0.5)/dom;repf=repfreq(h,frq);
 
120
[Sys2,err]=frep2tf(frq,repf,3,dom);
 
121
[frq,rep2]=repfreq(Sys2,frq); //Frequency response of Sys2
 
122
clf();plot2d1("onn",frq',abs([repf;rep2])');
 
123
]]></programlisting>
 
124
    </refsection>
 
125
    <refsection role="see also">
 
126
        <title>See Also</title>
 
127
        <simplelist type="inline">
 
128
            <member>
 
129
                <link linkend="imrep2ss">imrep2ss</link>
 
130
            </member>
 
131
            <member>
 
132
                <link linkend="arl2">arl2</link>
 
133
            </member>
 
134
            <member>
 
135
                <link linkend="time_id">time_id</link>
 
136
            </member>
 
137
            <member>
 
138
                <link linkend="armax">armax</link>
 
139
            </member>
 
140
            <member>
 
141
                <link linkend="frfit">frfit</link>
 
142
            </member>
 
143
        </simplelist>
 
144
    </refsection>
 
145
</refentry>