13
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="factors">
15
<refname>factors</refname>
16
<refpurpose> numeric real factorization</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>[lnum,g]=factors(pol [,'flag'])
21
[lnum,lden,g]=factors(rat [,'flag'])
22
rat=factors(rat,'flag')
26
<title>Arguments</title>
31
<para>real polynomial</para>
38
real rational polynomial (<literal>rat=pol1/pol2</literal>)
45
<para>list of polynomials (of degrees 1 or 2)</para>
51
<para>list of polynomials (of degrees 1 or 2)</para>
57
<para>real number</para>
64
character string <literal>'c'</literal> or <literal>'d'</literal>
71
<title>Description</title>
73
returns the factors of polynomial <literal>pol</literal> in the list <literal>lnum</literal>
77
One has pol= g times product of entries of the list <literal>lnum</literal>
78
(if <literal>flag</literal> is not given). If <literal>flag='c'</literal> is given, then
79
one has <literal>|pol(i omega)|</literal> = <literal>|g*prod(lnum_j(i omega)|</literal>.
80
If <literal>flag='d'</literal> is given, then
81
one has <literal>|pol(exp(i omega))|</literal> = <literal>|g*prod(lnum_i(exp(i omega))|</literal>.
82
If argument of <literal>factors</literal> is a 1x1 rational <literal>rat=pol1/pol2</literal>,
83
the factors of the numerator <literal>pol1</literal> and the denominator <literal>pol2</literal>
84
are returned in the lists <literal>lnum</literal> and <literal>lden</literal> respectively.
87
The "gain" is returned as <literal>g</literal>,i.e. one has:
88
rat= g times (product entries in lnum) / (product entries in lden).
91
If <literal>flag</literal> is <literal>'c'</literal> (resp. <literal>'d'</literal>), the roots of <literal>pol</literal>
92
are refected wrt the imaginary axis (resp. the unit circle), i.e.
93
the factors in <literal>lnum</literal> are stable polynomials.
96
Same thing if <literal>factors</literal> is invoked with a rational arguments:
97
the entries in <literal>lnum</literal> and <literal>lden</literal> are stable polynomials if
98
<literal>flag</literal> is given. <literal>R2=factors(R1,'c')</literal> or <literal>R2=factors(R1,'d')</literal>
99
with <literal>R1</literal> a rational function or SISO <literal>syslin</literal> list then the
100
output <literal>R2</literal> is a transfer with stable numerator and denominator and
101
with same magnitude as <literal>R1</literal> along the imaginary axis (<literal>'c'</literal>)
102
or unit circle (<literal>'d'</literal>).
106
<title>Examples</title>
107
<programlisting role="example"><![CDATA[
15
<refname>factors</refname>
16
<refpurpose> numeric real factorization</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>[lnum,g]=factors(pol [,'flag'])
21
[lnum,lden,g]=factors(rat [,'flag'])
22
rat=factors(rat,'flag')
26
<title>Arguments</title>
31
<para>real polynomial</para>
38
real rational polynomial (<literal>rat=pol1/pol2</literal>)
45
<para>list of polynomials (of degrees 1 or 2)</para>
51
<para>list of polynomials (of degrees 1 or 2)</para>
57
<para>real number</para>
64
character string <literal>'c'</literal> or <literal>'d'</literal>
71
<title>Description</title>
73
returns the factors of polynomial <literal>pol</literal> in the list <literal>lnum</literal>
77
One has pol= g times product of entries of the list <literal>lnum</literal>
78
(if <literal>flag</literal> is not given). If <literal>flag='c'</literal> is given, then
79
one has <literal>|pol(i omega)|</literal> = <literal>|g*prod(lnum_j(i omega)|</literal>.
80
If <literal>flag='d'</literal> is given, then
81
one has <literal>|pol(exp(i omega))|</literal> = <literal>|g*prod(lnum_i(exp(i omega))|</literal>.
82
If argument of <literal>factors</literal> is a 1x1 rational <literal>rat=pol1/pol2</literal>,
83
the factors of the numerator <literal>pol1</literal> and the denominator <literal>pol2</literal>
84
are returned in the lists <literal>lnum</literal> and <literal>lden</literal> respectively.
87
The "gain" is returned as <literal>g</literal>,i.e. one has:
88
rat= g times (product entries in lnum) / (product entries in lden).
91
If <literal>flag</literal> is <literal>'c'</literal> (resp. <literal>'d'</literal>), the roots of <literal>pol</literal>
92
are refected wrt the imaginary axis (resp. the unit circle), i.e.
93
the factors in <literal>lnum</literal> are stable polynomials.
96
Same thing if <literal>factors</literal> is invoked with a rational arguments:
97
the entries in <literal>lnum</literal> and <literal>lden</literal> are stable polynomials if
98
<literal>flag</literal> is given. <literal>R2=factors(R1,'c')</literal> or <literal>R2=factors(R1,'d')</literal>
99
with <literal>R1</literal> a rational function or SISO <literal>syslin</literal> list then the
100
output <literal>R2</literal> is a transfer with stable numerator and denominator and
101
with same magnitude as <literal>R1</literal> along the imaginary axis (<literal>'c'</literal>)
102
or unit circle (<literal>'d'</literal>).
106
<title>Examples</title>
107
<programlisting role="example"><![CDATA[
108
108
n=poly([0.2,2,5],'z');
109
109
d=poly([0.1,0.3,7],'z');
110
110
R=syslin('d',n,d);