1 | <?xml version='1.0' encoding='UTF-8' standalone='no'?> |
---|
2 | <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6"> |
---|
3 | <compounddef id="pmsm__unkQ_8cpp" kind="file"> |
---|
4 | <compoundname>pmsm_unkQ.cpp</compoundname> |
---|
5 | <includes local="no">itpp/itbase.h</includes> |
---|
6 | <includes refid="libKF_8h" local="no">estim/libKF.h</includes> |
---|
7 | <includes refid="libPF_8h" local="no">estim/libPF.h</includes> |
---|
8 | <includes refid="libFN_8h" local="no">stat/libFN.h</includes> |
---|
9 | <includes refid="pmsm_8h" local="yes">pmsm.h</includes> |
---|
10 | <incdepgraph> |
---|
11 | <node id="631"> |
---|
12 | <label>libBM.h</label> |
---|
13 | <link refid="libBM_8h"/> |
---|
14 | <childnode refid="628" relation="include"> |
---|
15 | </childnode> |
---|
16 | </node> |
---|
17 | <node id="637"> |
---|
18 | <label>pmsm.h</label> |
---|
19 | <link refid="pmsm_8h-source"/> |
---|
20 | <childnode refid="630" relation="include"> |
---|
21 | </childnode> |
---|
22 | </node> |
---|
23 | <node id="634"> |
---|
24 | <label>../itpp_ext.h</label> |
---|
25 | <link refid="itpp__ext_8h-source"/> |
---|
26 | <childnode refid="628" relation="include"> |
---|
27 | </childnode> |
---|
28 | </node> |
---|
29 | <node id="632"> |
---|
30 | <label>../stat/libEF.h</label> |
---|
31 | <link refid="libEF_8h"/> |
---|
32 | <childnode refid="628" relation="include"> |
---|
33 | </childnode> |
---|
34 | <childnode refid="633" relation="include"> |
---|
35 | </childnode> |
---|
36 | <childnode refid="631" relation="include"> |
---|
37 | </childnode> |
---|
38 | <childnode refid="634" relation="include"> |
---|
39 | </childnode> |
---|
40 | </node> |
---|
41 | <node id="636"> |
---|
42 | <label>estim/libPF.h</label> |
---|
43 | <link refid="libPF_8h"/> |
---|
44 | <childnode refid="628" relation="include"> |
---|
45 | </childnode> |
---|
46 | <childnode refid="632" relation="include"> |
---|
47 | </childnode> |
---|
48 | <childnode refid="633" relation="include"> |
---|
49 | </childnode> |
---|
50 | </node> |
---|
51 | <node id="630"> |
---|
52 | <label>../stat/libFN.h</label> |
---|
53 | <link refid="libFN_8h-source"/> |
---|
54 | <childnode refid="628" relation="include"> |
---|
55 | </childnode> |
---|
56 | <childnode refid="631" relation="include"> |
---|
57 | </childnode> |
---|
58 | </node> |
---|
59 | <node id="628"> |
---|
60 | <label>itpp/itbase.h</label> |
---|
61 | </node> |
---|
62 | <node id="635"> |
---|
63 | <label>../math/chmat.h</label> |
---|
64 | <link refid="chmat_8h"/> |
---|
65 | <childnode refid="628" relation="include"> |
---|
66 | </childnode> |
---|
67 | <childnode refid="633" relation="include"> |
---|
68 | </childnode> |
---|
69 | <childnode refid="634" relation="include"> |
---|
70 | </childnode> |
---|
71 | </node> |
---|
72 | <node id="629"> |
---|
73 | <label>estim/libKF.h</label> |
---|
74 | <link refid="libKF_8h"/> |
---|
75 | <childnode refid="628" relation="include"> |
---|
76 | </childnode> |
---|
77 | <childnode refid="630" relation="include"> |
---|
78 | </childnode> |
---|
79 | <childnode refid="632" relation="include"> |
---|
80 | </childnode> |
---|
81 | <childnode refid="635" relation="include"> |
---|
82 | </childnode> |
---|
83 | </node> |
---|
84 | <node id="633"> |
---|
85 | <label>../math/libDC.h</label> |
---|
86 | <link refid="libDC_8h"/> |
---|
87 | <childnode refid="628" relation="include"> |
---|
88 | </childnode> |
---|
89 | </node> |
---|
90 | <node id="627"> |
---|
91 | <label>work/git/mixpp/pmsm/pmsm_unkQ.cpp</label> |
---|
92 | <link refid="pmsm_unkQ.cpp"/> |
---|
93 | <childnode refid="628" relation="include"> |
---|
94 | </childnode> |
---|
95 | <childnode refid="629" relation="include"> |
---|
96 | </childnode> |
---|
97 | <childnode refid="636" relation="include"> |
---|
98 | </childnode> |
---|
99 | <childnode refid="630" relation="include"> |
---|
100 | </childnode> |
---|
101 | <childnode refid="637" relation="include"> |
---|
102 | </childnode> |
---|
103 | </node> |
---|
104 | </incdepgraph> |
---|
105 | <sectiondef kind="func"> |
---|
106 | <memberdef kind="function" id="pmsm__unkQ_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
107 | <type>int</type> |
---|
108 | <definition>int main</definition> |
---|
109 | <argsstring>()</argsstring> |
---|
110 | <name>main</name> |
---|
111 | <briefdescription> |
---|
112 | </briefdescription> |
---|
113 | <detaileddescription> |
---|
114 | </detaileddescription> |
---|
115 | <inbodydescription> |
---|
116 | </inbodydescription> |
---|
117 | <location file="/home/smidl/work/git/mixpp/pmsm/pmsm_unkQ.cpp" line="30" bodyfile="/home/smidl/work/git/mixpp/pmsm/pmsm_unkQ.cpp" bodystart="30" bodyend="107"/> |
---|
118 | </memberdef> |
---|
119 | </sectiondef> |
---|
120 | <briefdescription> |
---|
121 | </briefdescription> |
---|
122 | <detaileddescription> |
---|
123 | </detaileddescription> |
---|
124 | <programlisting> |
---|
125 | <codeline lineno="1"><highlight class="comment">/*</highlight></codeline> |
---|
126 | <codeline lineno="2"><highlight class="comment"><sp/><sp/>\file</highlight></codeline> |
---|
127 | <codeline lineno="3"><highlight class="comment"><sp/><sp/>\brief<sp/>Models<sp/>for<sp/>synchronous<sp/>electric<sp/>drive<sp/>using<sp/>IT++<sp/>and<sp/>BDM</highlight></codeline> |
---|
128 | <codeline lineno="4"><highlight class="comment"><sp/><sp/>\author<sp/>Vaclav<sp/>Smidl.</highlight></codeline> |
---|
129 | <codeline lineno="5"><highlight class="comment"></highlight></codeline> |
---|
130 | <codeline lineno="6"><highlight class="comment"><sp/><sp/>-----------------------------------</highlight></codeline> |
---|
131 | <codeline lineno="7"><highlight class="comment"><sp/><sp/>BDM++<sp/>-<sp/>C++<sp/>library<sp/>for<sp/>Bayesian<sp/>Decision<sp/>Making<sp/>under<sp/>Uncertainty</highlight></codeline> |
---|
132 | <codeline lineno="8"><highlight class="comment"></highlight></codeline> |
---|
133 | <codeline lineno="9"><highlight class="comment"><sp/><sp/>Using<sp/>IT++<sp/>for<sp/>numerical<sp/>operations</highlight></codeline> |
---|
134 | <codeline lineno="10"><highlight class="comment"><sp/><sp/>-----------------------------------</highlight></codeline> |
---|
135 | <codeline lineno="11"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline> |
---|
136 | <codeline lineno="12"><highlight class="normal"></highlight></codeline> |
---|
137 | <codeline lineno="13"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><itpp/itbase.h></highlight><highlight class="normal"></highlight></codeline> |
---|
138 | <codeline lineno="14"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="libKF_8h" kindref="compound" tooltip="Bayesian Filtering for linear Gaussian models (Kalman Filter) and extensions.">estim/libKF.h</ref>></highlight><highlight class="normal"></highlight></codeline> |
---|
139 | <codeline lineno="15"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="libPF_8h" kindref="compound" tooltip="Bayesian Filtering using stochastic sampling (Particle Filters).">estim/libPF.h</ref>></highlight><highlight class="normal"></highlight></codeline> |
---|
140 | <codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><stat/libFN.h></highlight><highlight class="normal"></highlight></codeline> |
---|
141 | <codeline lineno="17"><highlight class="normal"></highlight></codeline> |
---|
142 | <codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"pmsm.h"</highlight><highlight class="normal"></highlight></codeline> |
---|
143 | <codeline lineno="19"><highlight class="normal"></highlight></codeline> |
---|
144 | <codeline lineno="20"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline> |
---|
145 | <codeline lineno="21"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline> |
---|
146 | <codeline lineno="22"><highlight class="comment">//<sp/>PMSM<sp/>with<sp/>Q<sp/>on<sp/>Ia<sp/>and<sp/>Ib<sp/>given<sp/>externally</highlight></codeline> |
---|
147 | <codeline lineno="23"><highlight class="comment">class<sp/>EKF_unQ<sp/>:<sp/>public<sp/>EKF<chmat><sp/>,<sp/>public<sp/>BMcond<sp/>{</highlight></codeline> |
---|
148 | <codeline lineno="24"><highlight class="comment">public:</highlight></codeline> |
---|
149 | <codeline lineno="25"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>EKF_unQ(<sp/>rx,ry,ru,rQ):EKF<chmat>(rx,ry,ru),BMcond(rQ){};</highlight></codeline> |
---|
150 | <codeline lineno="26"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>void<sp/>condition(const<sp/>vec<sp/>&Q0){};</highlight></codeline> |
---|
151 | <codeline lineno="27"><highlight class="comment">};*/</highlight><highlight class="normal"></highlight></codeline> |
---|
152 | <codeline lineno="28"><highlight class="normal"></highlight></codeline> |
---|
153 | <codeline lineno="29"><highlight class="normal"></highlight></codeline> |
---|
154 | <codeline lineno="30"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="sim__var_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" kindref="member" tooltip="Extended Kalman filter with unknown Q.">main</ref>()<sp/>{</highlight></codeline> |
---|
155 | <codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Kalman<sp/>filter</highlight><highlight class="normal"></highlight></codeline> |
---|
156 | <codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Ndat<sp/>=<sp/>1000;</highlight></codeline> |
---|
157 | <codeline lineno="33"><highlight class="normal"></highlight></codeline> |
---|
158 | <codeline lineno="34"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/><<<sp/>KF;</highlight><highlight class="normal"></highlight></codeline> |
---|
159 | <codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>internal<sp/>model</highlight><highlight class="normal"></highlight></codeline> |
---|
160 | <codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classIMpmsm" kindref="compound" tooltip="State evolution model for a PMSM drive and its derivative with respect to $.">IMpmsm</ref><sp/>fxu;</highlight></codeline> |
---|
161 | <codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Rs<sp/><sp/><sp/><sp/>Ls<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dt<sp/><sp/><sp/><sp/><sp/><sp/><sp/>Fmag(Ypm)<sp/>kp<sp/><sp/><sp/>p<sp/><sp/><sp/><sp/>J<sp/><sp/><sp/><sp/><sp/>Bf(Mz)</highlight><highlight class="normal"></highlight></codeline> |
---|
162 | <codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fxu.<ref refid="classIMpmsm_142818f3426d99fecb7e97be8ffe2e228" kindref="member" tooltip="Set mechanical and electrical variables.">set_parameters</ref><sp/>(<sp/>0.28,<sp/>0.003465,<sp/>20*1e-6,<sp/>0.1989,<sp/><sp/><sp/>1.5<sp/>,4.0,<sp/>0.04,<sp/>0.0<sp/>);</highlight></codeline> |
---|
163 | <codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>observation<sp/>model</highlight><highlight class="normal"></highlight></codeline> |
---|
164 | <codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classOMpmsm" kindref="compound" tooltip="Observation model for PMSM drive and its derivative with respect to .">OMpmsm</ref><sp/>hxu;</highlight></codeline> |
---|
165 | <codeline lineno="41"><highlight class="normal"></highlight></codeline> |
---|
166 | <codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>mu0=<sp/></highlight><highlight class="stringliteral">"100<sp/>100<sp/>100<sp/>1"</highlight><highlight class="normal">;</highlight></codeline> |
---|
167 | <codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Qdiag<sp/>(<sp/></highlight><highlight class="stringliteral">"0.1<sp/>0.1<sp/>0.01<sp/>0.01"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
168 | <codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Rdiag<sp/>(<sp/></highlight><highlight class="stringliteral">"0.02<sp/>0.02"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
169 | <codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>vQ<sp/>=<sp/></highlight><highlight class="stringliteral">"0.01:0.01:100"</highlight><highlight class="normal">;</highlight></codeline> |
---|
170 | <codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>Q<sp/>(<sp/>Qdiag<sp/>);</highlight></codeline> |
---|
171 | <codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>R<sp/>(<sp/>Rdiag<sp/>);</highlight></codeline> |
---|
172 | <codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKFCh" kindref="compound" tooltip="Extended Kalman Filter in Square root.">EKFCh</ref><sp/>KFE<sp/>(<sp/>rx,ry,ru<sp/>);</highlight></codeline> |
---|
173 | <codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>KFE.set_est<sp/>(<sp/>mu0,<sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>(<sp/>1000*ones<sp/>(<sp/>4<sp/>)<sp/>)<sp/>);</highlight></codeline> |
---|
174 | <codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>KFE.set_parameters<sp/>(<sp/>&fxu,&hxu,Q,R<sp/>);</highlight></codeline> |
---|
175 | <codeline lineno="51"><highlight class="normal"></highlight></codeline> |
---|
176 | <codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>ll(100,Ndat);</highlight></codeline> |
---|
177 | <codeline lineno="53"><highlight class="normal"></highlight></codeline> |
---|
178 | <codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKFCh" kindref="compound" tooltip="Extended Kalman Filter in Square root.">EKFCh</ref>*<sp/>kfArray[100];</highlight></codeline> |
---|
179 | <codeline lineno="55"><highlight class="normal"></highlight></codeline> |
---|
180 | <codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;i<100;i++<sp/>)<sp/>{</highlight></codeline> |
---|
181 | <codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Qid<sp/>(<sp/>Qdiag<sp/>);</highlight></codeline> |
---|
182 | <codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Qid<sp/>(<sp/>0<sp/>)<sp/>=<sp/>vQ<sp/>(<sp/>i<sp/>);<sp/>Qid<sp/>(<sp/>1<sp/>)<sp/>=<sp/>vQ<sp/>(<sp/>i<sp/>);</highlight></codeline> |
---|
183 | <codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>kfArray[i]=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="classEKFCh" kindref="compound" tooltip="Extended Kalman Filter in Square root.">EKFCh</ref><sp/>(<sp/>rx,ry,ru<sp/>);</highlight></codeline> |
---|
184 | <codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>kfArray[i]-><ref refid="classKalmanCh_1b261b20f6210d4c85131d33302df0adc" kindref="member" tooltip="Set estimate values, used e.g. in initialization.">set_est</ref><sp/>(<sp/>mu0,<sp/><ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>(<sp/>1000*ones<sp/>(<sp/>4<sp/>)<sp/>)<sp/>);</highlight></codeline> |
---|
185 | <codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>kfArray[i]-><ref refid="classEKFCh_10216bed270df59fe65d0d62d41f8257c" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/>&fxu,&hxu,<ref refid="classchmat" kindref="compound" tooltip="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</ref><sp/>(<sp/>Qid<sp/>),R<sp/>);</highlight></codeline> |
---|
186 | <codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
187 | <codeline lineno="63"><highlight class="normal"></highlight></codeline> |
---|
188 | <codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>&<sp/>KFEep<sp/>=<sp/>KFE._epdf();</highlight></codeline> |
---|
189 | <codeline lineno="65"><highlight class="normal"></highlight></codeline> |
---|
190 | <codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//simulator<sp/>values</highlight><highlight class="normal"></highlight></codeline> |
---|
191 | <codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>dt<sp/>(<sp/>2<sp/>);</highlight></codeline> |
---|
192 | <codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>wt<sp/>(<sp/>2<sp/>);</highlight></codeline> |
---|
193 | <codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>ut<sp/>(<sp/>2<sp/>);</highlight></codeline> |
---|
194 | <codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xt=mu0;</highlight></codeline> |
---|
195 | <codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>et<sp/>(<sp/>4<sp/>);</highlight></codeline> |
---|
196 | <codeline lineno="72"><highlight class="normal"></highlight></codeline> |
---|
197 | <codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Xt=zeros<sp/>(<sp/>4,Ndat<sp/>);</highlight></codeline> |
---|
198 | <codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>XtE=zeros<sp/>(<sp/>4,Ndat<sp/>);</highlight></codeline> |
---|
199 | <codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Xt.set_col<sp/>(<sp/>0,KFEep.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>()<sp/>);</highlight></codeline> |
---|
200 | <codeline lineno="76"><highlight class="normal"></highlight></codeline> |
---|
201 | <codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t=1;t<Ndat;t++<sp/>)<sp/>{</highlight></codeline> |
---|
202 | <codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//simulator</highlight><highlight class="normal"></highlight></codeline> |
---|
203 | <codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>UniRNG.sample_vector<sp/>(<sp/>2,wt<sp/>);</highlight></codeline> |
---|
204 | <codeline lineno="80"><highlight class="normal"></highlight></codeline> |
---|
205 | <codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>rem<sp/>(<sp/>t,500<sp/>)<sp/><200<sp/>)<sp/>ut<sp/>=<sp/>rem<sp/>(<sp/>t,500<sp/>)<sp/>*ones<sp/>(<sp/>2<sp/>);</highlight></codeline> |
---|
206 | <codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline> |
---|
207 | <codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ut=zeros<sp/>(<sp/>2<sp/>);</highlight></codeline> |
---|
208 | <codeline lineno="84"><highlight class="normal"></highlight></codeline> |
---|
209 | <codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NorRNG.sample_vector<sp/>(<sp/>4,et<sp/>);</highlight></codeline> |
---|
210 | <codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NorRNG.sample_vector<sp/>(<sp/>2,wt<sp/>);</highlight></codeline> |
---|
211 | <codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xt<sp/>=<sp/>fxu.<ref refid="classIMpmsm_145785869d978dda42828a072ec2caebe" kindref="member" tooltip="Evaluates .">eval</ref><sp/>(<sp/>xt,ut<sp/>)<sp/>+<sp/>Q.sqrt_mult<sp/>(<sp/>et<sp/>);</highlight></codeline> |
---|
212 | <codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dt<sp/>=<sp/>hxu.<ref refid="classOMpmsm_18e32392c9c635584606287b8c0e8c9da" kindref="member" tooltip="Evaluates .">eval</ref><sp/>(<sp/>xt,ut<sp/>)<sp/>+<sp/>R.sqrt_mult<sp/>(<sp/>wt<sp/>);</highlight></codeline> |
---|
213 | <codeline lineno="89"><highlight class="normal"></highlight></codeline> |
---|
214 | <codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//estimator</highlight><highlight class="normal"></highlight></codeline> |
---|
215 | <codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>KFE.bayes<sp/>(<sp/>concat<sp/>(<sp/>dt,ut<sp/>)<sp/>);</highlight></codeline> |
---|
216 | <codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;i<100;i++<sp/>)<sp/>{kfArray[i]-><ref refid="classEKFCh_196f6edda324a0b7ef8b4e86cc7af60c1" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref>(<sp/>concat<sp/>(<sp/>dt,ut<sp/>)<sp/>);ll(i,t)=ll(i,t-1)<sp/>+<sp/>kfArray[i]-><ref refid="classBM_187f4a547d2c29180be88175e5eab9c88" kindref="member" tooltip="access function">_ll</ref>();</highlight></codeline> |
---|
217 | <codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
218 | <codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
219 | <codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Xt.set_col<sp/>(<sp/>t,xt<sp/>);</highlight></codeline> |
---|
220 | <codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>XtE.set_col<sp/>(<sp/>t,KFEep.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>()<sp/>);</highlight></codeline> |
---|
221 | <codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
222 | <codeline lineno="98"><highlight class="normal"></highlight></codeline> |
---|
223 | <codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_file<sp/>fou<sp/>(<sp/></highlight><highlight class="stringliteral">"pmsm.it"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
224 | <codeline lineno="100"><highlight class="normal"></highlight></codeline> |
---|
225 | <codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fou<sp/><<<sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">"xth"</highlight><highlight class="normal"><sp/>)<sp/><<<sp/>Xt;</highlight></codeline> |
---|
226 | <codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fou<sp/><<<sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">"xthE"</highlight><highlight class="normal"><sp/>)<sp/><<<sp/>XtE;</highlight></codeline> |
---|
227 | <codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fou<sp/><<<sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">"ll"</highlight><highlight class="normal"><sp/>)<sp/><<<sp/>ll;</highlight></codeline> |
---|
228 | <codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Exit<sp/>program:</highlight><highlight class="normal"></highlight></codeline> |
---|
229 | <codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline> |
---|
230 | <codeline lineno="106"><highlight class="normal"></highlight></codeline> |
---|
231 | <codeline lineno="107"><highlight class="normal">}</highlight></codeline> |
---|
232 | </programlisting> |
---|
233 | <location file="/home/smidl/work/git/mixpp/pmsm/pmsm_unkQ.cpp"/> |
---|
234 | </compounddef> |
---|
235 | </doxygen> |
---|