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