1 | <?xml version='1.0' encoding='UTF-8' standalone='no'?> |
---|
2 | <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6"> |
---|
3 | <compounddef id="pmsm_8h" kind="file"> |
---|
4 | <compoundname>pmsm.h</compoundname> |
---|
5 | <includes refid="libFN_8h" local="no">stat/libFN.h</includes> |
---|
6 | <includedby refid="pmsm__mix_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_mix.cpp</includedby> |
---|
7 | <includedby refid="pmsm__sim_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_sim.cpp</includedby> |
---|
8 | <includedby refid="pmsm__sim2_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_sim2.cpp</includedby> |
---|
9 | <includedby refid="pmsm__sim3_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_sim3.cpp</includedby> |
---|
10 | <includedby refid="pmsm__unkQ_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_unkQ.cpp</includedby> |
---|
11 | <includedby refid="pmsm__unkQpf_8cpp" local="yes">work/git/mixpp/pmsm/pmsm_unkQpf.cpp</includedby> |
---|
12 | <includedby refid="sim__var_8cpp" local="yes">work/git/mixpp/pmsm/sim_var.cpp</includedby> |
---|
13 | <includedby refid="testbidiff_8cpp" local="yes">work/git/mixpp/pmsm/testbidiff.cpp</includedby> |
---|
14 | <incdepgraph> |
---|
15 | <node id="563"> |
---|
16 | <label>libBM.h</label> |
---|
17 | <link refid="libBM_8h"/> |
---|
18 | <childnode refid="562" relation="include"> |
---|
19 | </childnode> |
---|
20 | </node> |
---|
21 | <node id="560"> |
---|
22 | <label>work/git/mixpp/pmsm/pmsm.h</label> |
---|
23 | <link refid="pmsm.h"/> |
---|
24 | <childnode refid="561" relation="include"> |
---|
25 | </childnode> |
---|
26 | </node> |
---|
27 | <node id="561"> |
---|
28 | <label>stat/libFN.h</label> |
---|
29 | <link refid="libFN_8h-source"/> |
---|
30 | <childnode refid="562" relation="include"> |
---|
31 | </childnode> |
---|
32 | <childnode refid="563" relation="include"> |
---|
33 | </childnode> |
---|
34 | </node> |
---|
35 | <node id="562"> |
---|
36 | <label>itpp/itbase.h</label> |
---|
37 | </node> |
---|
38 | </incdepgraph> |
---|
39 | <invincdepgraph> |
---|
40 | <node id="564"> |
---|
41 | <label>work/git/mixpp/pmsm/pmsm.h</label> |
---|
42 | <link refid="pmsm.h"/> |
---|
43 | <childnode refid="565" relation="include"> |
---|
44 | </childnode> |
---|
45 | <childnode refid="566" relation="include"> |
---|
46 | </childnode> |
---|
47 | </node> |
---|
48 | <node id="566"> |
---|
49 | <label>work/git/mixpp/pmsm/sim_var.cpp</label> |
---|
50 | <link refid="sim__var_8cpp"/> |
---|
51 | </node> |
---|
52 | <node id="565"> |
---|
53 | <label>work/git/mixpp/pmsm/pmsm_mix.cpp</label> |
---|
54 | <link refid="pmsm__mix_8cpp"/> |
---|
55 | </node> |
---|
56 | </invincdepgraph> |
---|
57 | <innerclass refid="classIMpmsm" prot="public">IMpmsm</innerclass> |
---|
58 | <innerclass refid="classIMpmsmStat" prot="public">IMpmsmStat</innerclass> |
---|
59 | <innerclass refid="classOMpmsm" prot="public">OMpmsm</innerclass> |
---|
60 | <sectiondef kind="func"> |
---|
61 | <memberdef kind="function" id="pmsm_8h_1d82cfa6804c0679a7bd248ef045de3f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
62 | <type><ref refid="classRV" kindref="compound">RV</ref></type> |
---|
63 | <definition>RV rx</definition> |
---|
64 | <argsstring>("{ia ib om th }")</argsstring> |
---|
65 | <name>rx</name> |
---|
66 | <briefdescription> |
---|
67 | </briefdescription> |
---|
68 | <detaileddescription> |
---|
69 | </detaileddescription> |
---|
70 | <inbodydescription> |
---|
71 | </inbodydescription> |
---|
72 | <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h" line="7"/> |
---|
73 | </memberdef> |
---|
74 | <memberdef kind="function" id="pmsm_8h_125f104769603791ae5d508dcfcd0aa50" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
75 | <type><ref refid="classRV" kindref="compound">RV</ref></type> |
---|
76 | <definition>RV ru</definition> |
---|
77 | <argsstring>("{ua ub }")</argsstring> |
---|
78 | <name>ru</name> |
---|
79 | <briefdescription> |
---|
80 | </briefdescription> |
---|
81 | <detaileddescription> |
---|
82 | </detaileddescription> |
---|
83 | <inbodydescription> |
---|
84 | </inbodydescription> |
---|
85 | <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h" line="8"/> |
---|
86 | </memberdef> |
---|
87 | <memberdef kind="function" id="pmsm_8h_17961bfdfac2b069de327d4922319111e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
88 | <type><ref refid="classRV" kindref="compound">RV</ref></type> |
---|
89 | <definition>RV ry</definition> |
---|
90 | <argsstring>("{oia oib }")</argsstring> |
---|
91 | <name>ry</name> |
---|
92 | <briefdescription> |
---|
93 | </briefdescription> |
---|
94 | <detaileddescription> |
---|
95 | </detaileddescription> |
---|
96 | <inbodydescription> |
---|
97 | </inbodydescription> |
---|
98 | <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h" line="9"/> |
---|
99 | </memberdef> |
---|
100 | </sectiondef> |
---|
101 | <briefdescription> |
---|
102 | </briefdescription> |
---|
103 | <detaileddescription> |
---|
104 | </detaileddescription> |
---|
105 | <programlisting> |
---|
106 | <codeline lineno="1"><highlight class="preprocessor">#ifndef<sp/>PMSM_H</highlight></codeline> |
---|
107 | <codeline lineno="2"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>PMSM_H</highlight></codeline> |
---|
108 | <codeline lineno="3"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline> |
---|
109 | <codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><stat/libFN.h></highlight><highlight class="normal"></highlight></codeline> |
---|
110 | <codeline lineno="5"><highlight class="normal"></highlight></codeline> |
---|
111 | <codeline lineno="6"><highlight class="normal"></highlight><highlight class="comment">//TODO<sp/>hardcoded<sp/>RVs!!!</highlight><highlight class="normal"></highlight></codeline> |
---|
112 | <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">"{ia<sp/>ib<sp/>om<sp/>th<sp/>}"</highlight><highlight class="normal">);</highlight></codeline> |
---|
113 | <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">"{ua<sp/>ub<sp/>}"</highlight><highlight class="normal">);</highlight></codeline> |
---|
114 | <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">"{oia<sp/>oib<sp/>}"</highlight><highlight class="normal">);</highlight></codeline> |
---|
115 | <codeline lineno="10"><highlight class="normal"></highlight></codeline> |
---|
116 | <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> |
---|
117 | <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> |
---|
118 | <codeline lineno="13"><highlight class="normal"></highlight><highlight class="comment">//<sp/>};</highlight><highlight class="normal"></highlight></codeline> |
---|
119 | <codeline lineno="14"><highlight class="normal"></highlight></codeline> |
---|
120 | <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> |
---|
121 | <codeline lineno="17"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline> |
---|
122 | <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> |
---|
123 | <codeline lineno="19"><highlight class="normal"></highlight></codeline> |
---|
124 | <codeline lineno="20"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
125 | <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> |
---|
126 | <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> |
---|
127 | <codeline lineno="24"><highlight class="normal"></highlight></codeline> |
---|
128 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0<sp/>)<sp/>{</highlight></codeline> |
---|
129 | <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> |
---|
130 | <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> |
---|
131 | <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> |
---|
132 | <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> |
---|
133 | <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> |
---|
134 | <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> |
---|
135 | <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> |
---|
136 | <codeline lineno="33"><highlight class="normal"></highlight></codeline> |
---|
137 | <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> |
---|
138 | <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> |
---|
139 | <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> |
---|
140 | <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> |
---|
141 | <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> |
---|
142 | <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> |
---|
143 | <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> |
---|
144 | <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> |
---|
145 | <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/><0..2pi></highlight><highlight class="normal"></highlight></codeline> |
---|
146 | <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/>>pi<sp/>)<sp/>xk<sp/>(<sp/>3<sp/>)-=2*pi;</highlight></codeline> |
---|
147 | <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/><-pi<sp/>)<sp/>xk<sp/>(<sp/>3<sp/>)<sp/>+=2*pi;</highlight></codeline> |
---|
148 | <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> |
---|
149 | <codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
150 | <codeline lineno="47"><highlight class="normal"></highlight></codeline> |
---|
151 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0,<sp/>mat<sp/>&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> |
---|
152 | <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> |
---|
153 | <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> |
---|
154 | <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> |
---|
155 | <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> |
---|
156 | <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> |
---|
157 | <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> |
---|
158 | <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> |
---|
159 | <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> |
---|
160 | <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> |
---|
161 | <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> |
---|
162 | <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> |
---|
163 | <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> |
---|
164 | <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> |
---|
165 | <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> |
---|
166 | <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> |
---|
167 | <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> |
---|
168 | <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> |
---|
169 | <codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
170 | <codeline lineno="67"><highlight class="normal"></highlight></codeline> |
---|
171 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0,<sp/>mat<sp/>&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">"not<sp/>needed"</highlight><highlight class="normal"><sp/>);};</highlight></codeline> |
---|
172 | <codeline lineno="69"><highlight class="normal"></highlight></codeline> |
---|
173 | <codeline lineno="70"><highlight class="normal">};</highlight></codeline> |
---|
174 | <codeline lineno="71"><highlight class="normal"></highlight></codeline> |
---|
175 | <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> |
---|
176 | <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> |
---|
177 | <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> |
---|
178 | <codeline lineno="77"><highlight class="normal"></highlight></codeline> |
---|
179 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0<sp/>)<sp/>{</highlight></codeline> |
---|
180 | <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> |
---|
181 | <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> |
---|
182 | <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> |
---|
183 | <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> |
---|
184 | <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> |
---|
185 | <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> |
---|
186 | <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> |
---|
187 | <codeline lineno="86"><highlight class="normal"></highlight></codeline> |
---|
188 | <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> |
---|
189 | <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> |
---|
190 | <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> |
---|
191 | <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> |
---|
192 | <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> |
---|
193 | <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> |
---|
194 | <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> |
---|
195 | <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> |
---|
196 | <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/><0..2pi></highlight><highlight class="normal"></highlight></codeline> |
---|
197 | <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> |
---|
198 | <codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
199 | <codeline lineno="98"><highlight class="normal"></highlight></codeline> |
---|
200 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0,<sp/>mat<sp/>&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> |
---|
201 | <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> |
---|
202 | <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> |
---|
203 | <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> |
---|
204 | <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> |
---|
205 | <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> |
---|
206 | <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> |
---|
207 | <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> |
---|
208 | <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> |
---|
209 | <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> |
---|
210 | <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> |
---|
211 | <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> |
---|
212 | <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> |
---|
213 | <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> |
---|
214 | <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> |
---|
215 | <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> |
---|
216 | <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> |
---|
217 | <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> |
---|
218 | <codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
219 | <codeline lineno="118"><highlight class="normal"></highlight></codeline> |
---|
220 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0,<sp/>mat<sp/>&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">"not<sp/>needed"</highlight><highlight class="normal"><sp/>);};</highlight></codeline> |
---|
221 | <codeline lineno="120"><highlight class="normal"></highlight></codeline> |
---|
222 | <codeline lineno="121"><highlight class="normal">};</highlight></codeline> |
---|
223 | <codeline lineno="122"><highlight class="normal"></highlight></codeline> |
---|
224 | <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> |
---|
225 | <codeline lineno="125"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline> |
---|
226 | <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> |
---|
227 | <codeline lineno="127"><highlight class="normal"></highlight></codeline> |
---|
228 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0<sp/>)<sp/>{</highlight></codeline> |
---|
229 | <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> |
---|
230 | <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> |
---|
231 | <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> |
---|
232 | <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> |
---|
233 | <codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
234 | <codeline lineno="134"><highlight class="normal"></highlight></codeline> |
---|
235 | <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/>&x0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&u0,<sp/>mat<sp/>&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> |
---|
236 | <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> |
---|
237 | <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> |
---|
238 | <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> |
---|
239 | <codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
240 | <codeline lineno="140"><highlight class="normal">};</highlight></codeline> |
---|
241 | <codeline lineno="141"><highlight class="normal"></highlight></codeline> |
---|
242 | <codeline lineno="142"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/>//PMSM_H</highlight></codeline> |
---|
243 | </programlisting> |
---|
244 | <location file="/home/smidl/work/git/mixpp/pmsm/pmsm.h"/> |
---|
245 | </compounddef> |
---|
246 | </doxygen> |
---|