<?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__arx_8cpp" kind="file">
    <compoundname>sim_var_arx.cpp</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="arx_8h" local="no">estim/arx.h</includes>
    <includes refid="loggers_8h" local="no">stat/loggers.h</includes>
    <incdepgraph>
      <node id="677">
        <label>stat/loggers.h</label>
        <link refid="loggers_8h"/>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="673" relation="include">
        </childnode>
        <childnode refid="676" relation="include">
        </childnode>
      </node>
      <node id="673">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="670" relation="include">
        </childnode>
      </node>
      <node id="676">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="670" relation="include">
        </childnode>
      </node>
      <node id="674">
        <label>../stat/libEF.h</label>
        <link refid="libEF_8h"/>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="675" relation="include">
        </childnode>
        <childnode refid="673" relation="include">
        </childnode>
        <childnode refid="676" relation="include">
        </childnode>
      </node>
      <node id="671">
        <label>estim/arx.h</label>
        <link refid="arx_8h"/>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="672" relation="include">
        </childnode>
        <childnode refid="674" relation="include">
        </childnode>
      </node>
      <node id="672">
        <label>../stat/libFN.h</label>
        <link refid="libFN_8h-source"/>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="673" relation="include">
        </childnode>
      </node>
      <node id="669">
        <label>work/git/mixpp/pmsm/sim_var_arx.cpp</label>
        <link refid="sim_var_arx.cpp"/>
        <childnode refid="670" relation="include">
        </childnode>
        <childnode refid="671" relation="include">
        </childnode>
        <childnode refid="677" relation="include">
        </childnode>
      </node>
      <node id="670">
        <label>itpp/itbase.h</label>
      </node>
      <node id="675">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="670" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="sim__var__arx_8cpp_1b1fe6b48b3275ef1f646350a4fe3fc39" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>vec</type>
        <definition>vec getPsi_a</definition>
        <argsstring>(int t, mat &amp;D, mat &amp;Du, mat &amp;X)</argsstring>
        <name>getPsi_a</name>
        <param>
          <type>int</type>
          <declname>t</declname>
        </param>
        <param>
          <type>mat &amp;</type>
          <declname>D</declname>
        </param>
        <param>
          <type>mat &amp;</type>
          <declname>Du</declname>
        </param>
        <param>
          <type>mat &amp;</type>
          <declname>X</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" line="20" bodyfile="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" bodystart="80" bodyend="90"/>
      </memberdef>
      <memberdef kind="function" id="sim__var__arx_8cpp_14f3629067a336e659e88e55c7a93bc21" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>vec</type>
        <definition>vec getPsi_b</definition>
        <argsstring>(int t, mat &amp;D, mat &amp;Du, mat &amp;X)</argsstring>
        <name>getPsi_b</name>
        <param>
          <type>int</type>
          <declname>t</declname>
        </param>
        <param>
          <type>mat &amp;</type>
          <declname>D</declname>
        </param>
        <param>
          <type>mat &amp;</type>
          <declname>Du</declname>
        </param>
        <param>
          <type>mat &amp;</type>
          <declname>X</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" line="21" bodyfile="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" bodystart="92" bodyend="102"/>
      </memberdef>
      <memberdef kind="function" id="sim__var__arx_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/sim_var_arx.cpp" line="23" bodyfile="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp" bodystart="23" bodyend="78"/>
      </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;<ref refid="arx_8h" kindref="compound" tooltip="Bayesian Filtering for generalized autoregressive (ARX) model.">estim/arx.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><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="17"><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal">vec<sp/>getPsi_a<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&amp;D,<sp/>mat<sp/>&amp;Du<sp/>,<sp/>mat<sp/>&amp;X<sp/>);</highlight></codeline>
<codeline lineno="21"><highlight class="normal">vec<sp/>getPsi_b<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&amp;D,<sp/>mat<sp/>&amp;Du<sp/>,<sp/>mat<sp/>&amp;X<sp/>);</highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><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="24"><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="25"><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="26"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>D;</highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Du;</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>X;</highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><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<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;exp/sim_var_arx&quot;</highlight><highlight class="normal">,1000<sp/>);</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_file<sp/>itf<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;sim_var.it&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>itf<sp/>&gt;&gt;<sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;D&quot;</highlight><highlight class="normal"><sp/>)<sp/>&gt;&gt;<sp/>D;</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>itf<sp/>&gt;&gt;<sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;Du&quot;</highlight><highlight class="normal"><sp/>)<sp/>&gt;&gt;<sp/>Du;</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>itf<sp/>&gt;&gt;<sp/>Name<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;X&quot;</highlight><highlight class="normal"><sp/>)<sp/>&gt;&gt;<sp/>X;</highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Array&lt;std::string&gt;<sp/>Names<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;{ia<sp/>ib<sp/>om<sp/>dom<sp/>r<sp/>}&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rglen<sp/>=<sp/>Names.length();</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Regressor</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><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/>rgr<sp/>(<sp/>Names<sp/>);</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>V0<sp/>=<sp/>0.0001*eye<sp/>(<sp/>rglen<sp/>);<sp/>V0<sp/>(<sp/>0,0<sp/>)<sp/>=200;</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu0<sp/>=<sp/>rglen+1;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Autoregressive<sp/>model</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX" kindref="compound" tooltip="Linear Autoregressive model with Gaussian noise.">ARX</ref><sp/>Ar_a<sp/>(<sp/>rgr,V0,nu0<sp/>,0.95<sp/>);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX" kindref="compound" tooltip="Linear Autoregressive model with Gaussian noise.">ARX</ref><sp/>Ar_b<sp/>(<sp/>rgr,V0,nu0<sp/>,0.95<sp/>);</highlight></codeline>
<codeline lineno="47"><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/>pA=<sp/>Ar_a._epdf();</highlight></codeline>
<codeline lineno="48"><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/>pB=<sp/>Ar_b._epdf();</highlight></codeline>
<codeline lineno="49"><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><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/>rta<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;{th_a<sp/>}&quot;</highlight><highlight class="normal">,vec_1<sp/>(<sp/>rglen<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="51"><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/>rtb<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;{th_b<sp/>}&quot;</highlight><highlight class="normal">,vec_1<sp/>(<sp/>rglen<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>tha_log<sp/>=<sp/>L.add<sp/>(<sp/>rta,</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>thb_log<sp/>=<sp/>L.add<sp/>(<sp/>rtb,</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.init();</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Psi<sp/>(<sp/>rglen<sp/>);</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Save<sp/>(<sp/>13<sp/>);</highlight></codeline>
<codeline lineno="58"><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=2;<sp/>t&lt;Ndat;<sp/>t++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>=getPsi_a<sp/>(<sp/>t,<sp/>D,Du<sp/>,X<sp/>);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar_a.bayes<sp/>(<sp/>Psi<sp/>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>=getPsi_b<sp/>(<sp/>t,<sp/>D,Du<sp/>,X<sp/>);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar_b.bayes<sp/>(<sp/>Psi<sp/>);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Save<sp/>=<sp/>pA.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>();</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.logit<sp/>(<sp/>tha_log,<sp/>Save<sp/>);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Save<sp/>=<sp/>pB.<ref refid="classepdf_1bf0a070a8f3e67a93604ca724638b870" kindref="member" tooltip="return expected value">mean</ref>();</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.logit<sp/>(<sp/>thb_log,<sp/>Save<sp/>);</highlight></codeline>
<codeline lineno="68"><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="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.finalize();</highlight></codeline>
<codeline lineno="71"><highlight class="normal"></highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>bestind<sp/>=<sp/>Ar_a.structure_est<sp/>(<sp/><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>(<sp/>rgr,V0,nu0<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>bestind2<sp/>=<sp/>Ar_b.structure_est<sp/>(<sp/><ref refid="classegiw" kindref="compound" tooltip="Gauss-inverse-Wishart density stored in LD form.">egiw</ref><sp/>(<sp/>rgr,V0,nu0<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>bestind<sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>bestind2<sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight></codeline>
<codeline lineno="77"><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="78"><highlight class="normal">}</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal">vec<sp/>getPsi_a<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&amp;D,<sp/>mat<sp/>&amp;Du,<sp/>mat<sp/>&amp;X<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Psi<sp/>(<sp/>5<sp/>);</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>0<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,0<sp/>)-Du<sp/>(<sp/>t,0<sp/>);<sp/></highlight><highlight class="comment">//<sp/>a=0</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>1<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,2<sp/>);</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>2<sp/>)<sp/>=<sp/>D(t,2)-D(t-1,2<sp/>);</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>3<sp/>)<sp/>=<sp/>D(t,0)-D(t-1,0<sp/>);</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>4<sp/>)<sp/>=<sp/>X<sp/>(<sp/>t,2<sp/>)<sp/>-<sp/>X<sp/>(<sp/>t-1,2<sp/>);</highlight></codeline>
<codeline lineno="88"><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>Psi;</highlight></codeline>
<codeline lineno="90"><highlight class="normal">}</highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal">vec<sp/>getPsi_b<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t,<sp/>mat<sp/>&amp;D,<sp/>mat<sp/>&amp;Du,<sp/>mat<sp/>&amp;X<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>Psi<sp/>(<sp/>5<sp/>);</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>0<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,1<sp/>)-Du<sp/>(<sp/>t,1<sp/>);<sp/></highlight><highlight class="comment">//b=1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>1<sp/>)<sp/>=<sp/>D(t,3);</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>2<sp/>)<sp/>=<sp/>D(t,3)-D(t-1,3<sp/>);</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>3<sp/>)<sp/>=<sp/>D<sp/>(<sp/>t,1<sp/>)-D(t-1,1);</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Psi<sp/>(<sp/>4<sp/>)<sp/>=<sp/>X<sp/>(<sp/>t,2<sp/>)<sp/>-<sp/>X<sp/>(<sp/>t-1,2<sp/>);</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">return</highlight><highlight class="normal"><sp/>Psi;</highlight></codeline>
<codeline lineno="102"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/pmsm/sim_var_arx.cpp"/>
  </compounddef>
</doxygen>
