<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
  <compounddef id="pmsm__mix_8cpp" kind="file">
    <compoundname>pmsm_mix.cpp</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="libFN_8h" local="no">stat/libFN.h</includes>
    <includes refid="emix_8h" local="no">stat/emix.h</includes>
    <includes refid="ekf__templ_8h" local="no">estim/ekf_templ.h</includes>
    <includes refid="libPF_8h" local="no">estim/libPF.h</includes>
    <includes refid="pmsm_8h" local="yes">pmsm.h</includes>
    <includes refid="simulator_8h" local="yes">simulator.h</includes>
    <includes refid="sim__profiles_8h" local="yes">sim_profiles.h</includes>
    <includes refid="loggers_8h" local="no">stat/loggers.h</includes>
    <incdepgraph>
      <node id="581">
        <label>sim_profiles.h</label>
        <link refid="sim__profiles_8h-source"/>
      </node>
      <node id="582">
        <label>stat/loggers.h</label>
        <link refid="loggers_8h"/>
        <childnode refid="568" relation="include">
        </childnode>
        <childnode refid="570" relation="include">
        </childnode>
        <childnode refid="574" relation="include">
        </childnode>
      </node>
      <node id="570">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="568" relation="include">
        </childnode>
      </node>
      <node id="580">
        <label>simulator.h</label>
        <link refid="simulator_8h-source"/>
      </node>
      <node id="571">
        <label>stat/emix.h</label>
        <link refid="emix_8h"/>
        <childnode refid="570" relation="include">
        </childnode>
        <childnode refid="572" relation="include">
        </childnode>
      </node>
      <node id="579">
        <label>pmsm.h</label>
        <link refid="pmsm_8h-source"/>
        <childnode refid="569" relation="include">
        </childnode>
      </node>
      <node id="575">
        <label>estim/ekf_templ.h</label>
        <link refid="ekf__templ_8h"/>
        <childnode refid="576" relation="include">
        </childnode>
      </node>
      <node id="574">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="568" relation="include">
        </childnode>
      </node>
      <node id="572">
        <label>libEF.h</label>
        <link refid="libEF_8h"/>
        <childnode refid="568" relation="include">
        </childnode>
        <childnode refid="573" relation="include">
        </childnode>
        <childnode refid="570" relation="include">
        </childnode>
        <childnode refid="574" relation="include">
        </childnode>
      </node>
      <node id="578">
        <label>estim/libPF.h</label>
        <link refid="libPF_8h"/>
        <childnode refid="568" relation="include">
        </childnode>
        <childnode refid="572" relation="include">
        </childnode>
        <childnode refid="573" relation="include">
        </childnode>
      </node>
      <node id="569">
        <label>stat/libFN.h</label>
        <link refid="libFN_8h-source"/>
        <childnode refid="568" relation="include">
        </childnode>
        <childnode refid="570" relation="include">
        </childnode>
      </node>
      <node id="568">
        <label>itpp/itbase.h</label>
      </node>
      <node id="577">
        <label>../math/chmat.h</label>
        <link refid="chmat_8h"/>
        <childnode refid="568" relation="include">
        </childnode>
        <childnode refid="573" relation="include">
        </childnode>
        <childnode refid="574" relation="include">
        </childnode>
      </node>
      <node id="576">
        <label>libKF.h</label>
        <link refid="libKF_8h"/>
        <childnode refid="568" relation="include">
        </childnode>
        <childnode refid="569" relation="include">
        </childnode>
        <childnode refid="572" relation="include">
        </childnode>
        <childnode refid="577" relation="include">
        </childnode>
      </node>
      <node id="573">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="568" relation="include">
        </childnode>
      </node>
      <node id="567">
        <label>work/git/mixpp/pmsm/pmsm_mix.cpp</label>
        <link refid="pmsm_mix.cpp"/>
        <childnode refid="568" relation="include">
        </childnode>
        <childnode refid="569" relation="include">
        </childnode>
        <childnode refid="571" relation="include">
        </childnode>
        <childnode refid="575" relation="include">
        </childnode>
        <childnode refid="578" relation="include">
        </childnode>
        <childnode refid="579" relation="include">
        </childnode>
        <childnode refid="580" relation="include">
        </childnode>
        <childnode refid="581" relation="include">
        </childnode>
        <childnode refid="582" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="pmsm__mix_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int main</definition>
        <argsstring>()</argsstring>
        <name>main</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/pmsm_mix.cpp" line="27" bodyfile="/home/smidl/work/git/mixpp/pmsm/pmsm_mix.cpp" bodystart="27" bodyend="131"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
<para>Models for synchronous electric drive using IT++ and BDM. </para>    </briefdescription>
    <detaileddescription>
<para><simplesect kind="author"><para>Vaclav Smidl.</para></simplesect>
----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty</para><para>Using IT++ for numerical operations ----------------------------------- </para>    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="13"><highlight class="preprocessor">#include<sp/>&lt;itpp/itbase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;stat/libFN.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="emix_8h" kindref="compound" tooltip="Probability distributions for Mixtures of pdfs.">stat/emix.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="ekf__templ_8h" kindref="compound" tooltip="Bayesian Filtering for linear Gaussian models (Kalman Filter) and extensions.">estim/ekf_templ.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="libPF_8h" kindref="compound" tooltip="Bayesian Filtering using stochastic sampling (Particle Filters).">estim/libPF.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;pmsm.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;simulator.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;sim_profiles.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="loggers_8h" kindref="compound" tooltip="Loggers for storing results of experiments.">stat/loggers.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><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>
<codeline lineno="28"><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>
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Ndat<sp/>=<sp/>90000;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>h<sp/>=<sp/>1e-6;</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Nsimstep<sp/>=<sp/>125;</highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Npar<sp/>=<sp/>10;</highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classdirfilelog" kindref="compound" tooltip="Logging into dirfile with buffer in memory.">dirfilelog</ref><sp/>L(</highlight><highlight class="stringliteral">&quot;exp/pmsm_mix&quot;</highlight><highlight class="normal">,1000);</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//memlog<sp/>L(Ndat);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>SET<sp/>SIMULATOR</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pmsmsim_set_parameters<sp/>(<sp/>0.28,0.003465,0.1989,0.0,4,1.5,0.04,<sp/>200.,<sp/>3e-6,<sp/>h<sp/>);</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ww<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>dt<sp/>(<sp/>2<sp/>);</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>ut<sp/>(<sp/>2<sp/>);</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xtm=zeros<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xdif=zeros<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xt<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>ddif=zeros(2);</highlight></codeline>
<codeline lineno="46"><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>
<codeline lineno="47"><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/><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>
<codeline lineno="48"><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/>Nsimstep*h,<sp/>0.1989,<sp/><sp/><sp/>1.5<sp/>,4.0,<sp/>0.04,<sp/>0.0<sp/>);</highlight></codeline>
<codeline lineno="49"><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>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Qt=zeros<sp/>(<sp/>4,4<sp/>);</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Rt=zeros<sp/>(<sp/>2,2<sp/>);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>ESTIMATORS</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>mu0=<sp/></highlight><highlight class="stringliteral">&quot;0.0<sp/>0.0<sp/>0.0<sp/>0.0&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Qdiag<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;62<sp/>66<sp/>454<sp/>0.03&quot;</highlight><highlight class="normal"><sp/>);<sp/></highlight><highlight class="comment">//zdenek:<sp/>0.01<sp/>0.01<sp/>0.0001<sp/>0.0001</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Rdiag<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;100<sp/>100&quot;</highlight><highlight class="normal"><sp/>);<sp/></highlight><highlight class="comment">//var(diff(xth))<sp/>=<sp/>&quot;0.034<sp/>0.034&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Q<sp/>=diag(<sp/>Qdiag<sp/>);</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>R<sp/>=diag<sp/>(<sp/>Rdiag<sp/>);</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKFfull" kindref="compound" tooltip="Extended Kalman Filter in full matrices.">EKFfull</ref><sp/>Efix<sp/>(<sp/>rx,ry,ru<sp/>);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Efix.set_est<sp/>(<sp/>mu0,<sp/>1*eye<sp/>(<sp/>4<sp/>)<sp/><sp/>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Efix.set_parameters<sp/>(<sp/>&amp;fxu,&amp;hxu,Q,R);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rQR(<sp/></highlight><highlight class="stringliteral">&quot;{Q<sp/>R<sp/>}&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;4<sp/>2<sp/>&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKFful__unQR" kindref="compound" tooltip="Extended Kalman filter with unknown Q and R.">EKFful_unQR</ref><sp/>EKU<sp/>(rx,ry,ru,rQR);</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>EKU.set_est<sp/>(<sp/>mu0,<sp/><sp/>1*ones<sp/>(<sp/>4<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>EKU.set_parameters<sp/>(<sp/>&amp;fxu,&amp;hxu,diag(Qdiag),diag(Rdiag)<sp/>);</highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//QU<sp/>model</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classegamma" kindref="compound" tooltip="Gamma posterior density.">egamma</ref><sp/>Gcom(rQR);Gcom.set_parameters(ones(6),vec(</highlight><highlight class="stringliteral">&quot;1<sp/>1<sp/>1e4<sp/>1e10<sp/>1<sp/>1&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>Gcom.mean()<sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="71"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>Gcom.sample()<sp/>&lt;&lt;endl;*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classeuni" kindref="compound" tooltip="Uniform distributed density on a rectangular support.">euni</ref><sp/>Ucom(rQR);<sp/>Ucom.set_parameters(zeros(6),vec(</highlight><highlight class="stringliteral">&quot;60<sp/>60<sp/>453<sp/>0.03<sp/>100<sp/>100&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="73"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>Ucom.mean()<sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="74"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>Ucom.sample()<sp/>&lt;&lt;endl;*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array&lt;epdf*&gt;<sp/>Coms(2);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Coms(0)<sp/>=<sp/>&amp;Gcom;</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Coms(1)<sp/>=<sp/>&amp;Ucom;</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classemix" kindref="compound" tooltip="Mixture of epdfs.">emix</ref><sp/>Eevol(rQR);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Eevol.set_parameters(</highlight><highlight class="stringliteral">&quot;0.1<sp/>0.9&quot;</highlight><highlight class="normal">,<sp/>Coms);</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>Eevol.sample()<sp/>&lt;&lt;endl;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classmepdf" kindref="compound" tooltip="Unconditional mpdf, allows using epdf in the role of mpdf.">mepdf</ref><sp/>evolQR(Eevol);</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classMPF" kindref="compound" tooltip="Marginalized Particle filter.">MPF&lt;EKFful_unQR&gt;</ref><sp/>M<sp/>(<sp/>rx,rQR,<sp/>evolQR,<sp/>evolQR,<sp/>Npar,<sp/>EKU<sp/>);</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>M.set_est<sp/>(<sp/>evolQR._epdf()<sp/>);</highlight></codeline>
<codeline lineno="84"><highlight class="normal"></highlight></codeline>
<codeline lineno="85"><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>&amp;<sp/>Efix_ep<sp/>=<sp/>Efix._epdf();</highlight></codeline>
<codeline lineno="86"><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>&amp;<sp/>M_ep<sp/>=<sp/>M._epdf();</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//LOG</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rUD(<sp/></highlight><highlight class="stringliteral">&quot;{u_isa<sp/>u_isb<sp/>i_isa<sp/>i_isb<sp/>}&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>X_log<sp/>=<sp/>L.add(rx,</highlight><highlight class="stringliteral">&quot;X&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Efix_log<sp/>=<sp/>L.add(rx,</highlight><highlight class="stringliteral">&quot;XF&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>tmp=concat(rQR,rx);</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>M_log<sp/>=<sp/>L.add(tmp,</highlight><highlight class="stringliteral">&quot;M&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.init();</highlight></codeline>
<codeline lineno="95"><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>dum=0.0;</highlight></codeline>
<codeline lineno="97"><highlight class="normal">vec<sp/>dumvec<sp/>=<sp/>vec_1(1.0);</highlight></codeline>
<codeline lineno="98"><highlight class="normal">vec<sp/>z=<sp/><sp/>evolQR.samplecond(dumvec,dum)<sp/>;</highlight></codeline>
<codeline lineno="99"><highlight class="normal">cout<sp/>&lt;&lt;<sp/>z<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="100"><highlight class="normal"></highlight></codeline>
<codeline lineno="101"><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/>tK=1;tK&lt;Ndat;tK++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Number<sp/>of<sp/>steps<sp/>of<sp/>a<sp/>simulator<sp/>for<sp/>one<sp/>step<sp/>of<sp/>Kalman</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="103"><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/>ii=0;<sp/>ii&lt;Nsimstep;ii++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="104"><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/>sim_profile_steps1<sp/>(<sp/>Ww,<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="105"><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/>pmsmsim_step<sp/>(<sp/>Ww<sp/>);</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>simulation<sp/>via<sp/>deterministic<sp/>model</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ut<sp/>(<sp/>0<sp/>)<sp/>=<sp/>KalmanObs[0];</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ut<sp/>(<sp/>1<sp/>)<sp/>=<sp/>KalmanObs[1];</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dt<sp/>(<sp/>0<sp/>)<sp/>=<sp/>KalmanObs[2];</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dt<sp/>(<sp/>1<sp/>)<sp/>=<sp/>KalmanObs[3];</highlight></codeline>
<codeline lineno="112"><highlight class="normal"></highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ESTIMATE</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Efix.bayes(concat(dt,ut));</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>M.bayes(concat(dt,ut));</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//LOG</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.logit(X_log,<sp/><sp/>vec(x,4));<sp/></highlight><highlight class="comment">//vec<sp/>from<sp/>C-array</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.logit(Efix_log,<sp/>Efix_ep.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>()<sp/>);<sp/></highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.logit(M_log,<sp/><sp/>M_ep.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>()<sp/>);<sp/></highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.step();</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="125"><highlight class="normal"></highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.finalize();</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//L.itsave(&quot;sim_var.it&quot;);<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="129"><highlight class="normal"></highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="131"><highlight class="normal">}</highlight></codeline>
<codeline lineno="132"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/pmsm/pmsm_mix.cpp"/>
  </compounddef>
</doxygen>
