Various improvements of the poly help page
[scilab.git] / scilab / modules / polynomials / help / en_US / poly.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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="poly">
3     <refnamediv>
4         <refname>poly</refname>
5         <refpurpose>polynomial definition</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Calling Sequence</title>
9         <synopsis>p=poly(a,vname, ["flag"])</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>a</term>
16                 <listitem>
17                     <para>matrix or real number</para>
18                 </listitem>
19             </varlistentry>
20             <varlistentry>
21                 <term>vname</term>
22                 <listitem>
23                     <para>String, the symbolic variable name. The string must be 4 characters max.
24                     </para>
25                 </listitem>
26             </varlistentry>
27             <varlistentry>
28                 <term>"flag"  </term>
29                 <listitem>
30                     <para>
31                         string ("roots", "coeff"), default value is <literal>"roots"</literal>.
32                     </para>
33                     <para>
34                         Shortcuts can be also used: <literal>"r"</literal> for <literal>"roots"</literal> and <literal>"c"</literal> for <literal>"coeff"</literal>.
35                     </para>
36                 </listitem>
37             </varlistentry>
38         </variablelist>
39     </refsection>
40     <refsection>
41         <title>Description</title>
42         <variablelist>
43             <varlistentry>
44                 <term>
45                     If <literal>a</literal> is a matrix,
46                 </term>
47                 <listitem>
48                     <para>
49                         <literal>p</literal> is the characteristic
50                         polynomial i.e. <literal>determinant(x*eye()-a)</literal>, <literal>x</literal> being
51                         the symbolic variable.
52                     </para>
53                 </listitem>
54             </varlistentry>
55             <varlistentry>
56                 <term>If v is a vector,</term>
57                 <listitem>
58                     <itemizedlist>
59                         <listitem>
60                             <para>
61                                 <literal>poly(v,"x",["roots"])</literal>  is the polynomial
62                                 with <literal>roots</literal> the entries of <literal>v</literal> and
63                                 <literal>"x"</literal> as formal variable. (In this case,
64                                 <literal>roots</literal> and   <literal>poly</literal> are inverse functions). 
65                                 Note that Infinite roots gives zero  highest degree coefficients. 
66                             </para>
67                         </listitem>
68                         <listitem>
69                             <para>
70                                 <literal>poly(v,"x","coeff")</literal> creates the
71                                 polynomial with symbol <literal>"x"</literal> and with coefficients
72                                 the entries of <literal>v</literal> (<literal>v(1)</literal> is the constant term 
73                                 of the polynomial). (Here <literal>poly</literal> and <literal>coeff</literal> are 
74                                 inverse functions).
75                             </para>
76                         </listitem>
77                     </itemizedlist>
78                 </listitem>
79             </varlistentry>
80         </variablelist>
81         <para>
82             <literal>s=poly(0,"s")</literal> is the seed for defining
83             polynomials with symbol <literal>"s"</literal>.
84         </para>
85     </refsection>
86     <refsection>
87         <title>Examples</title>
88         <programlisting role="example"><![CDATA[ 
89 s=poly(0,"s");
90 p=1+s+2*s^2
91 A=rand(2,2);
92 poly(A,"x")
93 //rational fractions
94 h=(1+2*%s)/poly(1:4,'s','c')
95  ]]></programlisting>
96     </refsection>
97     <refsection role="see also">
98         <title>See Also</title>
99         <simplelist type="inline">
100             <member>
101                 <link linkend="coeff">coeff</link>
102             </member>
103             <member>
104                 <link linkend="roots">roots</link>
105             </member>
106             <member>
107                 <link linkend="varn">varn</link>
108             </member>
109             <member>
110                 <link linkend="horner">horner</link>
111             </member>
112             <member>
113                 <link linkend="derivat">derivat</link>
114             </member>
115             <member>
116                 <link linkend="matrices">matrices</link>
117             </member>
118             <member>
119                 <link linkend="rational">rational</link>
120             </member>
121         </simplelist>
122     </refsection>
123 </refentry>