<?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_8h" kind="file">
    <compoundname>pmsm.h</compoundname>
    <includes refid="libFN_8h" local="no">stat/libFN.h</includes>
    <includedby refid="pmsm__mix_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_mix.cpp</includedby>
    <includedby refid="pmsm__sim_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_sim.cpp</includedby>
    <includedby refid="pmsm__sim2_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_sim2.cpp</includedby>
    <includedby refid="pmsm__sim3_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_sim3.cpp</includedby>
    <includedby refid="pmsm__unkQ_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_unkQ.cpp</includedby>
    <includedby refid="pmsm__unkQpf_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_unkQpf.cpp</includedby>
    <includedby refid="sim__var_8cpp" local="yes">work/git/mixpp/pmsm/sim_var.cpp</includedby>
    <includedby refid="testbidiff_8cpp" local="yes">work/git/mixpp/pmsm/testbidiff.cpp</includedby>
    <incdepgraph>
      <node id="563">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="562" relation="include">
        </childnode>
      </node>
      <node id="560">
        <label>work/git/mixpp/pmsm/pmsm.h</label>
        <link refid="pmsm.h"/>
        <childnode refid="561" relation="include">
        </childnode>
      </node>
      <node id="561">
        <label>stat/libFN.h</label>
        <link refid="libFN_8h-source"/>
        <childnode refid="562" relation="include">
        </childnode>
        <childnode refid="563" relation="include">
        </childnode>
      </node>
      <node id="562">
        <label>itpp/itbase.h</label>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="564">
        <label>work/git/mixpp/pmsm/pmsm.h</label>
        <link refid="pmsm.h"/>
        <childnode refid="565" relation="include">
        </childnode>
        <childnode refid="566" relation="include">
        </childnode>
      </node>
      <node id="566">
        <label>work/git/mixpp/pmsm/sim_var.cpp</label>
        <link refid="sim__var_8cpp"/>
      </node>
      <node id="565">
        <label>work/git/mixpp/pmsm/pmsm_mix.cpp</label>
        <link refid="pmsm__mix_8cpp"/>
      </node>
    </invincdepgraph>
    <innerclass refid="classIMpmsm" prot="public">IMpmsm</innerclass>
    <innerclass refid="classIMpmsmStat" prot="public">IMpmsmStat</innerclass>
    <innerclass refid="classOMpmsm" prot="public">OMpmsm</innerclass>
      <sectiondef kind="func">
      <memberdef kind="function" id="pmsm_8h_1d82cfa6804c0679a7bd248ef045de3f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classRV" kindref="compound">RV</ref></type>
        <definition>RV rx</definition>
        <argsstring>(&quot;{ia ib om th }&quot;)</argsstring>
        <name>rx</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h" line="7"/>
      </memberdef>
      <memberdef kind="function" id="pmsm_8h_125f104769603791ae5d508dcfcd0aa50" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classRV" kindref="compound">RV</ref></type>
        <definition>RV ru</definition>
        <argsstring>(&quot;{ua ub }&quot;)</argsstring>
        <name>ru</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h" line="8"/>
      </memberdef>
      <memberdef kind="function" id="pmsm_8h_17961bfdfac2b069de327d4922319111e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classRV" kindref="compound">RV</ref></type>
        <definition>RV ry</definition>
        <argsstring>(&quot;{oia oib }&quot;)</argsstring>
        <name>ry</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h" line="9"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#ifndef<sp/>PMSM_H</highlight></codeline>
<codeline lineno="2"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>PMSM_H</highlight></codeline>
<codeline lineno="3"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;stat/libFN.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="comment">//TODO<sp/>hardcoded<sp/>RVs!!!</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rx<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;{ia<sp/>ib<sp/>om<sp/>th<sp/>}&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="8"><highlight class="normal"><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>ru<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;{ua<sp/>ub<sp/>}&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="9"><highlight class="normal"><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>ry<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;{oia<sp/>oib<sp/>}&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="comment">//<sp/>class<sp/>uipmsm<sp/>:<sp/>public<sp/>uibase{</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>double<sp/>Rs,<sp/>Ls,<sp/>dt,<sp/>Ypm,<sp/>kp,<sp/>p,<sp/><sp/>J,<sp/>Mz;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="comment">//<sp/>};</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
<codeline lineno="16" refid="classIMpmsm" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classIMpmsm" kindref="compound" tooltip="State evolution model for a PMSM drive and its derivative with respect to $.">IMpmsm</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref><sp/>{</highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Rs,<sp/>Ls,<sp/>dt,<sp/>Ypm,<sp/>kp,<sp/>p,<sp/><sp/>J,<sp/>Mz;</highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="21"><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/>:<ref refid="classdiffbifn_1797772c0d5aab8ddccec19dfe4bb2d77" kindref="member" tooltip="Default constructor (dimy is not set!).">diffbifn</ref><sp/>(rx.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>(),<sp/>rx,<sp/>ru<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="23" refid="classIMpmsm_142818f3426d99fecb7e97be8ffe2e228" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classIMpmsm_142818f3426d99fecb7e97be8ffe2e228" kindref="member" tooltip="Set mechanical and electrical variables.">set_parameters</ref><sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Rs0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ls0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>dt0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ypm0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kp0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>p0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>J0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Mz0<sp/>)<sp/>{Rs=Rs0;<sp/>Ls=Ls0;<sp/>dt=dt0;<sp/>Ypm=Ypm0;<sp/>kp=kp0;<sp/>p=p0;<sp/>J=J0;<sp/>Mz=Mz0;}</highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="25" refid="classIMpmsm_145785869d978dda42828a072ec2caebe" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classIMpmsm_145785869d978dda42828a072ec2caebe" kindref="member" tooltip="Evaluates .">eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>last<sp/>state</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>iam<sp/>=<sp/>x0<sp/>(<sp/>0<sp/>);</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ibm<sp/>=<sp/>x0<sp/>(<sp/>1<sp/>);</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>omm<sp/>=<sp/>x0<sp/>(<sp/>2<sp/>);</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>thm<sp/>=<sp/>x0<sp/>(<sp/>3<sp/>);</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>uam<sp/>=<sp/>u0<sp/>(<sp/>0<sp/>);</highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ubm<sp/>=<sp/>u0<sp/>(<sp/>1<sp/>);</highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xk=zeros<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ia</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>0<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>)<sp/>*<sp/>iam<sp/>+<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>sin<sp/>(<sp/>thm<sp/>)<sp/>+<sp/>uam*dt/Ls;</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ib</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>1<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>)<sp/>*<sp/>ibm<sp/>-<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>cos<sp/>(<sp/>thm<sp/>)<sp/>+<sp/>ubm*dt/Ls;</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//om</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>2<sp/>)<sp/>=<sp/>omm<sp/>+<sp/>kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>ibm<sp/>*<sp/>cos<sp/>(<sp/>thm<sp/>)-iam<sp/>*<sp/>sin<sp/>(<sp/>thm<sp/>)<sp/>)<sp/>-<sp/>p/J*dt*Mz;</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//th</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>3<sp/>)<sp/>=<sp/>thm<sp/>+<sp/>omm*dt;<sp/></highlight><highlight class="comment">//<sp/>&lt;0..2pi&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><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/>xk<sp/>(<sp/>3<sp/>)<sp/>&gt;pi<sp/>)<sp/>xk<sp/>(<sp/>3<sp/>)-=2*pi;</highlight></codeline>
<codeline lineno="44"><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/>xk<sp/>(<sp/>3<sp/>)<sp/>&lt;-pi<sp/>)<sp/>xk<sp/>(<sp/>3<sp/>)<sp/>+=2*pi;</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>xk;</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
<codeline lineno="48" refid="classIMpmsm_1b4378b5d3bf64c683e4cf5c5f1cd56f1" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classIMpmsm_1b4378b5d3bf64c683e4cf5c5f1cd56f1" kindref="member" tooltip="Evaluates  and writes result into A .">dfdx_cond</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0,<sp/>mat<sp/>&amp;A,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>full=</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>)<sp/>{</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>iam<sp/>=<sp/>x0<sp/>(<sp/>0<sp/>);</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ibm<sp/>=<sp/>x0<sp/>(<sp/>1<sp/>);</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>omm<sp/>=<sp/>x0<sp/>(<sp/>2<sp/>);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>thm<sp/>=<sp/>x0<sp/>(<sp/>3<sp/>);</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>d<sp/>ia</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>0,0<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>);<sp/>A<sp/>(<sp/>0,1<sp/>)<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>0,2<sp/>)<sp/>=<sp/>Ypm/Ls*dt*<sp/>sin<sp/>(<sp/>thm<sp/>);<sp/>A<sp/>(<sp/>0,3<sp/>)<sp/>=<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>(<sp/>cos<sp/>(<sp/>thm<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>d<sp/>ib</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>1,0<sp/>)<sp/>=<sp/>0.0<sp/>;<sp/>A<sp/>(<sp/>1,1<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>);</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>1,2<sp/>)<sp/>=<sp/>-Ypm/Ls*dt*<sp/>cos<sp/>(<sp/>thm<sp/>);<sp/>A<sp/>(<sp/>1,3<sp/>)<sp/>=<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>(<sp/>sin<sp/>(<sp/>thm<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/></highlight><highlight class="comment">//<sp/>d<sp/>om</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>2,0<sp/>)<sp/>=<sp/>kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>-<sp/>sin<sp/>(<sp/>thm<sp/>)<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/>A<sp/>(<sp/>2,1<sp/>)<sp/>=<sp/>kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>cos<sp/>(<sp/>thm<sp/>)<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/>A<sp/>(<sp/>2,2<sp/>)<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>2,3<sp/>)<sp/>=<sp/>kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>-ibm<sp/>*<sp/>sin<sp/>(<sp/>thm<sp/>)-iam<sp/>*<sp/>cos<sp/>(<sp/>thm<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>d<sp/>th</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>3,0<sp/>)<sp/>=<sp/>0.0;<sp/>A<sp/>(<sp/>3,1<sp/>)<sp/>=<sp/>0.0;<sp/>A<sp/>(<sp/>3,2<sp/>)<sp/>=<sp/>dt;<sp/>A<sp/>(<sp/>3,3<sp/>)<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
<codeline lineno="68" refid="classIMpmsm_1c3f8dad22ae9855c04a1d593b45c99b5" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classIMpmsm_1c3f8dad22ae9855c04a1d593b45c99b5" kindref="member" tooltip="Evaluates  and writes result into A .">dfdu_cond</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0,<sp/>mat<sp/>&amp;A,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>full=</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>)<sp/>{it_error<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;not<sp/>needed&quot;</highlight><highlight class="normal"><sp/>);};</highlight></codeline>
<codeline lineno="69"><highlight class="normal"></highlight></codeline>
<codeline lineno="70"><highlight class="normal">};</highlight></codeline>
<codeline lineno="71"><highlight class="normal"></highlight></codeline>
<codeline lineno="73" refid="classIMpmsmStat" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classIMpmsmStat" kindref="compound" tooltip="State evolution model for a PMSM drive and its derivative with respect to , equation...">IMpmsmStat</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classIMpmsm" kindref="compound" tooltip="State evolution model for a PMSM drive and its derivative with respect to $.">IMpmsm</ref><sp/>{</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classIMpmsmStat" kindref="compound" tooltip="State evolution model for a PMSM drive and its derivative with respect to , equation...">IMpmsmStat</ref>()<sp/>:<ref refid="classIMpmsm" kindref="compound" tooltip="State evolution model for a PMSM drive and its derivative with respect to $.">IMpmsm</ref>()<sp/>{};</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>set_parameters<sp/>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Rs0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ls0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>dt0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ypm0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kp0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>p0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>J0,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Mz0<sp/>)<sp/>{Rs=Rs0;<sp/>Ls=Ls0;<sp/>dt=dt0;<sp/>Ypm=Ypm0;<sp/>kp=kp0;<sp/>p=p0;<sp/>J=J0;<sp/>Mz=Mz0;}</highlight></codeline>
<codeline lineno="77"><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>eval<sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>last<sp/>state</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>iam<sp/>=<sp/>x0<sp/>(<sp/>0<sp/>);</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ibm<sp/>=<sp/>x0<sp/>(<sp/>1<sp/>);</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>omm<sp/>=<sp/>x0<sp/>(<sp/>2<sp/>);</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>thm<sp/>=<sp/>x0<sp/>(<sp/>3<sp/>);</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>uam<sp/>=<sp/>u0<sp/>(<sp/>0<sp/>);</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ubm<sp/>=<sp/>u0<sp/>(<sp/>1<sp/>);</highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>xk=zeros<sp/>(<sp/>4<sp/>);</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ia</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>0<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>)<sp/>*<sp/>iam<sp/>+<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>sin<sp/>(<sp/>thm<sp/>)<sp/>+<sp/>uam*dt/Ls;</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ib</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>1<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>)<sp/>*<sp/>ibm<sp/>-<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>cos<sp/>(<sp/>thm<sp/>)<sp/>+<sp/>ubm*dt/Ls;</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//om</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>2<sp/>)<sp/>=<sp/>omm;</highlight><highlight class="comment">//<sp/>+<sp/>kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>ibm<sp/>*<sp/>cos<sp/>(<sp/>thm<sp/>)-iam<sp/>*<sp/>sin<sp/>(<sp/>thm<sp/>)<sp/>)<sp/>-<sp/>p/J*dt*Mz;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//th</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>xk<sp/>(<sp/>3<sp/>)<sp/>=<sp/>rem(thm<sp/>+<sp/>omm*dt,2*pi);<sp/></highlight><highlight class="comment">//<sp/>&lt;0..2pi&gt;</highlight><highlight class="normal"></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="keywordflow">return</highlight><highlight class="normal"><sp/>xk;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>dfdx_cond<sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0,<sp/>mat<sp/>&amp;A,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>full=</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>)<sp/>{</highlight></codeline>
<codeline lineno="100"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>double<sp/>iam<sp/>=<sp/>x0<sp/>(<sp/>0<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="101"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>double<sp/>ibm<sp/>=<sp/>x0<sp/>(<sp/>1<sp/>);</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/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>omm<sp/>=<sp/>x0<sp/>(<sp/>2<sp/>);</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="keywordtype">double</highlight><highlight class="normal"><sp/>thm<sp/>=<sp/>x0<sp/>(<sp/>3<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/></highlight><highlight class="comment">//<sp/>d<sp/>ia</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>0,0<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>);<sp/>A<sp/>(<sp/>0,1<sp/>)<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>0,2<sp/>)<sp/>=<sp/>Ypm/Ls*dt*<sp/>sin<sp/>(<sp/>thm<sp/>);<sp/>A<sp/>(<sp/>0,3<sp/>)<sp/>=<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>(<sp/>cos<sp/>(<sp/>thm<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/>d<sp/>ib</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/>A<sp/>(<sp/>1,0<sp/>)<sp/>=<sp/>0.0<sp/>;<sp/>A<sp/>(<sp/>1,1<sp/>)<sp/>=<sp/>(<sp/>1.0-<sp/>Rs/Ls*dt<sp/>);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>1,2<sp/>)<sp/>=<sp/>-Ypm/Ls*dt*<sp/>cos<sp/>(<sp/>thm<sp/>);<sp/>A<sp/>(<sp/>1,3<sp/>)<sp/>=<sp/>Ypm/Ls*dt*omm<sp/>*<sp/>(<sp/>sin<sp/>(<sp/>thm<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>d<sp/>om</highlight><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/>A<sp/>(<sp/>2,0<sp/>)<sp/>=<sp/>0.0;</highlight><highlight class="comment">//kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>-<sp/>sin<sp/>(<sp/>thm<sp/>)<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>2,1<sp/>)<sp/>=<sp/>0.0;</highlight><highlight class="comment">//kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>cos<sp/>(<sp/>thm<sp/>)<sp/>);</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/>A<sp/>(<sp/>2,2<sp/>)<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>2,3<sp/>)<sp/>=<sp/>0.0;</highlight><highlight class="comment">//kp*p*p<sp/>*<sp/>Ypm/J*dt*<sp/>(<sp/>-ibm<sp/>*<sp/>sin<sp/>(<sp/>thm<sp/>)-iam<sp/>*<sp/>cos<sp/>(<sp/>thm<sp/>)<sp/>);</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/></highlight><highlight class="comment">//<sp/>d<sp/>th</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/>A<sp/>(<sp/>3,0<sp/>)<sp/>=<sp/>0.0;<sp/>A<sp/>(<sp/>3,1<sp/>)<sp/>=<sp/>0.0;<sp/>A<sp/>(<sp/>3,2<sp/>)<sp/>=<sp/>dt;<sp/>A<sp/>(<sp/>3,3<sp/>)<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>dfdu_cond<sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0,<sp/>mat<sp/>&amp;A,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>full=</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>)<sp/>{it_error<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;not<sp/>needed&quot;</highlight><highlight class="normal"><sp/>);};</highlight></codeline>
<codeline lineno="120"><highlight class="normal"></highlight></codeline>
<codeline lineno="121"><highlight class="normal">};</highlight></codeline>
<codeline lineno="122"><highlight class="normal"></highlight></codeline>
<codeline lineno="124" refid="classOMpmsm" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classOMpmsm" kindref="compound" tooltip="Observation model for PMSM drive and its derivative with respect to .">OMpmsm</ref>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classdiffbifn" kindref="compound" tooltip="Class representing a differentiable function of two variables .">diffbifn</ref><sp/>{</highlight></codeline>
<codeline lineno="125"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="126"><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/>:<ref refid="classdiffbifn_1797772c0d5aab8ddccec19dfe4bb2d77" kindref="member" tooltip="Default constructor (dimy is not set!).">diffbifn</ref><sp/>(2,<sp/>rx,ru<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="127"><highlight class="normal"></highlight></codeline>
<codeline lineno="128" refid="classOMpmsm_18e32392c9c635584606287b8c0e8c9da" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/><ref refid="classOMpmsm_18e32392c9c635584606287b8c0e8c9da" kindref="member" tooltip="Evaluates .">eval</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>y<sp/>(<sp/>2<sp/>);</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>y<sp/>(<sp/>0<sp/>)<sp/>=<sp/>x0<sp/>(<sp/>0<sp/>);</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>y<sp/>(<sp/>1<sp/>)<sp/>=<sp/>x0<sp/>(<sp/>1<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="keywordflow">return</highlight><highlight class="normal"><sp/>y;</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="135" refid="classOMpmsm_1b75b5fd55b2ac5ed74b5b953af122821" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classOMpmsm_1b75b5fd55b2ac5ed74b5b953af122821" kindref="member" tooltip="Evaluates  and writes result into A .">dfdx_cond</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;u0,<sp/>mat<sp/>&amp;A,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>full=</highlight><highlight class="keyword">true</highlight><highlight class="normal"><sp/>)<sp/>{</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A.clear();</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>0,0<sp/>)<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>1,1<sp/>)<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="140"><highlight class="normal">};</highlight></codeline>
<codeline lineno="141"><highlight class="normal"></highlight></codeline>
<codeline lineno="142"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/>//PMSM_H</highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h"/>
  </compounddef>
</doxygen>
