<?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="sim__var_8cpp" kind="file">
    <compoundname>sim_var.cpp</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="libFN_8h" local="no">stat/libFN.h</includes>
    <includes refid="libKF_8h" local="no">estim/libKF.h</includes>
    <includes refid="chmat_8h" local="no">math/chmat.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="666">
        <label>sim_profiles.h</label>
        <link refid="sim__profiles_8h-source"/>
      </node>
      <node id="667">
        <label>stat/loggers.h</label>
        <link refid="loggers_8h"/>
        <childnode refid="656" relation="include">
        </childnode>
        <childnode refid="658" relation="include">
        </childnode>
        <childnode refid="662" relation="include">
        </childnode>
      </node>
      <node id="658">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="656" relation="include">
        </childnode>
      </node>
      <node id="665">
        <label>simulator.h</label>
        <link refid="simulator_8h-source"/>
      </node>
      <node id="664">
        <label>pmsm.h</label>
        <link refid="pmsm_8h-source"/>
        <childnode refid="657" relation="include">
        </childnode>
      </node>
      <node id="662">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="656" relation="include">
        </childnode>
      </node>
      <node id="660">
        <label>../stat/libEF.h</label>
        <link refid="libEF_8h"/>
        <childnode refid="656" relation="include">
        </childnode>
        <childnode refid="661" relation="include">
        </childnode>
        <childnode refid="658" relation="include">
        </childnode>
        <childnode refid="662" relation="include">
        </childnode>
      </node>
      <node id="657">
        <label>stat/libFN.h</label>
        <link refid="libFN_8h-source"/>
        <childnode refid="656" relation="include">
        </childnode>
        <childnode refid="658" relation="include">
        </childnode>
      </node>
      <node id="655">
        <label>work/git/mixpp/pmsm/sim_var.cpp</label>
        <link refid="sim_var.cpp"/>
        <childnode refid="656" relation="include">
        </childnode>
        <childnode refid="657" relation="include">
        </childnode>
        <childnode refid="659" relation="include">
        </childnode>
        <childnode refid="663" relation="include">
        </childnode>
        <childnode refid="664" relation="include">
        </childnode>
        <childnode refid="665" relation="include">
        </childnode>
        <childnode refid="666" relation="include">
        </childnode>
        <childnode refid="667" relation="include">
        </childnode>
      </node>
      <node id="656">
        <label>itpp/itbase.h</label>
      </node>
      <node id="663">
        <label>../math/chmat.h</label>
        <link refid="chmat_8h"/>
        <childnode refid="656" relation="include">
        </childnode>
        <childnode refid="661" relation="include">
        </childnode>
        <childnode refid="662" relation="include">
        </childnode>
      </node>
      <node id="659">
        <label>estim/libKF.h</label>
        <link refid="libKF_8h"/>
        <childnode refid="656" relation="include">
        </childnode>
        <childnode refid="657" relation="include">
        </childnode>
        <childnode refid="660" relation="include">
        </childnode>
        <childnode refid="663" relation="include">
        </childnode>
      </node>
      <node id="661">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="656" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="sim__var_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>
<para>Extended <ref refid="classKalman" kindref="compound">Kalman</ref> filter with unknown <computeroutput>Q</computeroutput>. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/sim_var.cpp" line="28" bodyfile="/home/smidl/work/git/mixpp/pmsm/sim_var.cpp" bodystart="28" bodyend="166"/>
        <references refid="classEKFfull_14080d68f79dade36ccf547d57e64bdc2" compoundref="libKF_8h" startline="188" endline="188">EKFfull::_epdf</references>
        <references refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" compoundref="loggers_8h" startline="39" endline="45">logger::add</references>
        <references refid="classEKFfull_18ca46f177e395fa714bbd8bd29ea43e0" compoundref="libKF_8cpp" startline="86" endline="114">EKFfull::bayes</references>
        <references refid="classOMpmsm_18e32392c9c635584606287b8c0e8c9da" compoundref="pmsm_8h" startline="128" endline="133">OMpmsm::eval</references>
        <references refid="classIMpmsm_145785869d978dda42828a072ec2caebe" compoundref="pmsm_8h" startline="25" endline="46">IMpmsm::eval</references>
        <references refid="classdirfilelog_14d671baf6f88444d7fe25a5b8a80834a" compoundref="loggers_8cpp" startline="128" endline="131">dirfilelog::finalize</references>
        <references refid="classdirfilelog_1afeaebe003110f9db1ac43edf8e53a92" compoundref="loggers_8cpp" startline="25" endline="74">dirfilelog::init</references>
        <references refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" compoundref="loggers_8h" startline="88" endline="90">memlog::logit</references>
        <references refid="classepdf_1bf0a070a8f3e67a93604ca724638b870">epdf::mean</references>
        <references refid="classEKFfull_17bb76ea74c144ea0b36db99f94750b7b" compoundref="libKF_8h" startline="186" endline="186">EKFfull::set_est</references>
        <references refid="classEKFfull_1fc753106e0d4cf68e4f2160fd54458c0" compoundref="libKF_8cpp" startline="66" endline="84">EKFfull::set_parameters</references>
        <references refid="classIMpmsm_142818f3426d99fecb7e97be8ffe2e228" compoundref="pmsm_8h" startline="23" endline="23">IMpmsm::set_parameters</references>
        <references refid="classdirfilelog_1f5fe9483a041591bfe6f3d6393b02aa7" compoundref="loggers_8cpp" startline="117" endline="126">dirfilelog::step</references>
      </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="libKF_8h" kindref="compound" tooltip="Bayesian Filtering for linear Gaussian models (Kalman Filter) and extensions.">estim/libKF.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="comment">//#include<sp/>&lt;estim/libPF.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="chmat_8h" kindref="compound" tooltip="Matrices in decomposed forms (LDL&amp;#39;, LU, UDU&amp;#39;, etc).">math/chmat.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="27"><highlight class="normal"></highlight></codeline>
<codeline lineno="28" refid="sim__var_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" refkind="member"><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="29"><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="30"><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="31"><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="32"><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="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/sim_var&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/>dut<sp/>(<sp/>2<sp/>);</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>dit<sp/>(2);</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xtm=zeros<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xte=zeros<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xdif=zeros<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xt<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>ddif=zeros(2);</highlight></codeline>
<codeline lineno="49"><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="50"><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="51"><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="52"><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="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Qt=zeros<sp/>(<sp/>4,4<sp/>);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Rt=zeros<sp/>(<sp/>2,2<sp/>);</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><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="57"><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="58"><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="59"><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="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Q<sp/>=diag(<sp/>Qdiag<sp/>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>R<sp/>=diag<sp/>(<sp/>Rdiag<sp/>);</highlight></codeline>
<codeline lineno="62"><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="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Efix.<ref refid="classEKFfull_17bb76ea74c144ea0b36db99f94750b7b" kindref="member" tooltip="set estimates">set_est</ref><sp/>(<sp/>mu0,<sp/>1*eye<sp/>(<sp/>4<sp/>)<sp/><sp/>);</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Efix.<ref refid="classEKFfull_1fc753106e0d4cf68e4f2160fd54458c0" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/>&amp;fxu,&amp;hxu,Q,R);</highlight></codeline>
<codeline lineno="65"><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><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/>Eop<sp/>(<sp/>rx,ry,ru<sp/>);</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Eop.<ref refid="classEKFfull_17bb76ea74c144ea0b36db99f94750b7b" kindref="member" tooltip="set estimates">set_est</ref><sp/>(<sp/>mu0,<sp/>1*eye<sp/>(<sp/>4<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Eop.<ref refid="classEKFfull_1fc753106e0d4cf68e4f2160fd54458c0" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/>&amp;fxu,&amp;hxu,Q,R);</highlight></codeline>
<codeline lineno="69"><highlight class="normal"></highlight></codeline>
<codeline lineno="70"><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/>Edi<sp/>(<sp/>rx,ry,ru<sp/>);</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edi.<ref refid="classEKFfull_17bb76ea74c144ea0b36db99f94750b7b" kindref="member" tooltip="set estimates">set_est</ref><sp/>(<sp/>mu0,<sp/>1*eye<sp/>(<sp/>4<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edi.<ref refid="classEKFfull_1fc753106e0d4cf68e4f2160fd54458c0" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/>&amp;fxu,&amp;hxu,Q,R);</highlight></codeline>
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><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.<ref refid="classEKFfull_14080d68f79dade36ccf547d57e64bdc2" kindref="member" tooltip="dummy!">_epdf</ref>();</highlight></codeline>
<codeline lineno="75"><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/>Eop_ep<sp/>=<sp/>Eop.<ref refid="classEKFfull_14080d68f79dade36ccf547d57e64bdc2" kindref="member" tooltip="dummy!">_epdf</ref>();</highlight></codeline>
<codeline lineno="76"><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/>Edi_ep<sp/>=<sp/>Edi.<ref refid="classEKFfull_14080d68f79dade36ccf547d57e64bdc2" kindref="member" tooltip="dummy!">_epdf</ref>();</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//LOG</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><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/>rQ(<sp/></highlight><highlight class="stringliteral">&quot;{Q<sp/>}&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;16&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="80"><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/>rR(<sp/></highlight><highlight class="stringliteral">&quot;{R<sp/>}&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;4&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="81"><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">,<sp/>ones_i(4));</highlight></codeline>
<codeline lineno="82"><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/>rDu(</highlight><highlight class="stringliteral">&quot;{dux<sp/>duy<sp/>duxf<sp/>duyf<sp/>}&quot;</highlight><highlight class="normal">,ones_i(4));</highlight></codeline>
<codeline lineno="83"><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/>rDi(</highlight><highlight class="stringliteral">&quot;{disa<sp/>disb<sp/>}&quot;</highlight><highlight class="normal">,ones_i(2));</highlight></codeline>
<codeline lineno="84"><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.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rx,</highlight><highlight class="stringliteral">&quot;X&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="85"><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.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rx,</highlight><highlight class="stringliteral">&quot;XF&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Eop_log<sp/>=<sp/>L.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rx,</highlight><highlight class="stringliteral">&quot;XO&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Edi_log<sp/>=<sp/>L.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rx,</highlight><highlight class="stringliteral">&quot;XD&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Q_log<sp/>=<sp/>L.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rQ,</highlight><highlight class="stringliteral">&quot;Q&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>R_log<sp/>=<sp/>L.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rR,</highlight><highlight class="stringliteral">&quot;R&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/>D_log<sp/>=<sp/>L.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rUD,</highlight><highlight class="stringliteral">&quot;D&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/>Du_log<sp/>=<sp/>L.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rDu,</highlight><highlight class="stringliteral">&quot;Du&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Di_log<sp/>=<sp/>L.<ref refid="classlogger_1cfb250a559b71e07a1a6aa92f2185c1b" kindref="member" tooltip="returns an identifier which will be later needed for calling the log() function">add</ref>(rDi,</highlight><highlight class="stringliteral">&quot;Di&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classdirfilelog_1afeaebe003110f9db1ac43edf8e53a92" kindref="member" tooltip="Initialize storage.">init</ref>();</highlight></codeline>
<codeline lineno="94"><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><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="96"><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="97"><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="98"><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/>,<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="99"><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="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="101"><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="102"><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="103"><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="104"><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="105"><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="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dut<sp/>(<sp/>0<sp/>)<sp/>=<sp/>KalmanObs[4];</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dut<sp/>(<sp/>1<sp/>)<sp/>=<sp/>KalmanObs[5];</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dit<sp/>(<sp/>0<sp/>)<sp/>=<sp/>KalmanObs[8];</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dit<sp/>(<sp/>1<sp/>)<sp/>=<sp/>KalmanObs[9];</highlight></codeline>
<codeline lineno="110"><highlight class="normal"></highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xte<sp/>=<sp/>fxu.<ref refid="classIMpmsm_145785869d978dda42828a072ec2caebe" kindref="member" tooltip="Evaluates .">eval</ref><sp/>(<sp/>xtm,ut<sp/>);</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Results:</highlight><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">//<sp/>in<sp/>xt<sp/>we<sp/>have<sp/>simulation<sp/>according<sp/>to<sp/>the<sp/>model</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/></highlight><highlight class="comment">//<sp/>in<sp/>x<sp/>we<sp/>have<sp/>&quot;reality&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xt<sp/>(<sp/>0<sp/>)<sp/>=x[0];xt<sp/>(<sp/>1<sp/>)<sp/>=x[1];xt<sp/>(<sp/>2<sp/>)<sp/>=x[2];xt<sp/>(<sp/>3<sp/>)<sp/>=x[3];</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xdif<sp/>=<sp/>xt-xte;<sp/></highlight><highlight class="comment">//xtm<sp/>is<sp/>a<sp/>copy<sp/>of<sp/>x[]</highlight><highlight class="normal"></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><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(xdif(0)&gt;3.0){</highlight></codeline>
<codeline lineno="118"><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/>cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;here&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="119"><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/>}</highlight></codeline>
<codeline lineno="120"><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/>xdif<sp/>(<sp/>3<sp/>)<sp/>&gt;pi<sp/>)<sp/>xdif<sp/>(<sp/>3<sp/>)-=2*pi;</highlight></codeline>
<codeline lineno="121"><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/>xdif<sp/>(<sp/>3<sp/>)<sp/>&lt;-pi<sp/>)<sp/>xdif<sp/>(<sp/>3<sp/>)<sp/>+=2*pi;</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/>ddif<sp/>=<sp/>hxu.<ref refid="classOMpmsm_18e32392c9c635584606287b8c0e8c9da" kindref="member" tooltip="Evaluates .">eval</ref>(xt,ut)<sp/>-<sp/>dit;</highlight></codeline>
<codeline lineno="124"><highlight class="normal"></highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Rt<sp/>=<sp/>0.9*Rt<sp/>+<sp/>xdif^2</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Qt*=0.1;</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Qt<sp/>+=<sp/>10*outer_product<sp/>(<sp/>xdif,xdif<sp/>);<sp/></highlight><highlight class="comment">//(x-xt)^2</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><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/>(Qt(0,0)&gt;3.0){</highlight></codeline>
<codeline lineno="130"><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/>cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;here&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="131"><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/>}</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>For<sp/>future<sp/>ref.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xtm<sp/>=<sp/>xt;</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Rt*=0.1;</highlight></codeline>
<codeline lineno="136"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Rt<sp/>+=<sp/>10*outer_product<sp/>(<sp/>ddif,ddif<sp/>);<sp/>//(x-xt)^2</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="137"><highlight class="normal"></highlight></codeline>
<codeline lineno="138"><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="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Efix.<ref refid="classEKFfull_18ca46f177e395fa714bbd8bd29ea43e0" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref>(concat(dt,ut));</highlight></codeline>
<codeline lineno="140"><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="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Eop.<ref refid="classEKFfull_1fc753106e0d4cf68e4f2160fd54458c0" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/>&amp;fxu,&amp;hxu,(Qt+1e-8*eye(4)),(Rt+1e-6*eye(2)));</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Eop.<ref refid="classEKFfull_18ca46f177e395fa714bbd8bd29ea43e0" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref>(concat(dt,ut));</highlight></codeline>
<codeline lineno="143"><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="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edi.<ref refid="classEKFfull_1fc753106e0d4cf68e4f2160fd54458c0" kindref="member" tooltip="Set nonlinear functions for mean values and covariance matrices.">set_parameters</ref><sp/>(<sp/>&amp;fxu,&amp;hxu,(diag(diag(Qt))+1e-16*eye(4)),<sp/>(diag(diag(Rt))+1e-3*eye(2)));</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edi.<ref refid="classEKFfull_18ca46f177e395fa714bbd8bd29ea43e0" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref>(concat(dt,ut));</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="147"><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="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(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="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(Efix_log,<sp/>Efix_ep.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>()<sp/>);<sp/></highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(Eop_log,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Eop_ep.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>()<sp/>);<sp/></highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(Edi_log,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edi_ep.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>()<sp/>);<sp/></highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(Q_log,<sp/><sp/>vec(Qt._data(),16)<sp/>);<sp/></highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(R_log,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec(Rt._data(),4)<sp/>);<sp/></highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(D_log,<sp/><sp/>vec(KalmanObs,4)<sp/>);<sp/></highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(Du_log,<sp/>dut<sp/>);<sp/></highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classmemlog_18d2feeb826f7249e9104d616b5a67144" kindref="member" tooltip="log this vector">logit</ref>(Di_log,<sp/>dit<sp/>);<sp/></highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classdirfilelog_1f5fe9483a041591bfe6f3d6393b02aa7" kindref="member" tooltip="Shifts storage position for another time step.">step</ref>();</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="160"><highlight class="normal"></highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.<ref refid="classdirfilelog_14d671baf6f88444d7fe25a5b8a80834a" kindref="member" tooltip="Finalize storing information.">finalize</ref>();</highlight></codeline>
<codeline lineno="162"><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="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="164"><highlight class="normal"></highlight></codeline>
<codeline lineno="165"><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="166"><highlight class="normal">}</highlight></codeline>
<codeline lineno="167"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/pmsm/sim_var.cpp"/>
  </compounddef>
</doxygen>
