340be601109f25341e50a313a4f24b202991494e
[scilab.git] / scilab / modules / signal_processing / help / en_US / system.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" version="5.0-subset Scilab" xml:lang="en" xml:id="system">
3     <refnamediv>
4         <refname>system</refname>
5         <refpurpose> observation update</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Calling Sequence</title>
9         <synopsis>[x1,y]=system(x0,f,g,h,q,r)</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>x0</term>
16                 <listitem>
17                     <para>input state vector</para>
18                 </listitem>
19             </varlistentry>
20             <varlistentry>
21                 <term>f</term>
22                 <listitem>
23                     <para>system matrix</para>
24                 </listitem>
25             </varlistentry>
26             <varlistentry>
27                 <term>g</term>
28                 <listitem>
29                     <para>input matrix</para>
30                 </listitem>
31             </varlistentry>
32             <varlistentry>
33                 <term>h</term>
34                 <listitem>
35                     <para>Output matrix</para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>q</term>
40                 <listitem>
41                     <para>input noise covariance matrix</para>
42                 </listitem>
43             </varlistentry>
44             <varlistentry>
45                 <term>r</term>
46                 <listitem>
47                     <para>output noise covariance matrix</para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>x1</term>
52                 <listitem>
53                     <para>output state vector</para>
54                 </listitem>
55             </varlistentry>
56             <varlistentry>
57                 <term>y</term>
58                 <listitem>
59                     <para>output observation</para>
60                 </listitem>
61             </varlistentry>
62         </variablelist>
63     </refsection>
64     <refsection>
65         <title>Description</title>
66         <para>
67             define system function which generates the next
68             observation given the old state.
69             System recursively calculated
70         </para>
71         <programlisting role=""><![CDATA[ 
72 x1=f*x0+g*u
73 y=h*x0+v
74  ]]></programlisting>
75         <para>
76             where <literal>u</literal> is distributed <literal>N(0,q)</literal>
77             and <literal>v</literal> is distribute <literal>N(0,r)</literal>.
78         </para>
79     </refsection>
80     <refsection>
81         <title>Examples</title>
82         <programlisting role="example"><![CDATA[ 
83 // initialize state statistics 
84 // (mean and err. variance)
85 m0=[10 10]';
86 p0=[2 0;0 2];
87 // create system
88 f=[1.1 0.1;0 0.8];
89 g=[1 0;0 1];
90 h=[1 0;0 1];
91 // noise statistics
92 q=[.03 0.01;.01 0.03];
93 r=2*eye(2);
94 // initialize system process
95 rand("seed",2);
96 rand("normal");
97 p0c=chol(p0);
98 x0=m0+p0c'*rand(ones(m0));
99 yt=[];
100 //initialize kalman filter
101 xke0=m0;pk0=p0;
102 // initialize err. variance
103 ecv=[pk0(1,1) pk0(2,2)]';
104 [x1,y]=system(x0,f,g,h,q,r)
105  ]]></programlisting>
106     </refsection>
107     
108 </refentry>