3095bab66d1d9afaf95f01fa0bc2e5d9ffd07db2
[scilab.git] / scilab / modules / core / help / en_US / 1_keywords / slash.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="slash">
3     <refnamediv>
4         <refname>slash</refname>
5         <refpurpose>(/) right division and feed back</refpurpose>
6     </refnamediv>
7     <refsection>
8         <title>Description</title>
9         <para>
10             Right division: <code>X=A/B</code> is the solution of <code>X*B=A</code>.
11         </para>
12         <para>
13             The slash (right division) and backslash (left division) operators are linked by the following equation:
14             <code>B/A=(A'\B')'</code>.
15         </para>
16         <para>
17             In the case where <literal>A</literal> is square, the 
18             solution <literal>X</literal> can be computed either from LU 
19             factorization or from a linear least squares solver. If the 
20             condition number of <literal>A</literal> is smaller than 
21             <code>1/(10*%eps)</code> (i.e. if <literal>A</literal> is 
22             well conditioned), the LU factorization with row pivoting is 
23             used. If not (i.e. if <literal>A</literal> is poorly 
24             conditioned), then <literal>X</literal> is the minimum-norm 
25             solution which minimizes <literal>||A*X-B||</literal> using 
26             a complete orthogonal factorization of <literal>A</literal> 
27             (i.e. <literal>X</literal> is the solution of a linear least 
28             squares problem).
29         </para>
30         <para>
31             <code>A./B</code> is the element-wise right division, i.e. 
32             the matrix with entries <literal>A(i,j)/B(i,j)</literal>.
33             If <literal>B</literal> is scalar (1x1 matrix) this 
34             operation is the same as <code>A./B*ones(A)</code>. Same 
35             convention if <literal>A</literal> is a scalar.
36         </para>
37         <para>
38             <note>
39                 Remark that <code>123./B</code> is interpreted as 
40                 <code>(123.)/B</code>. In this cases dot is part of the  
41                 number not of the operator.
42             </note>
43         </para>
44         <para>
45             System feed back.  <code>S = G/.K</code> evaluates
46             <code>S = G*(eye() + K*G)^(-1)</code> this operator avoid 
47             simplification problem.
48         </para>
49         <para>
50             <note>
51                 Remark that <code>G/.5</code> is interpreted as 
52                 <code>G/(.5)</code>. In such cases dot is part of the 
53                 number, not of the operator.
54             </note>
55         </para>
56         <para>
57             Comment <code>//</code> comments a line i.e. lines which 
58             begin by <code>//</code> are ignored by the interpreter.
59         </para>
60     </refsection>
61     <refsection>
62         <title>Examples</title>
63         <programlisting role="example"><![CDATA[
64 a=[3.,-24.,30.];
65 B=[
66    9.   -36.    30.
67   -36.   192.  -180.
68    30.  -180.   180.
69 ];
70 x=a/B
71 x*B-a // close to zero
72
73 a=4 / 2; // Should be 2
74 a=2 ./ [2,4]; //     1.    0.5
75 // Comments are good. They help to understand code
76  ]]></programlisting>
77     </refsection>
78     <refsection role="see also">
79         <title>See Also</title>
80         <simplelist type="inline">
81             <member>
82                 <link linkend="inv">inv</link>
83             </member>
84             <member>
85                 <link linkend="backslash">backslash</link>
86             </member>
87             <member>
88                 <link linkend="comments">comments</link>
89             </member>
90         </simplelist>
91     </refsection>
92     <refsection>
93         <title>History</title>
94         <revhistory>
95             <revision>
96                 <revnumber>5.4.1</revnumber>
97                 <revremark>
98                     The threshold level for conditioning in slash increased.
99                 </revremark>
100             </revision>
101         </revhistory>
102     </refsection>
103     
104 </refentry>