1229 lines
113 KiB
HTML
1229 lines
113 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<script type="text/javascript" src="./js/coder_app.js"></script>
|
||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||
|
<script type="text/javascript" src="./rtwreport_utils.js"></script>
|
||
|
<script type="text/javascript" src="./rtwannotate.js"></script>
|
||
|
<link rel="stylesheet" type="text/css" href="./css/coder_app.css"/>
|
||
|
</head>
|
||
|
<body onload="srcFileOnload();">
|
||
|
<pre id="code">
|
||
|
<table class="code" id="codeTbl">
|
||
|
<tr name="1" id="1">
|
||
|
<td><a id="l1" class='ln'>1</a></td><td><span class="ct">/*</span></td></tr>
|
||
|
<tr name="2" id="2">
|
||
|
<td><a id="l2" class='ln'>2</a></td><td><span class="ct"> * Arduino_skal.cpp</span></td></tr>
|
||
|
<tr name="3" id="3">
|
||
|
<td><a id="l3" class='ln'>3</a></td><td><span class="ct"> *</span></td></tr>
|
||
|
<tr name="4" id="4">
|
||
|
<td><a id="l4" class='ln'>4</a></td><td><span class="ct"> * Academic License - for use in teaching, academic research, and meeting</span></td></tr>
|
||
|
<tr name="5" id="5">
|
||
|
<td><a id="l5" class='ln'>5</a></td><td><span class="ct"> * course requirements at degree granting institutions only. Not for</span></td></tr>
|
||
|
<tr name="6" id="6">
|
||
|
<td><a id="l6" class='ln'>6</a></td><td><span class="ct"> * government, commercial, or other organizational use.</span></td></tr>
|
||
|
<tr name="7" id="7">
|
||
|
<td><a id="l7" class='ln'>7</a></td><td><span class="ct"> *</span></td></tr>
|
||
|
<tr name="8" id="8">
|
||
|
<td><a id="l8" class='ln'>8</a></td><td><span class="ct"> * Code generation for model "Arduino_skal".</span></td></tr>
|
||
|
<tr name="9" id="9">
|
||
|
<td><a id="l9" class='ln'>9</a></td><td><span class="ct"> *</span></td></tr>
|
||
|
<tr name="10" id="10">
|
||
|
<td><a id="l10" class='ln'>10</a></td><td><span class="ct"> * Model version : 1.1</span></td></tr>
|
||
|
<tr name="11" id="11">
|
||
|
<td><a id="l11" class='ln'>11</a></td><td><span class="ct"> * Simulink Coder version : 9.5 (R2021a) 14-Nov-2020</span></td></tr>
|
||
|
<tr name="12" id="12">
|
||
|
<td><a id="l12" class='ln'>12</a></td><td><span class="ct"> * C++ source code generated on : Thu Apr 15 15:56:50 2021</span></td></tr>
|
||
|
<tr name="13" id="13">
|
||
|
<td><a id="l13" class='ln'>13</a></td><td><span class="ct"> *</span></td></tr>
|
||
|
<tr name="14" id="14">
|
||
|
<td><a id="l14" class='ln'>14</a></td><td><span class="ct"> * Target selection: grt.tlc</span></td></tr>
|
||
|
<tr name="15" id="15">
|
||
|
<td><a id="l15" class='ln'>15</a></td><td><span class="ct"> * Note: GRT includes extra infrastructure and instrumentation for prototyping</span></td></tr>
|
||
|
<tr name="16" id="16">
|
||
|
<td><a id="l16" class='ln'>16</a></td><td><span class="ct"> * Embedded hardware selection: Intel->x86-64 (Windows64)</span></td></tr>
|
||
|
<tr name="17" id="17">
|
||
|
<td><a id="l17" class='ln'>17</a></td><td><span class="ct"> * Code generation objective: Debugging</span></td></tr>
|
||
|
<tr name="18" id="18">
|
||
|
<td><a id="l18" class='ln'>18</a></td><td><span class="ct"> * Validation result: Not run</span></td></tr>
|
||
|
<tr name="19" id="19">
|
||
|
<td><a id="l19" class='ln'>19</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="20" id="20">
|
||
|
<td><a id="l20" class='ln'>20</a></td><td></td></tr>
|
||
|
<tr name="21" id="21">
|
||
|
<td><a id="l21" class='ln'>21</a></td><td><span class="pp">#include "Arduino_skal.h"</span></td></tr>
|
||
|
<tr name="22" id="22">
|
||
|
<td><a id="l22" class='ln'>22</a></td><td><span class="pp">#include "Arduino_skal_private.h"</span></td></tr>
|
||
|
<tr name="23" id="23">
|
||
|
<td><a id="l23" class='ln'>23</a></td><td></td></tr>
|
||
|
<tr name="24" id="24">
|
||
|
<td><a id="l24" class='ln'>24</a></td><td><span class="ct">/*</span></td></tr>
|
||
|
<tr name="25" id="25">
|
||
|
<td><a id="l25" class='ln'>25</a></td><td><span class="ct"> * This function updates continuous states using the ODE3 fixed-step</span></td></tr>
|
||
|
<tr name="26" id="26">
|
||
|
<td><a id="l26" class='ln'>26</a></td><td><span class="ct"> * solver algorithm</span></td></tr>
|
||
|
<tr name="27" id="27">
|
||
|
<td><a id="l27" class='ln'>27</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="28" id="28">
|
||
|
<td><a id="l28" class='ln'>28</a></td><td><span class="kw">void</span> <a id="28c6" class="tk">Arduino_skalModelClass</a>::<a id="28c30" class="tk">rt_ertODEUpdateContinuousStates</a>(<a id="28c62" class="tk">RTWSolverInfo</a> <a id="28c76" class="tk">*</a><a id="28c77" class="tk">si</a> )</td></tr>
|
||
|
<tr name="29" id="29">
|
||
|
<td><a id="l29" class='ln'>29</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="30" id="30">
|
||
|
<td><a id="l30" class='ln'>30</a></td><td> <span class="ct">/* Solver Matrices */</span></td></tr>
|
||
|
<tr name="31" id="31">
|
||
|
<td><a id="l31" class='ln'>31</a></td><td> <span class="kw">static</span> <span class="kw">const</span> <a id="31c16" class="tk">real_T</a> <a id="31c23" class="tk">rt_ODE3_A</a>[3] = <span class="br">{</span></td></tr>
|
||
|
<tr name="32" id="32">
|
||
|
<td><a id="l32" class='ln'>32</a></td><td> 1.0<a id="32c8" class="tk">/</a>2.0, 3.0<a id="32c17" class="tk">/</a>4.0, 1.0</td></tr>
|
||
|
<tr name="33" id="33">
|
||
|
<td><a id="l33" class='ln'>33</a></td><td> <span class="br">}</span>;</td></tr>
|
||
|
<tr name="34" id="34">
|
||
|
<td><a id="l34" class='ln'>34</a></td><td></td></tr>
|
||
|
<tr name="35" id="35">
|
||
|
<td><a id="l35" class='ln'>35</a></td><td> <span class="kw">static</span> <span class="kw">const</span> <a id="35c16" class="tk">real_T</a> <a id="35c23" class="tk">rt_ODE3_B</a>[3][3] = <span class="br">{</span></td></tr>
|
||
|
<tr name="36" id="36">
|
||
|
<td><a id="l36" class='ln'>36</a></td><td> <span class="br">{</span> 1.0<a id="36c10" class="tk">/</a>2.0, 0.0, 0.0 <span class="br">}</span>,</td></tr>
|
||
|
<tr name="37" id="37">
|
||
|
<td><a id="l37" class='ln'>37</a></td><td></td></tr>
|
||
|
<tr name="38" id="38">
|
||
|
<td><a id="l38" class='ln'>38</a></td><td> <span class="br">{</span> 0.0, 3.0<a id="38c15" class="tk">/</a>4.0, 0.0 <span class="br">}</span>,</td></tr>
|
||
|
<tr name="39" id="39">
|
||
|
<td><a id="l39" class='ln'>39</a></td><td></td></tr>
|
||
|
<tr name="40" id="40">
|
||
|
<td><a id="l40" class='ln'>40</a></td><td> <span class="br">{</span> 2.0<a id="40c10" class="tk">/</a>9.0, 1.0<a id="40c19" class="tk">/</a>3.0, 4.0<a id="40c28" class="tk">/</a>9.0 <span class="br">}</span></td></tr>
|
||
|
<tr name="41" id="41">
|
||
|
<td><a id="l41" class='ln'>41</a></td><td> <span class="br">}</span>;</td></tr>
|
||
|
<tr name="42" id="42">
|
||
|
<td><a id="l42" class='ln'>42</a></td><td></td></tr>
|
||
|
<tr name="43" id="43">
|
||
|
<td><a id="l43" class='ln'>43</a></td><td> <a id="43c3" class="tk">time_T</a> <a id="43c10" class="tk">t</a> = <a id="43c14" class="tk">rtsiGetT</a>(<a id="43c23" class="tk">si</a>);</td></tr>
|
||
|
<tr name="44" id="44">
|
||
|
<td><a id="l44" class='ln'>44</a></td><td> <a id="44c3" class="tk">time_T</a> <a id="44c10" class="tk">tnew</a> = <a id="44c17" class="tk">rtsiGetSolverStopTime</a>(<a id="44c39" class="tk">si</a>);</td></tr>
|
||
|
<tr name="45" id="45">
|
||
|
<td><a id="l45" class='ln'>45</a></td><td> <a id="45c3" class="tk">time_T</a> <a id="45c10" class="tk">h</a> = <a id="45c14" class="tk">rtsiGetStepSize</a>(<a id="45c30" class="tk">si</a>);</td></tr>
|
||
|
<tr name="46" id="46">
|
||
|
<td><a id="l46" class='ln'>46</a></td><td> <a id="46c3" class="tk">real_T</a> <a id="46c10" class="tk">*</a><a id="46c11" class="tk">x</a> = <a id="46c15" class="tk">rtsiGetContStates</a>(<a id="46c33" class="tk">si</a>);</td></tr>
|
||
|
<tr name="47" id="47">
|
||
|
<td><a id="l47" class='ln'>47</a></td><td> <a id="47c3" class="tk">ODE3_IntgData</a> <a id="47c17" class="tk">*</a><a id="47c18" class="tk">id</a> = <span class="kw">static_cast</span><a id="47c34" class="tk"><</a><a id="47c35" class="tk">ODE3_IntgData</a> <a id="47c49" class="tk">*</a><a id="47c50" class="tk">></a>(<a id="47c52" class="tk">rtsiGetSolverData</a>(<a id="47c70" class="tk">si</a>));</td></tr>
|
||
|
<tr name="48" id="48">
|
||
|
<td><a id="l48" class='ln'>48</a></td><td> <a id="48c3" class="tk">real_T</a> <a id="48c10" class="tk">*</a><a id="48c11" class="tk">y</a> = <a id="48c15" class="tk">id</a>-><a id="48c19" class="tk">y</a>;</td></tr>
|
||
|
<tr name="49" id="49">
|
||
|
<td><a id="l49" class='ln'>49</a></td><td> <a id="49c3" class="tk">real_T</a> <a id="49c10" class="tk">*</a><a id="49c11" class="tk">f0</a> = <a id="49c16" class="tk">id</a>-><a id="49c20" class="tk">f</a>[0];</td></tr>
|
||
|
<tr name="50" id="50">
|
||
|
<td><a id="l50" class='ln'>50</a></td><td> <a id="50c3" class="tk">real_T</a> <a id="50c10" class="tk">*</a><a id="50c11" class="tk">f1</a> = <a id="50c16" class="tk">id</a>-><a id="50c20" class="tk">f</a>[1];</td></tr>
|
||
|
<tr name="51" id="51">
|
||
|
<td><a id="l51" class='ln'>51</a></td><td> <a id="51c3" class="tk">real_T</a> <a id="51c10" class="tk">*</a><a id="51c11" class="tk">f2</a> = <a id="51c16" class="tk">id</a>-><a id="51c20" class="tk">f</a>[2];</td></tr>
|
||
|
<tr name="52" id="52">
|
||
|
<td><a id="l52" class='ln'>52</a></td><td> <a id="52c3" class="tk">real_T</a> <a id="52c10" class="tk">hB</a>[3];</td></tr>
|
||
|
<tr name="53" id="53">
|
||
|
<td><a id="l53" class='ln'>53</a></td><td> <a id="53c3" class="tk">int_T</a> <a id="53c9" class="tk">i</a>;</td></tr>
|
||
|
<tr name="54" id="54">
|
||
|
<td><a id="l54" class='ln'>54</a></td><td> <a id="54c3" class="tk">int_T</a> <a id="54c9" class="tk">nXc</a> = 4;</td></tr>
|
||
|
<tr name="55" id="55">
|
||
|
<td><a id="l55" class='ln'>55</a></td><td> <a id="55c3" class="tk">rtsiSetSimTimeStep</a>(<a id="55c22" class="tk">si</a>,<a id="55c25" class="tk">MINOR_TIME_STEP</a>);</td></tr>
|
||
|
<tr name="56" id="56">
|
||
|
<td><a id="l56" class='ln'>56</a></td><td></td></tr>
|
||
|
<tr name="57" id="57">
|
||
|
<td><a id="l57" class='ln'>57</a></td><td> <span class="ct">/* Save the state values at time t in y, we'll use x as ynew. */</span></td></tr>
|
||
|
<tr name="58" id="58">
|
||
|
<td><a id="l58" class='ln'>58</a></td><td> (<span class="kw">void</span>) <a id="58c10" class="tk">std</a>::<a id="58c15" class="tk">memcpy</a>(<a id="58c22" class="tk">y</a>, <a id="58c25" class="tk">x</a>,</td></tr>
|
||
|
<tr name="59" id="59">
|
||
|
<td><a id="l59" class='ln'>59</a></td><td> <span class="kw">static_cast</span><a id="59c33" class="tk"><</a><a id="59c34" class="tk">uint_T</a><a id="59c40" class="tk">></a>(<a id="59c42" class="tk">nXc</a>)<a id="59c46" class="tk">*</a><span class="kw">sizeof</span>(<a id="59c54" class="tk">real_T</a>));</td></tr>
|
||
|
<tr name="60" id="60">
|
||
|
<td><a id="l60" class='ln'>60</a></td><td></td></tr>
|
||
|
<tr name="61" id="61">
|
||
|
<td><a id="l61" class='ln'>61</a></td><td> <span class="ct">/* Assumes that rtsiSetT and ModelOutputs are up-to-date */</span></td></tr>
|
||
|
<tr name="62" id="62">
|
||
|
<td><a id="l62" class='ln'>62</a></td><td> <span class="ct">/* f0 = f(t,y) */</span></td></tr>
|
||
|
<tr name="63" id="63">
|
||
|
<td><a id="l63" class='ln'>63</a></td><td> <a id="63c3" class="tk">rtsiSetdX</a>(<a id="63c13" class="tk">si</a>, <a id="63c17" class="tk">f0</a>);</td></tr>
|
||
|
<tr name="64" id="64">
|
||
|
<td><a id="l64" class='ln'>64</a></td><td> <a id="64c3" class="tk">Arduino_skal_derivatives</a>();</td></tr>
|
||
|
<tr name="65" id="65">
|
||
|
<td><a id="l65" class='ln'>65</a></td><td></td></tr>
|
||
|
<tr name="66" id="66">
|
||
|
<td><a id="l66" class='ln'>66</a></td><td> <span class="ct">/* f(:,2) = feval(odefile, t + hA(1), y + f*hB(:,1), args(:)(*)); */</span></td></tr>
|
||
|
<tr name="67" id="67">
|
||
|
<td><a id="l67" class='ln'>67</a></td><td> <a id="67c3" class="tk">hB</a>[0] = <a id="67c11" class="tk">h</a> <a id="67c13" class="tk">*</a> <a id="67c15" class="tk">rt_ODE3_B</a>[0][0];</td></tr>
|
||
|
<tr name="68" id="68">
|
||
|
<td><a id="l68" class='ln'>68</a></td><td> <span class="kw">for</span> (<a id="68c8" class="tk">i</a> = 0; <a id="68c15" class="tk">i</a> <a id="68c17" class="tk"><</a> <a id="68c19" class="tk">nXc</a>; <a id="68c24" class="tk">i</a><a id="68c25" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="69" id="69">
|
||
|
<td><a id="l69" class='ln'>69</a></td><td> <a id="69c5" class="tk">x</a>[<a id="69c7" class="tk">i</a>] = <a id="69c12" class="tk">y</a>[<a id="69c14" class="tk">i</a>] <a id="69c17" class="tk">+</a> (<a id="69c20" class="tk">f0</a>[<a id="69c23" class="tk">i</a>]<a id="69c25" class="tk">*</a><a id="69c26" class="tk">hB</a>[0]);</td></tr>
|
||
|
<tr name="70" id="70">
|
||
|
<td><a id="l70" class='ln'>70</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="71" id="71">
|
||
|
<td><a id="l71" class='ln'>71</a></td><td></td></tr>
|
||
|
<tr name="72" id="72">
|
||
|
<td><a id="l72" class='ln'>72</a></td><td> <a id="72c3" class="tk">rtsiSetT</a>(<a id="72c12" class="tk">si</a>, <a id="72c16" class="tk">t</a> <a id="72c18" class="tk">+</a> <a id="72c20" class="tk">h</a><a id="72c21" class="tk">*</a><a id="72c22" class="tk">rt_ODE3_A</a>[0]);</td></tr>
|
||
|
<tr name="73" id="73">
|
||
|
<td><a id="l73" class='ln'>73</a></td><td> <a id="73c3" class="tk">rtsiSetdX</a>(<a id="73c13" class="tk">si</a>, <a id="73c17" class="tk">f1</a>);</td></tr>
|
||
|
<tr name="74" id="74">
|
||
|
<td><a id="l74" class='ln'>74</a></td><td> <span class="kw">this</span>-><a id="74c9" class="tk">step</a>();</td></tr>
|
||
|
<tr name="75" id="75">
|
||
|
<td><a id="l75" class='ln'>75</a></td><td> <a id="75c3" class="tk">Arduino_skal_derivatives</a>();</td></tr>
|
||
|
<tr name="76" id="76">
|
||
|
<td><a id="l76" class='ln'>76</a></td><td></td></tr>
|
||
|
<tr name="77" id="77">
|
||
|
<td><a id="l77" class='ln'>77</a></td><td> <span class="ct">/* f(:,3) = feval(odefile, t + hA(2), y + f*hB(:,2), args(:)(*)); */</span></td></tr>
|
||
|
<tr name="78" id="78">
|
||
|
<td><a id="l78" class='ln'>78</a></td><td> <span class="kw">for</span> (<a id="78c8" class="tk">i</a> = 0; <a id="78c15" class="tk">i</a> <a id="78c17" class="tk"><=</a> 1; <a id="78c23" class="tk">i</a><a id="78c24" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="79" id="79">
|
||
|
<td><a id="l79" class='ln'>79</a></td><td> <a id="79c5" class="tk">hB</a>[<a id="79c8" class="tk">i</a>] = <a id="79c13" class="tk">h</a> <a id="79c15" class="tk">*</a> <a id="79c17" class="tk">rt_ODE3_B</a>[1][<a id="79c30" class="tk">i</a>];</td></tr>
|
||
|
<tr name="80" id="80">
|
||
|
<td><a id="l80" class='ln'>80</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="81" id="81">
|
||
|
<td><a id="l81" class='ln'>81</a></td><td></td></tr>
|
||
|
<tr name="82" id="82">
|
||
|
<td><a id="l82" class='ln'>82</a></td><td> <span class="kw">for</span> (<a id="82c8" class="tk">i</a> = 0; <a id="82c15" class="tk">i</a> <a id="82c17" class="tk"><</a> <a id="82c19" class="tk">nXc</a>; <a id="82c24" class="tk">i</a><a id="82c25" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="83" id="83">
|
||
|
<td><a id="l83" class='ln'>83</a></td><td> <a id="83c5" class="tk">x</a>[<a id="83c7" class="tk">i</a>] = <a id="83c12" class="tk">y</a>[<a id="83c14" class="tk">i</a>] <a id="83c17" class="tk">+</a> (<a id="83c20" class="tk">f0</a>[<a id="83c23" class="tk">i</a>]<a id="83c25" class="tk">*</a><a id="83c26" class="tk">hB</a>[0] <a id="83c32" class="tk">+</a> <a id="83c34" class="tk">f1</a>[<a id="83c37" class="tk">i</a>]<a id="83c39" class="tk">*</a><a id="83c40" class="tk">hB</a>[1]);</td></tr>
|
||
|
<tr name="84" id="84">
|
||
|
<td><a id="l84" class='ln'>84</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="85" id="85">
|
||
|
<td><a id="l85" class='ln'>85</a></td><td></td></tr>
|
||
|
<tr name="86" id="86">
|
||
|
<td><a id="l86" class='ln'>86</a></td><td> <a id="86c3" class="tk">rtsiSetT</a>(<a id="86c12" class="tk">si</a>, <a id="86c16" class="tk">t</a> <a id="86c18" class="tk">+</a> <a id="86c20" class="tk">h</a><a id="86c21" class="tk">*</a><a id="86c22" class="tk">rt_ODE3_A</a>[1]);</td></tr>
|
||
|
<tr name="87" id="87">
|
||
|
<td><a id="l87" class='ln'>87</a></td><td> <a id="87c3" class="tk">rtsiSetdX</a>(<a id="87c13" class="tk">si</a>, <a id="87c17" class="tk">f2</a>);</td></tr>
|
||
|
<tr name="88" id="88">
|
||
|
<td><a id="l88" class='ln'>88</a></td><td> <span class="kw">this</span>-><a id="88c9" class="tk">step</a>();</td></tr>
|
||
|
<tr name="89" id="89">
|
||
|
<td><a id="l89" class='ln'>89</a></td><td> <a id="89c3" class="tk">Arduino_skal_derivatives</a>();</td></tr>
|
||
|
<tr name="90" id="90">
|
||
|
<td><a id="l90" class='ln'>90</a></td><td></td></tr>
|
||
|
<tr name="91" id="91">
|
||
|
<td><a id="l91" class='ln'>91</a></td><td> <span class="ct">/* tnew = t + hA(3);</span></td></tr>
|
||
|
<tr name="92" id="92">
|
||
|
<td><a id="l92" class='ln'>92</a></td><td><span class="ct"> ynew = y + f*hB(:,3); */</span></td></tr>
|
||
|
<tr name="93" id="93">
|
||
|
<td><a id="l93" class='ln'>93</a></td><td> <span class="kw">for</span> (<a id="93c8" class="tk">i</a> = 0; <a id="93c15" class="tk">i</a> <a id="93c17" class="tk"><=</a> 2; <a id="93c23" class="tk">i</a><a id="93c24" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="94" id="94">
|
||
|
<td><a id="l94" class='ln'>94</a></td><td> <a id="94c5" class="tk">hB</a>[<a id="94c8" class="tk">i</a>] = <a id="94c13" class="tk">h</a> <a id="94c15" class="tk">*</a> <a id="94c17" class="tk">rt_ODE3_B</a>[2][<a id="94c30" class="tk">i</a>];</td></tr>
|
||
|
<tr name="95" id="95">
|
||
|
<td><a id="l95" class='ln'>95</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="96" id="96">
|
||
|
<td><a id="l96" class='ln'>96</a></td><td></td></tr>
|
||
|
<tr name="97" id="97">
|
||
|
<td><a id="l97" class='ln'>97</a></td><td> <span class="kw">for</span> (<a id="97c8" class="tk">i</a> = 0; <a id="97c15" class="tk">i</a> <a id="97c17" class="tk"><</a> <a id="97c19" class="tk">nXc</a>; <a id="97c24" class="tk">i</a><a id="97c25" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="98" id="98">
|
||
|
<td><a id="l98" class='ln'>98</a></td><td> <a id="98c5" class="tk">x</a>[<a id="98c7" class="tk">i</a>] = <a id="98c12" class="tk">y</a>[<a id="98c14" class="tk">i</a>] <a id="98c17" class="tk">+</a> (<a id="98c20" class="tk">f0</a>[<a id="98c23" class="tk">i</a>]<a id="98c25" class="tk">*</a><a id="98c26" class="tk">hB</a>[0] <a id="98c32" class="tk">+</a> <a id="98c34" class="tk">f1</a>[<a id="98c37" class="tk">i</a>]<a id="98c39" class="tk">*</a><a id="98c40" class="tk">hB</a>[1] <a id="98c46" class="tk">+</a> <a id="98c48" class="tk">f2</a>[<a id="98c51" class="tk">i</a>]<a id="98c53" class="tk">*</a><a id="98c54" class="tk">hB</a>[2]);</td></tr>
|
||
|
<tr name="99" id="99">
|
||
|
<td><a id="l99" class='ln'>99</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="100" id="100">
|
||
|
<td><a id="l100" class='ln'>100</a></td><td></td></tr>
|
||
|
<tr name="101" id="101">
|
||
|
<td><a id="l101" class='ln'>101</a></td><td> <a id="101c3" class="tk">rtsiSetT</a>(<a id="101c12" class="tk">si</a>, <a id="101c16" class="tk">tnew</a>);</td></tr>
|
||
|
<tr name="102" id="102">
|
||
|
<td><a id="l102" class='ln'>102</a></td><td> <a id="102c3" class="tk">rtsiSetSimTimeStep</a>(<a id="102c22" class="tk">si</a>,<a id="102c25" class="tk">MAJOR_TIME_STEP</a>);</td></tr>
|
||
|
<tr name="103" id="103">
|
||
|
<td><a id="l103" class='ln'>103</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="104" id="104">
|
||
|
<td><a id="l104" class='ln'>104</a></td><td></td></tr>
|
||
|
<tr name="105" id="105">
|
||
|
<td><a id="l105" class='ln'>105</a></td><td><span class="ct">/* Model step function */</span></td></tr>
|
||
|
<tr name="106" id="106">
|
||
|
<td><a id="l106" class='ln'>106</a></td><td><span class="kw">void</span> <a id="106c6" class="tk">Arduino_skalModelClass</a>::<a id="106c30" class="tk">step</a>()</td></tr>
|
||
|
<tr name="107" id="107">
|
||
|
<td><a id="l107" class='ln'>107</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="108" id="108">
|
||
|
<td><a id="l108" class='ln'>108</a></td><td> <span class="kw">const</span> <a id="108c9" class="tk">real_T</a> <a id="108c16" class="tk">*</a><a id="108c17" class="tk">tmp_3</a>;</td></tr>
|
||
|
<tr name="109" id="109">
|
||
|
<td><a id="l109" class='ln'>109</a></td><td> <a id="109c3" class="tk">real_T</a> <a id="109c10" class="tk">currentTime</a>;</td></tr>
|
||
|
<tr name="110" id="110">
|
||
|
<td><a id="l110" class='ln'>110</a></td><td> <a id="110c3" class="tk">real_T</a> <a id="110c10" class="tk">tmp</a>;</td></tr>
|
||
|
<tr name="111" id="111">
|
||
|
<td><a id="l111" class='ln'>111</a></td><td> <a id="111c3" class="tk">real_T</a> <a id="111c10" class="tk">tmp_0</a>;</td></tr>
|
||
|
<tr name="112" id="112">
|
||
|
<td><a id="l112" class='ln'>112</a></td><td> <a id="112c3" class="tk">real_T</a> <a id="112c10" class="tk">tmp_1</a>;</td></tr>
|
||
|
<tr name="113" id="113">
|
||
|
<td><a id="l113" class='ln'>113</a></td><td> <a id="113c3" class="tk">real_T</a> <a id="113c10" class="tk">tmp_2</a>;</td></tr>
|
||
|
<tr name="114" id="114">
|
||
|
<td><a id="l114" class='ln'>114</a></td><td> <a id="114c3" class="tk">real_T</a> <a id="114c10" class="tk">u0</a>;</td></tr>
|
||
|
<tr name="115" id="115">
|
||
|
<td><a id="l115" class='ln'>115</a></td><td> <a id="115c3" class="tk">int32_T</a> <a id="115c11" class="tk">i</a>;</td></tr>
|
||
|
<tr name="116" id="116">
|
||
|
<td><a id="l116" class='ln'>116</a></td><td> <a id="116c3" class="tk">int32_T</a> <a id="116c11" class="tk">i_0</a>;</td></tr>
|
||
|
<tr name="117" id="117">
|
||
|
<td><a id="l117" class='ln'>117</a></td><td> <span class="kw">if</span> (<a id="117c7" class="tk">rtmIsMajorTimeStep</a>((<a id="117c27" class="tk">&</a><a id="117c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="118" id="118">
|
||
|
<td><a id="l118" class='ln'>118</a></td><td> <span class="ct">/* set solver stop time */</span></td></tr>
|
||
|
<tr name="119" id="119">
|
||
|
<td><a id="l119" class='ln'>119</a></td><td> <span class="kw">if</span> (<a id="119c9" class="tk">!</a>((<a id="119c12" class="tk">&</a><a id="119c13" class="tk">Arduino_skal_M</a>)-><a id="119c30" class="tk">Timing</a>.<a id="119c37" class="tk">clockTick0</a><a id="119c47" class="tk">+</a>1)) <span class="br">{</span></td></tr>
|
||
|
<tr name="120" id="120">
|
||
|
<td><a id="l120" class='ln'>120</a></td><td> <a id="120c7" class="tk">rtsiSetSolverStopTime</a>(<a id="120c29" class="tk">&</a>(<a id="120c31" class="tk">&</a><a id="120c32" class="tk">Arduino_skal_M</a>)-><a id="120c49" class="tk">solverInfo</a>, (((<a id="120c64" class="tk">&</a><a id="120c65" class="tk">Arduino_skal_M</a></td></tr>
|
||
|
<tr name="121" id="121">
|
||
|
<td><a id="l121" class='ln'>121</a></td><td> )-><a id="121c12" class="tk">Timing</a>.<a id="121c19" class="tk">clockTickH0</a> <a id="121c31" class="tk">+</a> 1) <a id="121c36" class="tk">*</a> (<a id="121c39" class="tk">&</a><a id="121c40" class="tk">Arduino_skal_M</a>)-><a id="121c57" class="tk">Timing</a>.<a id="121c64" class="tk">stepSize0</a> <a id="121c74" class="tk">*</a></td></tr>
|
||
|
<tr name="122" id="122">
|
||
|
<td><a id="l122" class='ln'>122</a></td><td> 4294967296.0));</td></tr>
|
||
|
<tr name="123" id="123">
|
||
|
<td><a id="l123" class='ln'>123</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
|
||
|
<tr name="124" id="124">
|
||
|
<td><a id="l124" class='ln'>124</a></td><td> <a id="124c7" class="tk">rtsiSetSolverStopTime</a>(<a id="124c29" class="tk">&</a>(<a id="124c31" class="tk">&</a><a id="124c32" class="tk">Arduino_skal_M</a>)-><a id="124c49" class="tk">solverInfo</a>, (((<a id="124c64" class="tk">&</a><a id="124c65" class="tk">Arduino_skal_M</a></td></tr>
|
||
|
<tr name="125" id="125">
|
||
|
<td><a id="l125" class='ln'>125</a></td><td> )-><a id="125c12" class="tk">Timing</a>.<a id="125c19" class="tk">clockTick0</a> <a id="125c30" class="tk">+</a> 1) <a id="125c35" class="tk">*</a> (<a id="125c38" class="tk">&</a><a id="125c39" class="tk">Arduino_skal_M</a>)-><a id="125c56" class="tk">Timing</a>.<a id="125c63" class="tk">stepSize0</a> <a id="125c73" class="tk">+</a></td></tr>
|
||
|
<tr name="126" id="126">
|
||
|
<td><a id="l126" class='ln'>126</a></td><td> (<a id="126c10" class="tk">&</a><a id="126c11" class="tk">Arduino_skal_M</a>)-><a id="126c28" class="tk">Timing</a>.<a id="126c35" class="tk">clockTickH0</a> <a id="126c47" class="tk">*</a> (<a id="126c50" class="tk">&</a><a id="126c51" class="tk">Arduino_skal_M</a>)</td></tr>
|
||
|
<tr name="127" id="127">
|
||
|
<td><a id="l127" class='ln'>127</a></td><td> -><a id="127c11" class="tk">Timing</a>.<a id="127c18" class="tk">stepSize0</a> <a id="127c28" class="tk">*</a> 4294967296.0));</td></tr>
|
||
|
<tr name="128" id="128">
|
||
|
<td><a id="l128" class='ln'>128</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="129" id="129">
|
||
|
<td><a id="l129" class='ln'>129</a></td><td> <span class="br">}</span> <span class="ct">/* end MajorTimeStep */</span></td></tr>
|
||
|
<tr name="130" id="130">
|
||
|
<td><a id="l130" class='ln'>130</a></td><td></td></tr>
|
||
|
<tr name="131" id="131">
|
||
|
<td><a id="l131" class='ln'>131</a></td><td> <span class="ct">/* Update absolute time of base rate at minor time step */</span></td></tr>
|
||
|
<tr name="132" id="132">
|
||
|
<td><a id="l132" class='ln'>132</a></td><td> <span class="kw">if</span> (<a id="132c7" class="tk">rtmIsMinorTimeStep</a>((<a id="132c27" class="tk">&</a><a id="132c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="133" id="133">
|
||
|
<td><a id="l133" class='ln'>133</a></td><td> (<a id="133c6" class="tk">&</a><a id="133c7" class="tk">Arduino_skal_M</a>)-><a id="133c24" class="tk">Timing</a>.<a id="133c31" class="tk">t</a>[0] = <a id="133c38" class="tk">rtsiGetT</a>(<a id="133c47" class="tk">&</a>(<a id="133c49" class="tk">&</a><a id="133c50" class="tk">Arduino_skal_M</a>)-><a id="133c67" class="tk">solverInfo</a>);</td></tr>
|
||
|
<tr name="134" id="134">
|
||
|
<td><a id="l134" class='ln'>134</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="135" id="135">
|
||
|
<td><a id="l135" class='ln'>135</a></td><td></td></tr>
|
||
|
<tr name="136" id="136">
|
||
|
<td><a id="l136" class='ln'>136</a></td><td> <span class="kw">if</span> (<a id="136c7" class="tk">rtmIsMajorTimeStep</a>((<a id="136c27" class="tk">&</a><a id="136c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="137" id="137">
|
||
|
<td><a id="l137" class='ln'>137</a></td><td> <span class="ct">/* Constant: '<S1>/X0' */</span></td></tr>
|
||
|
<tr name="138" id="138">
|
||
|
<td><a id="l138" class='ln'>138</a></td><td> <a id="138c5" class="tk">Arduino_skal_B</a>.<a id="138c20" class="tk">X0</a>[0] = <a id="138c28" class="tk">Arduino_skal_P</a>.<a id="138c43" class="tk">X0_Value</a>[0];</td></tr>
|
||
|
<tr name="139" id="139">
|
||
|
<td><a id="l139" class='ln'>139</a></td><td> <a id="139c5" class="tk">Arduino_skal_B</a>.<a id="139c20" class="tk">X0</a>[1] = <a id="139c28" class="tk">Arduino_skal_P</a>.<a id="139c43" class="tk">X0_Value</a>[1];</td></tr>
|
||
|
<tr name="140" id="140">
|
||
|
<td><a id="l140" class='ln'>140</a></td><td> <a id="140c5" class="tk">Arduino_skal_B</a>.<a id="140c20" class="tk">X0</a>[2] = <a id="140c28" class="tk">Arduino_skal_P</a>.<a id="140c43" class="tk">X0_Value</a>[2];</td></tr>
|
||
|
<tr name="141" id="141">
|
||
|
<td><a id="l141" class='ln'>141</a></td><td> <a id="141c5" class="tk">Arduino_skal_B</a>.<a id="141c20" class="tk">X0</a>[3] = <a id="141c28" class="tk">Arduino_skal_P</a>.<a id="141c43" class="tk">X0_Value</a>[3];</td></tr>
|
||
|
<tr name="142" id="142">
|
||
|
<td><a id="l142" class='ln'>142</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="143" id="143">
|
||
|
<td><a id="l143" class='ln'>143</a></td><td></td></tr>
|
||
|
<tr name="144" id="144">
|
||
|
<td><a id="l144" class='ln'>144</a></td><td> <span class="ct">/* Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="145" id="145">
|
||
|
<td><a id="l145" class='ln'>145</a></td><td> <span class="kw">if</span> (<a id="145c7" class="tk">Arduino_skal_DW</a>.<a id="145c23" class="tk">MemoryX_IWORK</a> <a id="145c37" class="tk">!=</a> 0) <span class="br">{</span></td></tr>
|
||
|
<tr name="146" id="146">
|
||
|
<td><a id="l146" class='ln'>146</a></td><td> <a id="146c5" class="tk">Arduino_skal_X</a>.<a id="146c20" class="tk">MemoryX_CSTATE</a>[0] = <a id="146c40" class="tk">Arduino_skal_B</a>.<a id="146c55" class="tk">X0</a>[0];</td></tr>
|
||
|
<tr name="147" id="147">
|
||
|
<td><a id="l147" class='ln'>147</a></td><td> <a id="147c5" class="tk">Arduino_skal_X</a>.<a id="147c20" class="tk">MemoryX_CSTATE</a>[1] = <a id="147c40" class="tk">Arduino_skal_B</a>.<a id="147c55" class="tk">X0</a>[1];</td></tr>
|
||
|
<tr name="148" id="148">
|
||
|
<td><a id="l148" class='ln'>148</a></td><td> <a id="148c5" class="tk">Arduino_skal_X</a>.<a id="148c20" class="tk">MemoryX_CSTATE</a>[2] = <a id="148c40" class="tk">Arduino_skal_B</a>.<a id="148c55" class="tk">X0</a>[2];</td></tr>
|
||
|
<tr name="149" id="149">
|
||
|
<td><a id="l149" class='ln'>149</a></td><td> <a id="149c5" class="tk">Arduino_skal_X</a>.<a id="149c20" class="tk">MemoryX_CSTATE</a>[3] = <a id="149c40" class="tk">Arduino_skal_B</a>.<a id="149c55" class="tk">X0</a>[3];</td></tr>
|
||
|
<tr name="150" id="150">
|
||
|
<td><a id="l150" class='ln'>150</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="151" id="151">
|
||
|
<td><a id="l151" class='ln'>151</a></td><td></td></tr>
|
||
|
<tr name="152" id="152">
|
||
|
<td><a id="l152" class='ln'>152</a></td><td> <span class="ct">/* Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="153" id="153">
|
||
|
<td><a id="l153" class='ln'>153</a></td><td> <a id="153c3" class="tk">Arduino_skal_B</a>.<a id="153c18" class="tk">MemoryX</a>[0] = <a id="153c31" class="tk">Arduino_skal_X</a>.<a id="153c46" class="tk">MemoryX_CSTATE</a>[0];</td></tr>
|
||
|
<tr name="154" id="154">
|
||
|
<td><a id="l154" class='ln'>154</a></td><td></td></tr>
|
||
|
<tr name="155" id="155">
|
||
|
<td><a id="l155" class='ln'>155</a></td><td> <span class="ct">/* Gain: '<Root>/Gain' */</span></td></tr>
|
||
|
<tr name="156" id="156">
|
||
|
<td><a id="l156" class='ln'>156</a></td><td> <a id="156c3" class="tk">u0</a> = <a id="156c8" class="tk">Arduino_skal_P</a>.<a id="156c23" class="tk">K</a>[0] <a id="156c28" class="tk">*</a> <a id="156c30" class="tk">Arduino_skal_B</a>.<a id="156c45" class="tk">MemoryX</a>[0];</td></tr>
|
||
|
<tr name="157" id="157">
|
||
|
<td><a id="l157" class='ln'>157</a></td><td></td></tr>
|
||
|
<tr name="158" id="158">
|
||
|
<td><a id="l158" class='ln'>158</a></td><td> <span class="ct">/* Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="159" id="159">
|
||
|
<td><a id="l159" class='ln'>159</a></td><td> <a id="159c3" class="tk">Arduino_skal_B</a>.<a id="159c18" class="tk">MemoryX</a>[1] = <a id="159c31" class="tk">Arduino_skal_X</a>.<a id="159c46" class="tk">MemoryX_CSTATE</a>[1];</td></tr>
|
||
|
<tr name="160" id="160">
|
||
|
<td><a id="l160" class='ln'>160</a></td><td></td></tr>
|
||
|
<tr name="161" id="161">
|
||
|
<td><a id="l161" class='ln'>161</a></td><td> <span class="ct">/* Gain: '<Root>/Gain' */</span></td></tr>
|
||
|
<tr name="162" id="162">
|
||
|
<td><a id="l162" class='ln'>162</a></td><td> <a id="162c3" class="tk">u0</a> <a id="162c6" class="tk">+=</a> <a id="162c9" class="tk">Arduino_skal_P</a>.<a id="162c24" class="tk">K</a>[1] <a id="162c29" class="tk">*</a> <a id="162c31" class="tk">Arduino_skal_B</a>.<a id="162c46" class="tk">MemoryX</a>[1];</td></tr>
|
||
|
<tr name="163" id="163">
|
||
|
<td><a id="l163" class='ln'>163</a></td><td></td></tr>
|
||
|
<tr name="164" id="164">
|
||
|
<td><a id="l164" class='ln'>164</a></td><td> <span class="ct">/* Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="165" id="165">
|
||
|
<td><a id="l165" class='ln'>165</a></td><td> <a id="165c3" class="tk">Arduino_skal_B</a>.<a id="165c18" class="tk">MemoryX</a>[2] = <a id="165c31" class="tk">Arduino_skal_X</a>.<a id="165c46" class="tk">MemoryX_CSTATE</a>[2];</td></tr>
|
||
|
<tr name="166" id="166">
|
||
|
<td><a id="l166" class='ln'>166</a></td><td></td></tr>
|
||
|
<tr name="167" id="167">
|
||
|
<td><a id="l167" class='ln'>167</a></td><td> <span class="ct">/* Gain: '<Root>/Gain' */</span></td></tr>
|
||
|
<tr name="168" id="168">
|
||
|
<td><a id="l168" class='ln'>168</a></td><td> <a id="168c3" class="tk">u0</a> <a id="168c6" class="tk">+=</a> <a id="168c9" class="tk">Arduino_skal_P</a>.<a id="168c24" class="tk">K</a>[2] <a id="168c29" class="tk">*</a> <a id="168c31" class="tk">Arduino_skal_B</a>.<a id="168c46" class="tk">MemoryX</a>[2];</td></tr>
|
||
|
<tr name="169" id="169">
|
||
|
<td><a id="l169" class='ln'>169</a></td><td></td></tr>
|
||
|
<tr name="170" id="170">
|
||
|
<td><a id="l170" class='ln'>170</a></td><td> <span class="ct">/* Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="171" id="171">
|
||
|
<td><a id="l171" class='ln'>171</a></td><td> <a id="171c3" class="tk">Arduino_skal_B</a>.<a id="171c18" class="tk">MemoryX</a>[3] = <a id="171c31" class="tk">Arduino_skal_X</a>.<a id="171c46" class="tk">MemoryX_CSTATE</a>[3];</td></tr>
|
||
|
<tr name="172" id="172">
|
||
|
<td><a id="l172" class='ln'>172</a></td><td></td></tr>
|
||
|
<tr name="173" id="173">
|
||
|
<td><a id="l173" class='ln'>173</a></td><td> <span class="ct">/* Gain: '<Root>/Gain' */</span></td></tr>
|
||
|
<tr name="174" id="174">
|
||
|
<td><a id="l174" class='ln'>174</a></td><td> <a id="174c3" class="tk">u0</a> <a id="174c6" class="tk">+=</a> <a id="174c9" class="tk">Arduino_skal_P</a>.<a id="174c24" class="tk">K</a>[3] <a id="174c29" class="tk">*</a> <a id="174c31" class="tk">Arduino_skal_B</a>.<a id="174c46" class="tk">MemoryX</a>[3];</td></tr>
|
||
|
<tr name="175" id="175">
|
||
|
<td><a id="l175" class='ln'>175</a></td><td></td></tr>
|
||
|
<tr name="176" id="176">
|
||
|
<td><a id="l176" class='ln'>176</a></td><td> <span class="ct">/* Gain: '<Root>/Gain' */</span></td></tr>
|
||
|
<tr name="177" id="177">
|
||
|
<td><a id="l177" class='ln'>177</a></td><td> <a id="177c3" class="tk">Arduino_skal_B</a>.<a id="177c18" class="tk">Gain</a> = <a id="177c25" class="tk">u0</a>;</td></tr>
|
||
|
<tr name="178" id="178">
|
||
|
<td><a id="l178" class='ln'>178</a></td><td> <span class="kw">if</span> (<a id="178c7" class="tk">rtmIsMajorTimeStep</a>((<a id="178c27" class="tk">&</a><a id="178c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="179" id="179">
|
||
|
<td><a id="l179" class='ln'>179</a></td><td> <span class="ct">/* MATLAB Function: '<S51>/SqrtUsedFcn' incorporates:</span></td></tr>
|
||
|
<tr name="180" id="180">
|
||
|
<td><a id="l180" class='ln'>180</a></td><td><span class="ct"> * Constant: '<S2>/CovarianceZ'</span></td></tr>
|
||
|
<tr name="181" id="181">
|
||
|
<td><a id="l181" class='ln'>181</a></td><td><span class="ct"> * Constant: '<S51>/isSqrtUsed'</span></td></tr>
|
||
|
<tr name="182" id="182">
|
||
|
<td><a id="l182" class='ln'>182</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="183" id="183">
|
||
|
<td><a id="l183" class='ln'>183</a></td><td> <span class="ct">/* : if isSqrtUsed */</span></td></tr>
|
||
|
<tr name="184" id="184">
|
||
|
<td><a id="l184" class='ln'>184</a></td><td> <span class="kw">if</span> (<a id="184c9" class="tk">Arduino_skal_P</a>.<a id="184c24" class="tk">isSqrtUsed_Value</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="185" id="185">
|
||
|
<td><a id="l185" class='ln'>185</a></td><td> <span class="ct">/* : P = u*u.'; */</span></td></tr>
|
||
|
<tr name="186" id="186">
|
||
|
<td><a id="l186" class='ln'>186</a></td><td> <span class="kw">for</span> (<a id="186c12" class="tk">i</a> = 0; <a id="186c19" class="tk">i</a> <a id="186c21" class="tk"><</a> 4; <a id="186c26" class="tk">i</a><a id="186c27" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="187" id="187">
|
||
|
<td><a id="l187" class='ln'>187</a></td><td> <span class="kw">for</span> (<a id="187c14" class="tk">i_0</a> = 0; <a id="187c23" class="tk">i_0</a> <a id="187c27" class="tk"><</a> 4; <a id="187c32" class="tk">i_0</a><a id="187c35" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="188" id="188">
|
||
|
<td><a id="l188" class='ln'>188</a></td><td> <a id="188c11" class="tk">Arduino_skal_B</a>.<a id="188c26" class="tk">P</a>[<a id="188c28" class="tk">i_0</a> <a id="188c32" class="tk">+</a> (<a id="188c35" class="tk">i</a> <a id="188c37" class="tk"><<</a> 2)] = 0.0;</td></tr>
|
||
|
<tr name="189" id="189">
|
||
|
<td><a id="l189" class='ln'>189</a></td><td> <a id="189c11" class="tk">Arduino_skal_B</a>.<a id="189c26" class="tk">P</a>[<a id="189c28" class="tk">i_0</a> <a id="189c32" class="tk">+</a> (<a id="189c35" class="tk">i</a> <a id="189c37" class="tk"><<</a> 2)] <a id="189c44" class="tk">+=</a></td></tr>
|
||
|
<tr name="190" id="190">
|
||
|
<td><a id="l190" class='ln'>190</a></td><td> <a id="190c13" class="tk">Arduino_skal_P</a>.<a id="190c28" class="tk">CovarianceZ_Value</a>[<a id="190c46" class="tk">i_0</a>] <a id="190c51" class="tk">*</a></td></tr>
|
||
|
<tr name="191" id="191">
|
||
|
<td><a id="l191" class='ln'>191</a></td><td> <a id="191c13" class="tk">Arduino_skal_P</a>.<a id="191c28" class="tk">CovarianceZ_Value</a>[<a id="191c46" class="tk">i</a>];</td></tr>
|
||
|
<tr name="192" id="192">
|
||
|
<td><a id="l192" class='ln'>192</a></td><td> <a id="192c11" class="tk">Arduino_skal_B</a>.<a id="192c26" class="tk">P</a>[<a id="192c28" class="tk">i_0</a> <a id="192c32" class="tk">+</a> (<a id="192c35" class="tk">i</a> <a id="192c37" class="tk"><<</a> 2)] <a id="192c44" class="tk">+=</a></td></tr>
|
||
|
<tr name="193" id="193">
|
||
|
<td><a id="l193" class='ln'>193</a></td><td> <a id="193c13" class="tk">Arduino_skal_P</a>.<a id="193c28" class="tk">CovarianceZ_Value</a>[<a id="193c46" class="tk">i_0</a> <a id="193c50" class="tk">+</a> 4] <a id="193c55" class="tk">*</a></td></tr>
|
||
|
<tr name="194" id="194">
|
||
|
<td><a id="l194" class='ln'>194</a></td><td> <a id="194c13" class="tk">Arduino_skal_P</a>.<a id="194c28" class="tk">CovarianceZ_Value</a>[<a id="194c46" class="tk">i</a> <a id="194c48" class="tk">+</a> 4];</td></tr>
|
||
|
<tr name="195" id="195">
|
||
|
<td><a id="l195" class='ln'>195</a></td><td> <a id="195c11" class="tk">Arduino_skal_B</a>.<a id="195c26" class="tk">P</a>[<a id="195c28" class="tk">i_0</a> <a id="195c32" class="tk">+</a> (<a id="195c35" class="tk">i</a> <a id="195c37" class="tk"><<</a> 2)] <a id="195c44" class="tk">+=</a></td></tr>
|
||
|
<tr name="196" id="196">
|
||
|
<td><a id="l196" class='ln'>196</a></td><td> <a id="196c13" class="tk">Arduino_skal_P</a>.<a id="196c28" class="tk">CovarianceZ_Value</a>[<a id="196c46" class="tk">i_0</a> <a id="196c50" class="tk">+</a> 8] <a id="196c55" class="tk">*</a></td></tr>
|
||
|
<tr name="197" id="197">
|
||
|
<td><a id="l197" class='ln'>197</a></td><td> <a id="197c13" class="tk">Arduino_skal_P</a>.<a id="197c28" class="tk">CovarianceZ_Value</a>[<a id="197c46" class="tk">i</a> <a id="197c48" class="tk">+</a> 8];</td></tr>
|
||
|
<tr name="198" id="198">
|
||
|
<td><a id="l198" class='ln'>198</a></td><td> <a id="198c11" class="tk">Arduino_skal_B</a>.<a id="198c26" class="tk">P</a>[<a id="198c28" class="tk">i_0</a> <a id="198c32" class="tk">+</a> (<a id="198c35" class="tk">i</a> <a id="198c37" class="tk"><<</a> 2)] <a id="198c44" class="tk">+=</a></td></tr>
|
||
|
<tr name="199" id="199">
|
||
|
<td><a id="l199" class='ln'>199</a></td><td> <a id="199c13" class="tk">Arduino_skal_P</a>.<a id="199c28" class="tk">CovarianceZ_Value</a>[<a id="199c46" class="tk">i_0</a> <a id="199c50" class="tk">+</a> 12] <a id="199c56" class="tk">*</a></td></tr>
|
||
|
<tr name="200" id="200">
|
||
|
<td><a id="l200" class='ln'>200</a></td><td> <a id="200c13" class="tk">Arduino_skal_P</a>.<a id="200c28" class="tk">CovarianceZ_Value</a>[<a id="200c46" class="tk">i</a> <a id="200c48" class="tk">+</a> 12];</td></tr>
|
||
|
<tr name="201" id="201">
|
||
|
<td><a id="l201" class='ln'>201</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="202" id="202">
|
||
|
<td><a id="l202" class='ln'>202</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="203" id="203">
|
||
|
<td><a id="l203" class='ln'>203</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
|
||
|
<tr name="204" id="204">
|
||
|
<td><a id="l204" class='ln'>204</a></td><td> <span class="ct">/* : else */</span></td></tr>
|
||
|
<tr name="205" id="205">
|
||
|
<td><a id="l205" class='ln'>205</a></td><td> <span class="ct">/* : P = u; */</span></td></tr>
|
||
|
<tr name="206" id="206">
|
||
|
<td><a id="l206" class='ln'>206</a></td><td> <a id="206c7" class="tk">std</a>::<a id="206c12" class="tk">memcpy</a>(<a id="206c19" class="tk">&</a><a id="206c20" class="tk">Arduino_skal_B</a>.<a id="206c35" class="tk">P</a>[0], <a id="206c41" class="tk">&</a><a id="206c42" class="tk">Arduino_skal_P</a>.<a id="206c57" class="tk">CovarianceZ_Value</a>[0],</td></tr>
|
||
|
<tr name="207" id="207">
|
||
|
<td><a id="l207" class='ln'>207</a></td><td> <span class="kw">sizeof</span>(<a id="207c26" class="tk">real_T</a>) <a id="207c34" class="tk"><<</a> 4U);</td></tr>
|
||
|
<tr name="208" id="208">
|
||
|
<td><a id="l208" class='ln'>208</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="209" id="209">
|
||
|
<td><a id="l209" class='ln'>209</a></td><td></td></tr>
|
||
|
<tr name="210" id="210">
|
||
|
<td><a id="l210" class='ln'>210</a></td><td> <span class="ct">/* End of MATLAB Function: '<S51>/SqrtUsedFcn' */</span></td></tr>
|
||
|
<tr name="211" id="211">
|
||
|
<td><a id="l211" class='ln'>211</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="212" id="212">
|
||
|
<td><a id="l212" class='ln'>212</a></td><td></td></tr>
|
||
|
<tr name="213" id="213">
|
||
|
<td><a id="l213" class='ln'>213</a></td><td> <span class="ct">/* Product: '<S22>/A[k]*xhat[k|k-1]' incorporates:</span></td></tr>
|
||
|
<tr name="214" id="214">
|
||
|
<td><a id="l214" class='ln'>214</a></td><td><span class="ct"> * Constant: '<S1>/A'</span></td></tr>
|
||
|
<tr name="215" id="215">
|
||
|
<td><a id="l215" class='ln'>215</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="216" id="216">
|
||
|
<td><a id="l216" class='ln'>216</a></td><td> <a id="216c3" class="tk">tmp_3</a> = <a id="216c11" class="tk">&</a><a id="216c12" class="tk">Arduino_skal_P</a>.<a id="216c27" class="tk">A_Value</a>[0];</td></tr>
|
||
|
<tr name="217" id="217">
|
||
|
<td><a id="l217" class='ln'>217</a></td><td> <a id="217c3" class="tk">tmp</a> = <a id="217c9" class="tk">Arduino_skal_B</a>.<a id="217c24" class="tk">MemoryX</a>[0];</td></tr>
|
||
|
<tr name="218" id="218">
|
||
|
<td><a id="l218" class='ln'>218</a></td><td> <a id="218c3" class="tk">tmp_0</a> = <a id="218c11" class="tk">Arduino_skal_B</a>.<a id="218c26" class="tk">MemoryX</a>[1];</td></tr>
|
||
|
<tr name="219" id="219">
|
||
|
<td><a id="l219" class='ln'>219</a></td><td> <a id="219c3" class="tk">tmp_1</a> = <a id="219c11" class="tk">Arduino_skal_B</a>.<a id="219c26" class="tk">MemoryX</a>[2];</td></tr>
|
||
|
<tr name="220" id="220">
|
||
|
<td><a id="l220" class='ln'>220</a></td><td> <a id="220c3" class="tk">tmp_2</a> = <a id="220c11" class="tk">Arduino_skal_B</a>.<a id="220c26" class="tk">MemoryX</a>[3];</td></tr>
|
||
|
<tr name="221" id="221">
|
||
|
<td><a id="l221" class='ln'>221</a></td><td> <span class="kw">for</span> (<a id="221c8" class="tk">i</a> = 0; <a id="221c15" class="tk">i</a> <a id="221c17" class="tk"><</a> 4; <a id="221c22" class="tk">i</a><a id="221c23" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="222" id="222">
|
||
|
<td><a id="l222" class='ln'>222</a></td><td> <a id="222c5" class="tk">u0</a> = <a id="222c10" class="tk">tmp_3</a>[<a id="222c16" class="tk">i</a>] <a id="222c19" class="tk">*</a> <a id="222c21" class="tk">tmp</a>;</td></tr>
|
||
|
<tr name="223" id="223">
|
||
|
<td><a id="l223" class='ln'>223</a></td><td> <a id="223c5" class="tk">u0</a> <a id="223c8" class="tk">+=</a> <a id="223c11" class="tk">tmp_3</a>[<a id="223c17" class="tk">i</a> <a id="223c19" class="tk">+</a> 4] <a id="223c24" class="tk">*</a> <a id="223c26" class="tk">tmp_0</a>;</td></tr>
|
||
|
<tr name="224" id="224">
|
||
|
<td><a id="l224" class='ln'>224</a></td><td> <a id="224c5" class="tk">u0</a> <a id="224c8" class="tk">+=</a> <a id="224c11" class="tk">tmp_3</a>[<a id="224c17" class="tk">i</a> <a id="224c19" class="tk">+</a> 8] <a id="224c24" class="tk">*</a> <a id="224c26" class="tk">tmp_1</a>;</td></tr>
|
||
|
<tr name="225" id="225">
|
||
|
<td><a id="l225" class='ln'>225</a></td><td> <a id="225c5" class="tk">u0</a> <a id="225c8" class="tk">+=</a> <a id="225c11" class="tk">tmp_3</a>[<a id="225c17" class="tk">i</a> <a id="225c19" class="tk">+</a> 12] <a id="225c25" class="tk">*</a> <a id="225c27" class="tk">tmp_2</a>;</td></tr>
|
||
|
<tr name="226" id="226">
|
||
|
<td><a id="l226" class='ln'>226</a></td><td></td></tr>
|
||
|
<tr name="227" id="227">
|
||
|
<td><a id="l227" class='ln'>227</a></td><td> <span class="ct">/* Product: '<S22>/A[k]*xhat[k|k-1]' */</span></td></tr>
|
||
|
<tr name="228" id="228">
|
||
|
<td><a id="l228" class='ln'>228</a></td><td> <a id="228c5" class="tk">Arduino_skal_B</a>.<a id="228c20" class="tk">Akxhatkk1</a>[<a id="228c30" class="tk">i</a>] = <a id="228c35" class="tk">u0</a>;</td></tr>
|
||
|
<tr name="229" id="229">
|
||
|
<td><a id="l229" class='ln'>229</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="230" id="230">
|
||
|
<td><a id="l230" class='ln'>230</a></td><td></td></tr>
|
||
|
<tr name="231" id="231">
|
||
|
<td><a id="l231" class='ln'>231</a></td><td> <span class="ct">/* End of Product: '<S22>/A[k]*xhat[k|k-1]' */</span></td></tr>
|
||
|
<tr name="232" id="232">
|
||
|
<td><a id="l232" class='ln'>232</a></td><td></td></tr>
|
||
|
<tr name="233" id="233">
|
||
|
<td><a id="l233" class='ln'>233</a></td><td> <span class="ct">/* Step: '<Root>/Step' */</span></td></tr>
|
||
|
<tr name="234" id="234">
|
||
|
<td><a id="l234" class='ln'>234</a></td><td> <a id="234c3" class="tk">currentTime</a> = (<a id="234c18" class="tk">&</a><a id="234c19" class="tk">Arduino_skal_M</a>)-><a id="234c36" class="tk">Timing</a>.<a id="234c43" class="tk">t</a>[0];</td></tr>
|
||
|
<tr name="235" id="235">
|
||
|
<td><a id="l235" class='ln'>235</a></td><td> <span class="kw">if</span> (<a id="235c7" class="tk">currentTime</a> <a id="235c19" class="tk"><</a> <a id="235c21" class="tk">Arduino_skal_P</a>.<a id="235c36" class="tk">Step_Time</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="236" id="236">
|
||
|
<td><a id="l236" class='ln'>236</a></td><td> <span class="ct">/* Step: '<Root>/Step' */</span></td></tr>
|
||
|
<tr name="237" id="237">
|
||
|
<td><a id="l237" class='ln'>237</a></td><td> <a id="237c5" class="tk">Arduino_skal_B</a>.<a id="237c20" class="tk">Step</a> = <a id="237c27" class="tk">Arduino_skal_P</a>.<a id="237c42" class="tk">Step_Y0</a>;</td></tr>
|
||
|
<tr name="238" id="238">
|
||
|
<td><a id="l238" class='ln'>238</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
|
||
|
<tr name="239" id="239">
|
||
|
<td><a id="l239" class='ln'>239</a></td><td> <span class="ct">/* Step: '<Root>/Step' */</span></td></tr>
|
||
|
<tr name="240" id="240">
|
||
|
<td><a id="l240" class='ln'>240</a></td><td> <a id="240c5" class="tk">Arduino_skal_B</a>.<a id="240c20" class="tk">Step</a> = <a id="240c27" class="tk">Arduino_skal_P</a>.<a id="240c42" class="tk">Step_YFinal</a>;</td></tr>
|
||
|
<tr name="241" id="241">
|
||
|
<td><a id="l241" class='ln'>241</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="242" id="242">
|
||
|
<td><a id="l242" class='ln'>242</a></td><td></td></tr>
|
||
|
<tr name="243" id="243">
|
||
|
<td><a id="l243" class='ln'>243</a></td><td> <span class="ct">/* End of Step: '<Root>/Step' */</span></td></tr>
|
||
|
<tr name="244" id="244">
|
||
|
<td><a id="l244" class='ln'>244</a></td><td></td></tr>
|
||
|
<tr name="245" id="245">
|
||
|
<td><a id="l245" class='ln'>245</a></td><td> <span class="ct">/* Gain: '<Root>/Kr' */</span></td></tr>
|
||
|
<tr name="246" id="246">
|
||
|
<td><a id="l246" class='ln'>246</a></td><td> <a id="246c3" class="tk">Arduino_skal_B</a>.<a id="246c18" class="tk">Kr</a> = <a id="246c23" class="tk">Arduino_skal_P</a>.<a id="246c38" class="tk">Kr</a> <a id="246c41" class="tk">*</a> <a id="246c43" class="tk">Arduino_skal_B</a>.<a id="246c58" class="tk">Step</a>;</td></tr>
|
||
|
<tr name="247" id="247">
|
||
|
<td><a id="l247" class='ln'>247</a></td><td></td></tr>
|
||
|
<tr name="248" id="248">
|
||
|
<td><a id="l248" class='ln'>248</a></td><td> <span class="ct">/* Sum: '<Root>/Sum5' */</span></td></tr>
|
||
|
<tr name="249" id="249">
|
||
|
<td><a id="l249" class='ln'>249</a></td><td> <a id="249c3" class="tk">Arduino_skal_B</a>.<a id="249c18" class="tk">Sum5</a> = <a id="249c25" class="tk">Arduino_skal_B</a>.<a id="249c40" class="tk">Kr</a> <a id="249c43" class="tk">-</a> <a id="249c45" class="tk">Arduino_skal_B</a>.<a id="249c60" class="tk">Gain</a>;</td></tr>
|
||
|
<tr name="250" id="250">
|
||
|
<td><a id="l250" class='ln'>250</a></td><td></td></tr>
|
||
|
<tr name="251" id="251">
|
||
|
<td><a id="l251" class='ln'>251</a></td><td> <span class="ct">/* Saturate: '<Root>/Saturation' */</span></td></tr>
|
||
|
<tr name="252" id="252">
|
||
|
<td><a id="l252" class='ln'>252</a></td><td> <a id="252c3" class="tk">u0</a> = <a id="252c8" class="tk">Arduino_skal_B</a>.<a id="252c23" class="tk">Sum5</a>;</td></tr>
|
||
|
<tr name="253" id="253">
|
||
|
<td><a id="l253" class='ln'>253</a></td><td> <a id="253c3" class="tk">tmp</a> = <a id="253c9" class="tk">Arduino_skal_P</a>.<a id="253c24" class="tk">Saturation_LowerSat</a>;</td></tr>
|
||
|
<tr name="254" id="254">
|
||
|
<td><a id="l254" class='ln'>254</a></td><td> <a id="254c3" class="tk">tmp_0</a> = <a id="254c11" class="tk">Arduino_skal_P</a>.<a id="254c26" class="tk">Saturation_UpperSat</a>;</td></tr>
|
||
|
<tr name="255" id="255">
|
||
|
<td><a id="l255" class='ln'>255</a></td><td> <span class="kw">if</span> (<a id="255c7" class="tk">u0</a> <a id="255c10" class="tk">></a> <a id="255c12" class="tk">tmp_0</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="256" id="256">
|
||
|
<td><a id="l256" class='ln'>256</a></td><td> <span class="ct">/* Saturate: '<Root>/Saturation' */</span></td></tr>
|
||
|
<tr name="257" id="257">
|
||
|
<td><a id="l257" class='ln'>257</a></td><td> <a id="257c5" class="tk">Arduino_skal_B</a>.<a id="257c20" class="tk">Saturation</a> = <a id="257c33" class="tk">tmp_0</a>;</td></tr>
|
||
|
<tr name="258" id="258">
|
||
|
<td><a id="l258" class='ln'>258</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="kw">if</span> (<a id="258c14" class="tk">u0</a> <a id="258c17" class="tk"><</a> <a id="258c19" class="tk">tmp</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="259" id="259">
|
||
|
<td><a id="l259" class='ln'>259</a></td><td> <span class="ct">/* Saturate: '<Root>/Saturation' */</span></td></tr>
|
||
|
<tr name="260" id="260">
|
||
|
<td><a id="l260" class='ln'>260</a></td><td> <a id="260c5" class="tk">Arduino_skal_B</a>.<a id="260c20" class="tk">Saturation</a> = <a id="260c33" class="tk">tmp</a>;</td></tr>
|
||
|
<tr name="261" id="261">
|
||
|
<td><a id="l261" class='ln'>261</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="br">{</span></td></tr>
|
||
|
<tr name="262" id="262">
|
||
|
<td><a id="l262" class='ln'>262</a></td><td> <span class="ct">/* Saturate: '<Root>/Saturation' */</span></td></tr>
|
||
|
<tr name="263" id="263">
|
||
|
<td><a id="l263" class='ln'>263</a></td><td> <a id="263c5" class="tk">Arduino_skal_B</a>.<a id="263c20" class="tk">Saturation</a> = <a id="263c33" class="tk">u0</a>;</td></tr>
|
||
|
<tr name="264" id="264">
|
||
|
<td><a id="l264" class='ln'>264</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="265" id="265">
|
||
|
<td><a id="l265" class='ln'>265</a></td><td></td></tr>
|
||
|
<tr name="266" id="266">
|
||
|
<td><a id="l266" class='ln'>266</a></td><td> <span class="ct">/* End of Saturate: '<Root>/Saturation' */</span></td></tr>
|
||
|
<tr name="267" id="267">
|
||
|
<td><a id="l267" class='ln'>267</a></td><td></td></tr>
|
||
|
<tr name="268" id="268">
|
||
|
<td><a id="l268" class='ln'>268</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' incorporates:</span></td></tr>
|
||
|
<tr name="269" id="269">
|
||
|
<td><a id="l269" class='ln'>269</a></td><td><span class="ct"> * Constant: '<S1>/B'</span></td></tr>
|
||
|
<tr name="270" id="270">
|
||
|
<td><a id="l270" class='ln'>270</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="271" id="271">
|
||
|
<td><a id="l271" class='ln'>271</a></td><td> <a id="271c3" class="tk">currentTime</a> = <a id="271c17" class="tk">Arduino_skal_B</a>.<a id="271c32" class="tk">Saturation</a>;</td></tr>
|
||
|
<tr name="272" id="272">
|
||
|
<td><a id="l272" class='ln'>272</a></td><td> <a id="272c3" class="tk">u0</a> = <a id="272c8" class="tk">Arduino_skal_P</a>.<a id="272c23" class="tk">B_Value</a>[0];</td></tr>
|
||
|
<tr name="273" id="273">
|
||
|
<td><a id="l273" class='ln'>273</a></td><td></td></tr>
|
||
|
<tr name="274" id="274">
|
||
|
<td><a id="l274" class='ln'>274</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' */</span></td></tr>
|
||
|
<tr name="275" id="275">
|
||
|
<td><a id="l275" class='ln'>275</a></td><td> <a id="275c3" class="tk">Arduino_skal_B</a>.<a id="275c18" class="tk">Bkuk</a>[0] = <a id="275c28" class="tk">u0</a> <a id="275c31" class="tk">*</a> <a id="275c33" class="tk">currentTime</a>;</td></tr>
|
||
|
<tr name="276" id="276">
|
||
|
<td><a id="l276" class='ln'>276</a></td><td></td></tr>
|
||
|
<tr name="277" id="277">
|
||
|
<td><a id="l277" class='ln'>277</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' incorporates:</span></td></tr>
|
||
|
<tr name="278" id="278">
|
||
|
<td><a id="l278" class='ln'>278</a></td><td><span class="ct"> * Constant: '<S1>/B'</span></td></tr>
|
||
|
<tr name="279" id="279">
|
||
|
<td><a id="l279" class='ln'>279</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="280" id="280">
|
||
|
<td><a id="l280" class='ln'>280</a></td><td> <a id="280c3" class="tk">u0</a> = <a id="280c8" class="tk">Arduino_skal_P</a>.<a id="280c23" class="tk">B_Value</a>[1];</td></tr>
|
||
|
<tr name="281" id="281">
|
||
|
<td><a id="l281" class='ln'>281</a></td><td></td></tr>
|
||
|
<tr name="282" id="282">
|
||
|
<td><a id="l282" class='ln'>282</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' */</span></td></tr>
|
||
|
<tr name="283" id="283">
|
||
|
<td><a id="l283" class='ln'>283</a></td><td> <a id="283c3" class="tk">Arduino_skal_B</a>.<a id="283c18" class="tk">Bkuk</a>[1] = <a id="283c28" class="tk">u0</a> <a id="283c31" class="tk">*</a> <a id="283c33" class="tk">currentTime</a>;</td></tr>
|
||
|
<tr name="284" id="284">
|
||
|
<td><a id="l284" class='ln'>284</a></td><td></td></tr>
|
||
|
<tr name="285" id="285">
|
||
|
<td><a id="l285" class='ln'>285</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' incorporates:</span></td></tr>
|
||
|
<tr name="286" id="286">
|
||
|
<td><a id="l286" class='ln'>286</a></td><td><span class="ct"> * Constant: '<S1>/B'</span></td></tr>
|
||
|
<tr name="287" id="287">
|
||
|
<td><a id="l287" class='ln'>287</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="288" id="288">
|
||
|
<td><a id="l288" class='ln'>288</a></td><td> <a id="288c3" class="tk">u0</a> = <a id="288c8" class="tk">Arduino_skal_P</a>.<a id="288c23" class="tk">B_Value</a>[2];</td></tr>
|
||
|
<tr name="289" id="289">
|
||
|
<td><a id="l289" class='ln'>289</a></td><td></td></tr>
|
||
|
<tr name="290" id="290">
|
||
|
<td><a id="l290" class='ln'>290</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' */</span></td></tr>
|
||
|
<tr name="291" id="291">
|
||
|
<td><a id="l291" class='ln'>291</a></td><td> <a id="291c3" class="tk">Arduino_skal_B</a>.<a id="291c18" class="tk">Bkuk</a>[2] = <a id="291c28" class="tk">u0</a> <a id="291c31" class="tk">*</a> <a id="291c33" class="tk">currentTime</a>;</td></tr>
|
||
|
<tr name="292" id="292">
|
||
|
<td><a id="l292" class='ln'>292</a></td><td></td></tr>
|
||
|
<tr name="293" id="293">
|
||
|
<td><a id="l293" class='ln'>293</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' incorporates:</span></td></tr>
|
||
|
<tr name="294" id="294">
|
||
|
<td><a id="l294" class='ln'>294</a></td><td><span class="ct"> * Constant: '<S1>/B'</span></td></tr>
|
||
|
<tr name="295" id="295">
|
||
|
<td><a id="l295" class='ln'>295</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="296" id="296">
|
||
|
<td><a id="l296" class='ln'>296</a></td><td> <a id="296c3" class="tk">u0</a> = <a id="296c8" class="tk">Arduino_skal_P</a>.<a id="296c23" class="tk">B_Value</a>[3];</td></tr>
|
||
|
<tr name="297" id="297">
|
||
|
<td><a id="l297" class='ln'>297</a></td><td></td></tr>
|
||
|
<tr name="298" id="298">
|
||
|
<td><a id="l298" class='ln'>298</a></td><td> <span class="ct">/* Product: '<S22>/B[k]*u[k]' */</span></td></tr>
|
||
|
<tr name="299" id="299">
|
||
|
<td><a id="l299" class='ln'>299</a></td><td> <a id="299c3" class="tk">Arduino_skal_B</a>.<a id="299c18" class="tk">Bkuk</a>[3] = <a id="299c28" class="tk">u0</a> <a id="299c31" class="tk">*</a> <a id="299c33" class="tk">currentTime</a>;</td></tr>
|
||
|
<tr name="300" id="300">
|
||
|
<td><a id="l300" class='ln'>300</a></td><td></td></tr>
|
||
|
<tr name="301" id="301">
|
||
|
<td><a id="l301" class='ln'>301</a></td><td> <span class="ct">/* Outputs for Enabled SubSystem: '<S22>/MeasurementUpdate' incorporates:</span></td></tr>
|
||
|
<tr name="302" id="302">
|
||
|
<td><a id="l302" class='ln'>302</a></td><td><span class="ct"> * EnablePort: '<S53>/Enable'</span></td></tr>
|
||
|
<tr name="303" id="303">
|
||
|
<td><a id="l303" class='ln'>303</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="304" id="304">
|
||
|
<td><a id="l304" class='ln'>304</a></td><td> <span class="kw">if</span> (<a id="304c7" class="tk">rtmIsMajorTimeStep</a>((<a id="304c27" class="tk">&</a><a id="304c28" class="tk">Arduino_skal_M</a>)) <a id="304c45" class="tk">&&</a> <a id="304c48" class="tk">rtmIsMajorTimeStep</a></td></tr>
|
||
|
<tr name="305" id="305">
|
||
|
<td><a id="l305" class='ln'>305</a></td><td> ((<a id="305c9" class="tk">&</a><a id="305c10" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="306" id="306">
|
||
|
<td><a id="l306" class='ln'>306</a></td><td> <span class="ct">/* Constant: '<S1>/Enable' */</span></td></tr>
|
||
|
<tr name="307" id="307">
|
||
|
<td><a id="l307" class='ln'>307</a></td><td> <span class="kw">if</span> (<a id="307c9" class="tk">Arduino_skal_P</a>.<a id="307c24" class="tk">Enable_Value</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="308" id="308">
|
||
|
<td><a id="l308" class='ln'>308</a></td><td> <a id="308c7" class="tk">Arduino_skal_DW</a>.<a id="308c23" class="tk">MeasurementUpdate_MODE</a> = true;</td></tr>
|
||
|
<tr name="309" id="309">
|
||
|
<td><a id="l309" class='ln'>309</a></td><td> <span class="br">}</span> <span class="kw">else</span> <span class="kw">if</span> (<a id="309c16" class="tk">Arduino_skal_DW</a>.<a id="309c32" class="tk">MeasurementUpdate_MODE</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="310" id="310">
|
||
|
<td><a id="l310" class='ln'>310</a></td><td> <span class="ct">/* Disable for Product: '<S53>/Product3' incorporates:</span></td></tr>
|
||
|
<tr name="311" id="311">
|
||
|
<td><a id="l311" class='ln'>311</a></td><td><span class="ct"> * Outport: '<S53>/L*(y[k]-yhat[k|k-1])'</span></td></tr>
|
||
|
<tr name="312" id="312">
|
||
|
<td><a id="l312" class='ln'>312</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="313" id="313">
|
||
|
<td><a id="l313" class='ln'>313</a></td><td> <a id="313c7" class="tk">Arduino_skal_B</a>.<a id="313c22" class="tk">Product3</a>[0] = <a id="313c36" class="tk">Arduino_skal_P</a>.<a id="313c51" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="314" id="314">
|
||
|
<td><a id="l314" class='ln'>314</a></td><td> <a id="314c7" class="tk">Arduino_skal_B</a>.<a id="314c22" class="tk">Product3</a>[1] = <a id="314c36" class="tk">Arduino_skal_P</a>.<a id="314c51" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="315" id="315">
|
||
|
<td><a id="l315" class='ln'>315</a></td><td> <a id="315c7" class="tk">Arduino_skal_B</a>.<a id="315c22" class="tk">Product3</a>[2] = <a id="315c36" class="tk">Arduino_skal_P</a>.<a id="315c51" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="316" id="316">
|
||
|
<td><a id="l316" class='ln'>316</a></td><td> <a id="316c7" class="tk">Arduino_skal_B</a>.<a id="316c22" class="tk">Product3</a>[3] = <a id="316c36" class="tk">Arduino_skal_P</a>.<a id="316c51" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="317" id="317">
|
||
|
<td><a id="l317" class='ln'>317</a></td><td> <a id="317c7" class="tk">Arduino_skal_DW</a>.<a id="317c23" class="tk">MeasurementUpdate_MODE</a> = false;</td></tr>
|
||
|
<tr name="318" id="318">
|
||
|
<td><a id="l318" class='ln'>318</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="319" id="319">
|
||
|
<td><a id="l319" class='ln'>319</a></td><td></td></tr>
|
||
|
<tr name="320" id="320">
|
||
|
<td><a id="l320" class='ln'>320</a></td><td> <span class="ct">/* End of Constant: '<S1>/Enable' */</span></td></tr>
|
||
|
<tr name="321" id="321">
|
||
|
<td><a id="l321" class='ln'>321</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="322" id="322">
|
||
|
<td><a id="l322" class='ln'>322</a></td><td></td></tr>
|
||
|
<tr name="323" id="323">
|
||
|
<td><a id="l323" class='ln'>323</a></td><td> <span class="kw">if</span> (<a id="323c7" class="tk">Arduino_skal_DW</a>.<a id="323c23" class="tk">MeasurementUpdate_MODE</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="324" id="324">
|
||
|
<td><a id="l324" class='ln'>324</a></td><td> <span class="ct">/* Product: '<S53>/C[k]*xhat[k|k-1]' incorporates:</span></td></tr>
|
||
|
<tr name="325" id="325">
|
||
|
<td><a id="l325" class='ln'>325</a></td><td><span class="ct"> * Constant: '<S1>/C'</span></td></tr>
|
||
|
<tr name="326" id="326">
|
||
|
<td><a id="l326" class='ln'>326</a></td><td><span class="ct"> * Product: '<S53>/Product3'</span></td></tr>
|
||
|
<tr name="327" id="327">
|
||
|
<td><a id="l327" class='ln'>327</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="328" id="328">
|
||
|
<td><a id="l328" class='ln'>328</a></td><td> <a id="328c5" class="tk">tmp_3</a> = <a id="328c13" class="tk">&</a><a id="328c14" class="tk">Arduino_skal_P</a>.<a id="328c29" class="tk">C_Value</a>[0];</td></tr>
|
||
|
<tr name="329" id="329">
|
||
|
<td><a id="l329" class='ln'>329</a></td><td> <a id="329c5" class="tk">tmp</a> = <a id="329c11" class="tk">Arduino_skal_B</a>.<a id="329c26" class="tk">MemoryX</a>[0];</td></tr>
|
||
|
<tr name="330" id="330">
|
||
|
<td><a id="l330" class='ln'>330</a></td><td> <a id="330c5" class="tk">tmp_0</a> = <a id="330c13" class="tk">Arduino_skal_B</a>.<a id="330c28" class="tk">MemoryX</a>[1];</td></tr>
|
||
|
<tr name="331" id="331">
|
||
|
<td><a id="l331" class='ln'>331</a></td><td> <a id="331c5" class="tk">tmp_1</a> = <a id="331c13" class="tk">Arduino_skal_B</a>.<a id="331c28" class="tk">MemoryX</a>[2];</td></tr>
|
||
|
<tr name="332" id="332">
|
||
|
<td><a id="l332" class='ln'>332</a></td><td> <a id="332c5" class="tk">tmp_2</a> = <a id="332c13" class="tk">Arduino_skal_B</a>.<a id="332c28" class="tk">MemoryX</a>[3];</td></tr>
|
||
|
<tr name="333" id="333">
|
||
|
<td><a id="l333" class='ln'>333</a></td><td></td></tr>
|
||
|
<tr name="334" id="334">
|
||
|
<td><a id="l334" class='ln'>334</a></td><td> <span class="ct">/* Product: '<S53>/D[k]*u[k]' */</span></td></tr>
|
||
|
<tr name="335" id="335">
|
||
|
<td><a id="l335" class='ln'>335</a></td><td> <a id="335c5" class="tk">currentTime</a> = <a id="335c19" class="tk">Arduino_skal_B</a>.<a id="335c34" class="tk">Saturation</a>;</td></tr>
|
||
|
<tr name="336" id="336">
|
||
|
<td><a id="l336" class='ln'>336</a></td><td> <span class="kw">for</span> (<a id="336c10" class="tk">i</a> = 0; <a id="336c17" class="tk">i</a> <a id="336c19" class="tk"><</a> 2; <a id="336c24" class="tk">i</a><a id="336c25" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="337" id="337">
|
||
|
<td><a id="l337" class='ln'>337</a></td><td> <span class="ct">/* Product: '<S53>/C[k]*xhat[k|k-1]' */</span></td></tr>
|
||
|
<tr name="338" id="338">
|
||
|
<td><a id="l338" class='ln'>338</a></td><td> <a id="338c7" class="tk">u0</a> = <a id="338c12" class="tk">tmp_3</a>[<a id="338c18" class="tk">i</a>] <a id="338c21" class="tk">*</a> <a id="338c23" class="tk">tmp</a>;</td></tr>
|
||
|
<tr name="339" id="339">
|
||
|
<td><a id="l339" class='ln'>339</a></td><td> <a id="339c7" class="tk">u0</a> <a id="339c10" class="tk">+=</a> <a id="339c13" class="tk">tmp_3</a>[<a id="339c19" class="tk">i</a> <a id="339c21" class="tk">+</a> 2] <a id="339c26" class="tk">*</a> <a id="339c28" class="tk">tmp_0</a>;</td></tr>
|
||
|
<tr name="340" id="340">
|
||
|
<td><a id="l340" class='ln'>340</a></td><td> <a id="340c7" class="tk">u0</a> <a id="340c10" class="tk">+=</a> <a id="340c13" class="tk">tmp_3</a>[<a id="340c19" class="tk">i</a> <a id="340c21" class="tk">+</a> 4] <a id="340c26" class="tk">*</a> <a id="340c28" class="tk">tmp_1</a>;</td></tr>
|
||
|
<tr name="341" id="341">
|
||
|
<td><a id="l341" class='ln'>341</a></td><td> <a id="341c7" class="tk">u0</a> <a id="341c10" class="tk">+=</a> <a id="341c13" class="tk">tmp_3</a>[<a id="341c19" class="tk">i</a> <a id="341c21" class="tk">+</a> 6] <a id="341c26" class="tk">*</a> <a id="341c28" class="tk">tmp_2</a>;</td></tr>
|
||
|
<tr name="342" id="342">
|
||
|
<td><a id="l342" class='ln'>342</a></td><td></td></tr>
|
||
|
<tr name="343" id="343">
|
||
|
<td><a id="l343" class='ln'>343</a></td><td> <span class="ct">/* Product: '<S53>/C[k]*xhat[k|k-1]' */</span></td></tr>
|
||
|
<tr name="344" id="344">
|
||
|
<td><a id="l344" class='ln'>344</a></td><td> <a id="344c7" class="tk">Arduino_skal_B</a>.<a id="344c22" class="tk">Ckxhatkk1</a>[<a id="344c32" class="tk">i</a>] = <a id="344c37" class="tk">u0</a>;</td></tr>
|
||
|
<tr name="345" id="345">
|
||
|
<td><a id="l345" class='ln'>345</a></td><td></td></tr>
|
||
|
<tr name="346" id="346">
|
||
|
<td><a id="l346" class='ln'>346</a></td><td> <span class="ct">/* Product: '<S53>/D[k]*u[k]' incorporates:</span></td></tr>
|
||
|
<tr name="347" id="347">
|
||
|
<td><a id="l347" class='ln'>347</a></td><td><span class="ct"> * Constant: '<S1>/D'</span></td></tr>
|
||
|
<tr name="348" id="348">
|
||
|
<td><a id="l348" class='ln'>348</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="349" id="349">
|
||
|
<td><a id="l349" class='ln'>349</a></td><td> <a id="349c7" class="tk">u0</a> = <a id="349c12" class="tk">Arduino_skal_P</a>.<a id="349c27" class="tk">D_Value</a>[<a id="349c35" class="tk">i</a>];</td></tr>
|
||
|
<tr name="350" id="350">
|
||
|
<td><a id="l350" class='ln'>350</a></td><td></td></tr>
|
||
|
<tr name="351" id="351">
|
||
|
<td><a id="l351" class='ln'>351</a></td><td> <span class="ct">/* Product: '<S53>/D[k]*u[k]' */</span></td></tr>
|
||
|
<tr name="352" id="352">
|
||
|
<td><a id="l352" class='ln'>352</a></td><td> <a id="352c7" class="tk">Arduino_skal_B</a>.<a id="352c22" class="tk">Dkuk</a>[<a id="352c27" class="tk">i</a>] = <a id="352c32" class="tk">u0</a> <a id="352c35" class="tk">*</a> <a id="352c37" class="tk">currentTime</a>;</td></tr>
|
||
|
<tr name="353" id="353">
|
||
|
<td><a id="l353" class='ln'>353</a></td><td></td></tr>
|
||
|
<tr name="354" id="354">
|
||
|
<td><a id="l354" class='ln'>354</a></td><td> <span class="ct">/* Sum: '<S53>/Add1' incorporates:</span></td></tr>
|
||
|
<tr name="355" id="355">
|
||
|
<td><a id="l355" class='ln'>355</a></td><td><span class="ct"> * Product: '<S53>/D[k]*u[k]'</span></td></tr>
|
||
|
<tr name="356" id="356">
|
||
|
<td><a id="l356" class='ln'>356</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="357" id="357">
|
||
|
<td><a id="l357" class='ln'>357</a></td><td> <a id="357c7" class="tk">Arduino_skal_B</a>.<a id="357c22" class="tk">yhatkk1</a>[<a id="357c30" class="tk">i</a>] = <a id="357c35" class="tk">Arduino_skal_B</a>.<a id="357c50" class="tk">Ckxhatkk1</a>[<a id="357c60" class="tk">i</a>] <a id="357c63" class="tk">+</a></td></tr>
|
||
|
<tr name="358" id="358">
|
||
|
<td><a id="l358" class='ln'>358</a></td><td> <a id="358c9" class="tk">Arduino_skal_B</a>.<a id="358c24" class="tk">Dkuk</a>[<a id="358c29" class="tk">i</a>];</td></tr>
|
||
|
<tr name="359" id="359">
|
||
|
<td><a id="l359" class='ln'>359</a></td><td></td></tr>
|
||
|
<tr name="360" id="360">
|
||
|
<td><a id="l360" class='ln'>360</a></td><td> <span class="ct">/* Sum: '<S53>/Sum' incorporates:</span></td></tr>
|
||
|
<tr name="361" id="361">
|
||
|
<td><a id="l361" class='ln'>361</a></td><td><span class="ct"> * Constant: '<Root>/Constant'</span></td></tr>
|
||
|
<tr name="362" id="362">
|
||
|
<td><a id="l362" class='ln'>362</a></td><td><span class="ct"> * Sum: '<S53>/Add1'</span></td></tr>
|
||
|
<tr name="363" id="363">
|
||
|
<td><a id="l363" class='ln'>363</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="364" id="364">
|
||
|
<td><a id="l364" class='ln'>364</a></td><td> <a id="364c7" class="tk">Arduino_skal_B</a>.<a id="364c22" class="tk">Sum</a>[<a id="364c26" class="tk">i</a>] = <a id="364c31" class="tk">Arduino_skal_P</a>.<a id="364c46" class="tk">Constant_Value</a>[<a id="364c61" class="tk">i</a>] <a id="364c64" class="tk">-</a></td></tr>
|
||
|
<tr name="365" id="365">
|
||
|
<td><a id="l365" class='ln'>365</a></td><td> <a id="365c9" class="tk">Arduino_skal_B</a>.<a id="365c24" class="tk">yhatkk1</a>[<a id="365c32" class="tk">i</a>];</td></tr>
|
||
|
<tr name="366" id="366">
|
||
|
<td><a id="l366" class='ln'>366</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="367" id="367">
|
||
|
<td><a id="l367" class='ln'>367</a></td><td></td></tr>
|
||
|
<tr name="368" id="368">
|
||
|
<td><a id="l368" class='ln'>368</a></td><td> <span class="ct">/* Product: '<S53>/Product3' incorporates:</span></td></tr>
|
||
|
<tr name="369" id="369">
|
||
|
<td><a id="l369" class='ln'>369</a></td><td><span class="ct"> * Constant: '<S2>/KalmanGainL'</span></td></tr>
|
||
|
<tr name="370" id="370">
|
||
|
<td><a id="l370" class='ln'>370</a></td><td><span class="ct"> * Product: '<S53>/C[k]*xhat[k|k-1]'</span></td></tr>
|
||
|
<tr name="371" id="371">
|
||
|
<td><a id="l371" class='ln'>371</a></td><td><span class="ct"> * Sum: '<S53>/Sum'</span></td></tr>
|
||
|
<tr name="372" id="372">
|
||
|
<td><a id="l372" class='ln'>372</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="373" id="373">
|
||
|
<td><a id="l373" class='ln'>373</a></td><td> <a id="373c5" class="tk">tmp_3</a> = <a id="373c13" class="tk">&</a><a id="373c14" class="tk">Arduino_skal_P</a>.<a id="373c29" class="tk">KalmanGainL_Value</a>[0];</td></tr>
|
||
|
<tr name="374" id="374">
|
||
|
<td><a id="l374" class='ln'>374</a></td><td> <a id="374c5" class="tk">tmp</a> = <a id="374c11" class="tk">Arduino_skal_B</a>.<a id="374c26" class="tk">Sum</a>[0];</td></tr>
|
||
|
<tr name="375" id="375">
|
||
|
<td><a id="l375" class='ln'>375</a></td><td> <a id="375c5" class="tk">tmp_0</a> = <a id="375c13" class="tk">Arduino_skal_B</a>.<a id="375c28" class="tk">Sum</a>[1];</td></tr>
|
||
|
<tr name="376" id="376">
|
||
|
<td><a id="l376" class='ln'>376</a></td><td> <span class="kw">for</span> (<a id="376c10" class="tk">i</a> = 0; <a id="376c17" class="tk">i</a> <a id="376c19" class="tk"><</a> 4; <a id="376c24" class="tk">i</a><a id="376c25" class="tk">++</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="377" id="377">
|
||
|
<td><a id="l377" class='ln'>377</a></td><td> <span class="ct">/* Product: '<S53>/Product3' */</span></td></tr>
|
||
|
<tr name="378" id="378">
|
||
|
<td><a id="l378" class='ln'>378</a></td><td> <a id="378c7" class="tk">Arduino_skal_B</a>.<a id="378c22" class="tk">Product3</a>[<a id="378c31" class="tk">i</a>] = 0.0;</td></tr>
|
||
|
<tr name="379" id="379">
|
||
|
<td><a id="l379" class='ln'>379</a></td><td> <a id="379c7" class="tk">Arduino_skal_B</a>.<a id="379c22" class="tk">Product3</a>[<a id="379c31" class="tk">i</a>] <a id="379c34" class="tk">+=</a> <a id="379c37" class="tk">tmp_3</a>[<a id="379c43" class="tk">i</a>] <a id="379c46" class="tk">*</a> <a id="379c48" class="tk">tmp</a>;</td></tr>
|
||
|
<tr name="380" id="380">
|
||
|
<td><a id="l380" class='ln'>380</a></td><td> <a id="380c7" class="tk">Arduino_skal_B</a>.<a id="380c22" class="tk">Product3</a>[<a id="380c31" class="tk">i</a>] <a id="380c34" class="tk">+=</a> <a id="380c37" class="tk">tmp_3</a>[<a id="380c43" class="tk">i</a> <a id="380c45" class="tk">+</a> 4] <a id="380c50" class="tk">*</a> <a id="380c52" class="tk">tmp_0</a>;</td></tr>
|
||
|
<tr name="381" id="381">
|
||
|
<td><a id="l381" class='ln'>381</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="382" id="382">
|
||
|
<td><a id="l382" class='ln'>382</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="383" id="383">
|
||
|
<td><a id="l383" class='ln'>383</a></td><td></td></tr>
|
||
|
<tr name="384" id="384">
|
||
|
<td><a id="l384" class='ln'>384</a></td><td> <span class="ct">/* End of Outputs for SubSystem: '<S22>/MeasurementUpdate' */</span></td></tr>
|
||
|
<tr name="385" id="385">
|
||
|
<td><a id="l385" class='ln'>385</a></td><td></td></tr>
|
||
|
<tr name="386" id="386">
|
||
|
<td><a id="l386" class='ln'>386</a></td><td> <span class="ct">/* Sum: '<S22>/Add' incorporates:</span></td></tr>
|
||
|
<tr name="387" id="387">
|
||
|
<td><a id="l387" class='ln'>387</a></td><td><span class="ct"> * Product: '<S22>/B[k]*u[k]'</span></td></tr>
|
||
|
<tr name="388" id="388">
|
||
|
<td><a id="l388" class='ln'>388</a></td><td><span class="ct"> * Product: '<S53>/Product3'</span></td></tr>
|
||
|
<tr name="389" id="389">
|
||
|
<td><a id="l389" class='ln'>389</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="390" id="390">
|
||
|
<td><a id="l390" class='ln'>390</a></td><td> <a id="390c3" class="tk">Arduino_skal_B</a>.<a id="390c18" class="tk">Add</a>[0] = (<a id="390c28" class="tk">Arduino_skal_B</a>.<a id="390c43" class="tk">Bkuk</a>[0] <a id="390c51" class="tk">+</a> <a id="390c53" class="tk">Arduino_skal_B</a>.<a id="390c68" class="tk">Akxhatkk1</a>[0])</td></tr>
|
||
|
<tr name="391" id="391">
|
||
|
<td><a id="l391" class='ln'>391</a></td><td> <a id="391c5" class="tk">+</a> <a id="391c7" class="tk">Arduino_skal_B</a>.<a id="391c22" class="tk">Product3</a>[0];</td></tr>
|
||
|
<tr name="392" id="392">
|
||
|
<td><a id="l392" class='ln'>392</a></td><td> <a id="392c3" class="tk">Arduino_skal_B</a>.<a id="392c18" class="tk">Add</a>[1] = (<a id="392c28" class="tk">Arduino_skal_B</a>.<a id="392c43" class="tk">Bkuk</a>[1] <a id="392c51" class="tk">+</a> <a id="392c53" class="tk">Arduino_skal_B</a>.<a id="392c68" class="tk">Akxhatkk1</a>[1])</td></tr>
|
||
|
<tr name="393" id="393">
|
||
|
<td><a id="l393" class='ln'>393</a></td><td> <a id="393c5" class="tk">+</a> <a id="393c7" class="tk">Arduino_skal_B</a>.<a id="393c22" class="tk">Product3</a>[1];</td></tr>
|
||
|
<tr name="394" id="394">
|
||
|
<td><a id="l394" class='ln'>394</a></td><td> <a id="394c3" class="tk">Arduino_skal_B</a>.<a id="394c18" class="tk">Add</a>[2] = (<a id="394c28" class="tk">Arduino_skal_B</a>.<a id="394c43" class="tk">Bkuk</a>[2] <a id="394c51" class="tk">+</a> <a id="394c53" class="tk">Arduino_skal_B</a>.<a id="394c68" class="tk">Akxhatkk1</a>[2])</td></tr>
|
||
|
<tr name="395" id="395">
|
||
|
<td><a id="l395" class='ln'>395</a></td><td> <a id="395c5" class="tk">+</a> <a id="395c7" class="tk">Arduino_skal_B</a>.<a id="395c22" class="tk">Product3</a>[2];</td></tr>
|
||
|
<tr name="396" id="396">
|
||
|
<td><a id="l396" class='ln'>396</a></td><td> <a id="396c3" class="tk">Arduino_skal_B</a>.<a id="396c18" class="tk">Add</a>[3] = (<a id="396c28" class="tk">Arduino_skal_B</a>.<a id="396c43" class="tk">Bkuk</a>[3] <a id="396c51" class="tk">+</a> <a id="396c53" class="tk">Arduino_skal_B</a>.<a id="396c68" class="tk">Akxhatkk1</a>[3])</td></tr>
|
||
|
<tr name="397" id="397">
|
||
|
<td><a id="l397" class='ln'>397</a></td><td> <a id="397c5" class="tk">+</a> <a id="397c7" class="tk">Arduino_skal_B</a>.<a id="397c22" class="tk">Product3</a>[3];</td></tr>
|
||
|
<tr name="398" id="398">
|
||
|
<td><a id="l398" class='ln'>398</a></td><td> <span class="kw">if</span> (<a id="398c7" class="tk">rtmIsMajorTimeStep</a>((<a id="398c27" class="tk">&</a><a id="398c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="399" id="399">
|
||
|
<td><a id="l399" class='ln'>399</a></td><td> <span class="ct">/* Matfile logging */</span></td></tr>
|
||
|
<tr name="400" id="400">
|
||
|
<td><a id="l400" class='ln'>400</a></td><td> <a id="400c5" class="tk">rt_UpdateTXYLogVars</a>((<a id="400c26" class="tk">&</a><a id="400c27" class="tk">Arduino_skal_M</a>)-><a id="400c44" class="tk">rtwLogInfo</a>, ((<a id="400c58" class="tk">&</a><a id="400c59" class="tk">Arduino_skal_M</a>)</td></tr>
|
||
|
<tr name="401" id="401">
|
||
|
<td><a id="l401" class='ln'>401</a></td><td> -><a id="401c9" class="tk">Timing</a>.<a id="401c16" class="tk">t</a>));</td></tr>
|
||
|
<tr name="402" id="402">
|
||
|
<td><a id="l402" class='ln'>402</a></td><td> <span class="br">}</span> <span class="ct">/* end MajorTimeStep */</span></td></tr>
|
||
|
<tr name="403" id="403">
|
||
|
<td><a id="l403" class='ln'>403</a></td><td></td></tr>
|
||
|
<tr name="404" id="404">
|
||
|
<td><a id="l404" class='ln'>404</a></td><td> <span class="kw">if</span> (<a id="404c7" class="tk">rtmIsMajorTimeStep</a>((<a id="404c27" class="tk">&</a><a id="404c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="405" id="405">
|
||
|
<td><a id="l405" class='ln'>405</a></td><td> <span class="ct">/* Update for Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="406" id="406">
|
||
|
<td><a id="l406" class='ln'>406</a></td><td> <a id="406c5" class="tk">Arduino_skal_DW</a>.<a id="406c21" class="tk">MemoryX_IWORK</a> = 0;</td></tr>
|
||
|
<tr name="407" id="407">
|
||
|
<td><a id="l407" class='ln'>407</a></td><td> <span class="br">}</span> <span class="ct">/* end MajorTimeStep */</span></td></tr>
|
||
|
<tr name="408" id="408">
|
||
|
<td><a id="l408" class='ln'>408</a></td><td></td></tr>
|
||
|
<tr name="409" id="409">
|
||
|
<td><a id="l409" class='ln'>409</a></td><td> <span class="kw">if</span> (<a id="409c7" class="tk">rtmIsMajorTimeStep</a>((<a id="409c27" class="tk">&</a><a id="409c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="410" id="410">
|
||
|
<td><a id="l410" class='ln'>410</a></td><td> <span class="ct">/* signal main to stop simulation */</span></td></tr>
|
||
|
<tr name="411" id="411">
|
||
|
<td><a id="l411" class='ln'>411</a></td><td> <span class="br">{</span> <span class="ct">/* Sample time: [0.0s, 0.0s] */</span></td></tr>
|
||
|
<tr name="412" id="412">
|
||
|
<td><a id="l412" class='ln'>412</a></td><td> <span class="kw">if</span> ((<a id="412c12" class="tk">rtmGetTFinal</a>((<a id="412c26" class="tk">&</a><a id="412c27" class="tk">Arduino_skal_M</a>))<a id="412c43" class="tk">!=</a><a id="412c45" class="tk">-</a>1) <a id="412c49" class="tk">&&</a></td></tr>
|
||
|
<tr name="413" id="413">
|
||
|
<td><a id="l413" class='ln'>413</a></td><td> <a id="413c11" class="tk">!</a>((<a id="413c14" class="tk">rtmGetTFinal</a>((<a id="413c28" class="tk">&</a><a id="413c29" class="tk">Arduino_skal_M</a>))<a id="413c45" class="tk">-</a>((((<a id="413c50" class="tk">&</a><a id="413c51" class="tk">Arduino_skal_M</a>)</td></tr>
|
||
|
<tr name="414" id="414">
|
||
|
<td><a id="l414" class='ln'>414</a></td><td> -><a id="414c18" class="tk">Timing</a>.<a id="414c25" class="tk">clockTick1</a><a id="414c35" class="tk">+</a>(<a id="414c37" class="tk">&</a><a id="414c38" class="tk">Arduino_skal_M</a>)-><a id="414c55" class="tk">Timing</a>.<a id="414c62" class="tk">clockTickH1</a><a id="414c73" class="tk">*</a></td></tr>
|
||
|
<tr name="415" id="415">
|
||
|
<td><a id="l415" class='ln'>415</a></td><td> 4294967296.0)) <a id="415c31" class="tk">*</a> 0.2)) <a id="415c39" class="tk">></a> ((((<a id="415c45" class="tk">&</a><a id="415c46" class="tk">Arduino_skal_M</a>)-><a id="415c63" class="tk">Timing</a>.<a id="415c70" class="tk">clockTick1</a><a id="415c80" class="tk">+</a></td></tr>
|
||
|
<tr name="416" id="416">
|
||
|
<td><a id="l416" class='ln'>416</a></td><td> (<a id="416c16" class="tk">&</a><a id="416c17" class="tk">Arduino_skal_M</a>)-><a id="416c34" class="tk">Timing</a>.<a id="416c41" class="tk">clockTickH1</a><a id="416c52" class="tk">*</a> 4294967296.0)) <a id="416c69" class="tk">*</a> 0.2) <a id="416c76" class="tk">*</a></td></tr>
|
||
|
<tr name="417" id="417">
|
||
|
<td><a id="l417" class='ln'>417</a></td><td> (<a id="417c14" class="tk">DBL_EPSILON</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="418" id="418">
|
||
|
<td><a id="l418" class='ln'>418</a></td><td> <a id="418c9" class="tk">rtmSetErrorStatus</a>((<a id="418c28" class="tk">&</a><a id="418c29" class="tk">Arduino_skal_M</a>), "Simulation finished");</td></tr>
|
||
|
<tr name="419" id="419">
|
||
|
<td><a id="l419" class='ln'>419</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="420" id="420">
|
||
|
<td><a id="l420" class='ln'>420</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="421" id="421">
|
||
|
<td><a id="l421" class='ln'>421</a></td><td></td></tr>
|
||
|
<tr name="422" id="422">
|
||
|
<td><a id="l422" class='ln'>422</a></td><td> <a id="422c5" class="tk">rt_ertODEUpdateContinuousStates</a>(<a id="422c37" class="tk">&</a>(<a id="422c39" class="tk">&</a><a id="422c40" class="tk">Arduino_skal_M</a>)-><a id="422c57" class="tk">solverInfo</a>);</td></tr>
|
||
|
<tr name="423" id="423">
|
||
|
<td><a id="l423" class='ln'>423</a></td><td></td></tr>
|
||
|
<tr name="424" id="424">
|
||
|
<td><a id="l424" class='ln'>424</a></td><td> <span class="ct">/* Update absolute time for base rate */</span></td></tr>
|
||
|
<tr name="425" id="425">
|
||
|
<td><a id="l425" class='ln'>425</a></td><td> <span class="ct">/* The "clockTick0" counts the number of times the code of this task has</span></td></tr>
|
||
|
<tr name="426" id="426">
|
||
|
<td><a id="l426" class='ln'>426</a></td><td><span class="ct"> * been executed. The absolute time is the multiplication of "clockTick0"</span></td></tr>
|
||
|
<tr name="427" id="427">
|
||
|
<td><a id="l427" class='ln'>427</a></td><td><span class="ct"> * and "Timing.stepSize0". Size of "clockTick0" ensures timer will not</span></td></tr>
|
||
|
<tr name="428" id="428">
|
||
|
<td><a id="l428" class='ln'>428</a></td><td><span class="ct"> * overflow during the application lifespan selected.</span></td></tr>
|
||
|
<tr name="429" id="429">
|
||
|
<td><a id="l429" class='ln'>429</a></td><td><span class="ct"> * Timer of this task consists of two 32 bit unsigned integers.</span></td></tr>
|
||
|
<tr name="430" id="430">
|
||
|
<td><a id="l430" class='ln'>430</a></td><td><span class="ct"> * The two integers represent the low bits Timing.clockTick0 and the high bits</span></td></tr>
|
||
|
<tr name="431" id="431">
|
||
|
<td><a id="l431" class='ln'>431</a></td><td><span class="ct"> * Timing.clockTickH0. When the low bit overflows to 0, the high bits increment.</span></td></tr>
|
||
|
<tr name="432" id="432">
|
||
|
<td><a id="l432" class='ln'>432</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="433" id="433">
|
||
|
<td><a id="l433" class='ln'>433</a></td><td> <span class="kw">if</span> (<a id="433c9" class="tk">!</a>(<a id="433c11" class="tk">++</a>(<a id="433c14" class="tk">&</a><a id="433c15" class="tk">Arduino_skal_M</a>)-><a id="433c32" class="tk">Timing</a>.<a id="433c39" class="tk">clockTick0</a>)) <span class="br">{</span></td></tr>
|
||
|
<tr name="434" id="434">
|
||
|
<td><a id="l434" class='ln'>434</a></td><td> <a id="434c7" class="tk">++</a>(<a id="434c10" class="tk">&</a><a id="434c11" class="tk">Arduino_skal_M</a>)-><a id="434c28" class="tk">Timing</a>.<a id="434c35" class="tk">clockTickH0</a>;</td></tr>
|
||
|
<tr name="435" id="435">
|
||
|
<td><a id="l435" class='ln'>435</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="436" id="436">
|
||
|
<td><a id="l436" class='ln'>436</a></td><td></td></tr>
|
||
|
<tr name="437" id="437">
|
||
|
<td><a id="l437" class='ln'>437</a></td><td> (<a id="437c6" class="tk">&</a><a id="437c7" class="tk">Arduino_skal_M</a>)-><a id="437c24" class="tk">Timing</a>.<a id="437c31" class="tk">t</a>[0] = <a id="437c38" class="tk">rtsiGetSolverStopTime</a>(<a id="437c60" class="tk">&</a>(<a id="437c62" class="tk">&</a><a id="437c63" class="tk">Arduino_skal_M</a>)</td></tr>
|
||
|
<tr name="438" id="438">
|
||
|
<td><a id="l438" class='ln'>438</a></td><td> -><a id="438c9" class="tk">solverInfo</a>);</td></tr>
|
||
|
<tr name="439" id="439">
|
||
|
<td><a id="l439" class='ln'>439</a></td><td></td></tr>
|
||
|
<tr name="440" id="440">
|
||
|
<td><a id="l440" class='ln'>440</a></td><td> <span class="br">{</span></td></tr>
|
||
|
<tr name="441" id="441">
|
||
|
<td><a id="l441" class='ln'>441</a></td><td> <span class="ct">/* Update absolute timer for sample time: [0.2s, 0.0s] */</span></td></tr>
|
||
|
<tr name="442" id="442">
|
||
|
<td><a id="l442" class='ln'>442</a></td><td> <span class="ct">/* The "clockTick1" counts the number of times the code of this task has</span></td></tr>
|
||
|
<tr name="443" id="443">
|
||
|
<td><a id="l443" class='ln'>443</a></td><td><span class="ct"> * been executed. The resolution of this integer timer is 0.2, which is the step size</span></td></tr>
|
||
|
<tr name="444" id="444">
|
||
|
<td><a id="l444" class='ln'>444</a></td><td><span class="ct"> * of the task. Size of "clockTick1" ensures timer will not overflow during the</span></td></tr>
|
||
|
<tr name="445" id="445">
|
||
|
<td><a id="l445" class='ln'>445</a></td><td><span class="ct"> * application lifespan selected.</span></td></tr>
|
||
|
<tr name="446" id="446">
|
||
|
<td><a id="l446" class='ln'>446</a></td><td><span class="ct"> * Timer of this task consists of two 32 bit unsigned integers.</span></td></tr>
|
||
|
<tr name="447" id="447">
|
||
|
<td><a id="l447" class='ln'>447</a></td><td><span class="ct"> * The two integers represent the low bits Timing.clockTick1 and the high bits</span></td></tr>
|
||
|
<tr name="448" id="448">
|
||
|
<td><a id="l448" class='ln'>448</a></td><td><span class="ct"> * Timing.clockTickH1. When the low bit overflows to 0, the high bits increment.</span></td></tr>
|
||
|
<tr name="449" id="449">
|
||
|
<td><a id="l449" class='ln'>449</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="450" id="450">
|
||
|
<td><a id="l450" class='ln'>450</a></td><td> (<a id="450c8" class="tk">&</a><a id="450c9" class="tk">Arduino_skal_M</a>)-><a id="450c26" class="tk">Timing</a>.<a id="450c33" class="tk">clockTick1</a><a id="450c43" class="tk">++</a>;</td></tr>
|
||
|
<tr name="451" id="451">
|
||
|
<td><a id="l451" class='ln'>451</a></td><td> <span class="kw">if</span> (<a id="451c11" class="tk">!</a>(<a id="451c13" class="tk">&</a><a id="451c14" class="tk">Arduino_skal_M</a>)-><a id="451c31" class="tk">Timing</a>.<a id="451c38" class="tk">clockTick1</a>) <span class="br">{</span></td></tr>
|
||
|
<tr name="452" id="452">
|
||
|
<td><a id="l452" class='ln'>452</a></td><td> (<a id="452c10" class="tk">&</a><a id="452c11" class="tk">Arduino_skal_M</a>)-><a id="452c28" class="tk">Timing</a>.<a id="452c35" class="tk">clockTickH1</a><a id="452c46" class="tk">++</a>;</td></tr>
|
||
|
<tr name="453" id="453">
|
||
|
<td><a id="l453" class='ln'>453</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="454" id="454">
|
||
|
<td><a id="l454" class='ln'>454</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="455" id="455">
|
||
|
<td><a id="l455" class='ln'>455</a></td><td> <span class="br">}</span> <span class="ct">/* end MajorTimeStep */</span></td></tr>
|
||
|
<tr name="456" id="456">
|
||
|
<td><a id="l456" class='ln'>456</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="457" id="457">
|
||
|
<td><a id="l457" class='ln'>457</a></td><td></td></tr>
|
||
|
<tr name="458" id="458">
|
||
|
<td><a id="l458" class='ln'>458</a></td><td><span class="ct">/* Derivatives for root system: '<Root>' */</span></td></tr>
|
||
|
<tr name="459" id="459">
|
||
|
<td><a id="l459" class='ln'>459</a></td><td><span class="kw">void</span> <a id="459c6" class="tk">Arduino_skalModelClass</a>::<a id="459c30" class="tk">Arduino_skal_derivatives</a>()</td></tr>
|
||
|
<tr name="460" id="460">
|
||
|
<td><a id="l460" class='ln'>460</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="461" id="461">
|
||
|
<td><a id="l461" class='ln'>461</a></td><td> <a id="461c3" class="tk">XDot_Arduino_skal_T</a> <a id="461c23" class="tk">*</a><a id="461c24" class="tk">_rtXdot</a>;</td></tr>
|
||
|
<tr name="462" id="462">
|
||
|
<td><a id="l462" class='ln'>462</a></td><td> <a id="462c3" class="tk">_rtXdot</a> = ((<a id="462c15" class="tk">XDot_Arduino_skal_T</a> <a id="462c35" class="tk">*</a>) (<a id="462c39" class="tk">&</a><a id="462c40" class="tk">Arduino_skal_M</a>)-><a id="462c57" class="tk">derivs</a>);</td></tr>
|
||
|
<tr name="463" id="463">
|
||
|
<td><a id="l463" class='ln'>463</a></td><td></td></tr>
|
||
|
<tr name="464" id="464">
|
||
|
<td><a id="l464" class='ln'>464</a></td><td> <span class="ct">/* Derivatives for Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="465" id="465">
|
||
|
<td><a id="l465" class='ln'>465</a></td><td> <a id="465c3" class="tk">_rtXdot</a>-><a id="465c12" class="tk">MemoryX_CSTATE</a>[0] = <a id="465c32" class="tk">Arduino_skal_B</a>.<a id="465c47" class="tk">Add</a>[0];</td></tr>
|
||
|
<tr name="466" id="466">
|
||
|
<td><a id="l466" class='ln'>466</a></td><td> <a id="466c3" class="tk">_rtXdot</a>-><a id="466c12" class="tk">MemoryX_CSTATE</a>[1] = <a id="466c32" class="tk">Arduino_skal_B</a>.<a id="466c47" class="tk">Add</a>[1];</td></tr>
|
||
|
<tr name="467" id="467">
|
||
|
<td><a id="l467" class='ln'>467</a></td><td> <a id="467c3" class="tk">_rtXdot</a>-><a id="467c12" class="tk">MemoryX_CSTATE</a>[2] = <a id="467c32" class="tk">Arduino_skal_B</a>.<a id="467c47" class="tk">Add</a>[2];</td></tr>
|
||
|
<tr name="468" id="468">
|
||
|
<td><a id="l468" class='ln'>468</a></td><td> <a id="468c3" class="tk">_rtXdot</a>-><a id="468c12" class="tk">MemoryX_CSTATE</a>[3] = <a id="468c32" class="tk">Arduino_skal_B</a>.<a id="468c47" class="tk">Add</a>[3];</td></tr>
|
||
|
<tr name="469" id="469">
|
||
|
<td><a id="l469" class='ln'>469</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="470" id="470">
|
||
|
<td><a id="l470" class='ln'>470</a></td><td></td></tr>
|
||
|
<tr name="471" id="471">
|
||
|
<td><a id="l471" class='ln'>471</a></td><td><span class="ct">/* Model initialize function */</span></td></tr>
|
||
|
<tr name="472" id="472">
|
||
|
<td><a id="l472" class='ln'>472</a></td><td><span class="kw">void</span> <a id="472c6" class="tk">Arduino_skalModelClass</a>::<a id="472c30" class="tk">initialize</a>()</td></tr>
|
||
|
<tr name="473" id="473">
|
||
|
<td><a id="l473" class='ln'>473</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="474" id="474">
|
||
|
<td><a id="l474" class='ln'>474</a></td><td> <span class="ct">/* Registration code */</span></td></tr>
|
||
|
<tr name="475" id="475">
|
||
|
<td><a id="l475" class='ln'>475</a></td><td></td></tr>
|
||
|
<tr name="476" id="476">
|
||
|
<td><a id="l476" class='ln'>476</a></td><td> <span class="ct">/* initialize non-finites */</span></td></tr>
|
||
|
<tr name="477" id="477">
|
||
|
<td><a id="l477" class='ln'>477</a></td><td> <a id="477c3" class="tk">rt_InitInfAndNaN</a>(<span class="kw">sizeof</span>(<a id="477c27" class="tk">real_T</a>));</td></tr>
|
||
|
<tr name="478" id="478">
|
||
|
<td><a id="l478" class='ln'>478</a></td><td></td></tr>
|
||
|
<tr name="479" id="479">
|
||
|
<td><a id="l479" class='ln'>479</a></td><td> <span class="br">{</span></td></tr>
|
||
|
<tr name="480" id="480">
|
||
|
<td><a id="l480" class='ln'>480</a></td><td> <span class="ct">/* Setup solver object */</span></td></tr>
|
||
|
<tr name="481" id="481">
|
||
|
<td><a id="l481" class='ln'>481</a></td><td> <a id="481c5" class="tk">rtsiSetSimTimeStepPtr</a>(<a id="481c27" class="tk">&</a>(<a id="481c29" class="tk">&</a><a id="481c30" class="tk">Arduino_skal_M</a>)-><a id="481c47" class="tk">solverInfo</a>, <a id="481c59" class="tk">&</a>(<a id="481c61" class="tk">&</a><a id="481c62" class="tk">Arduino_skal_M</a>)</td></tr>
|
||
|
<tr name="482" id="482">
|
||
|
<td><a id="l482" class='ln'>482</a></td><td> -><a id="482c29" class="tk">Timing</a>.<a id="482c36" class="tk">simTimeStep</a>);</td></tr>
|
||
|
<tr name="483" id="483">
|
||
|
<td><a id="l483" class='ln'>483</a></td><td> <a id="483c5" class="tk">rtsiSetTPtr</a>(<a id="483c17" class="tk">&</a>(<a id="483c19" class="tk">&</a><a id="483c20" class="tk">Arduino_skal_M</a>)-><a id="483c37" class="tk">solverInfo</a>, <a id="483c49" class="tk">&</a><a id="483c50" class="tk">rtmGetTPtr</a>((<a id="483c62" class="tk">&</a><a id="483c63" class="tk">Arduino_skal_M</a>)));</td></tr>
|
||
|
<tr name="484" id="484">
|
||
|
<td><a id="l484" class='ln'>484</a></td><td> <a id="484c5" class="tk">rtsiSetStepSizePtr</a>(<a id="484c24" class="tk">&</a>(<a id="484c26" class="tk">&</a><a id="484c27" class="tk">Arduino_skal_M</a>)-><a id="484c44" class="tk">solverInfo</a>, <a id="484c56" class="tk">&</a>(<a id="484c58" class="tk">&</a><a id="484c59" class="tk">Arduino_skal_M</a>)</td></tr>
|
||
|
<tr name="485" id="485">
|
||
|
<td><a id="l485" class='ln'>485</a></td><td> -><a id="485c26" class="tk">Timing</a>.<a id="485c33" class="tk">stepSize0</a>);</td></tr>
|
||
|
<tr name="486" id="486">
|
||
|
<td><a id="l486" class='ln'>486</a></td><td> <a id="486c5" class="tk">rtsiSetdXPtr</a>(<a id="486c18" class="tk">&</a>(<a id="486c20" class="tk">&</a><a id="486c21" class="tk">Arduino_skal_M</a>)-><a id="486c38" class="tk">solverInfo</a>, <a id="486c50" class="tk">&</a>(<a id="486c52" class="tk">&</a><a id="486c53" class="tk">Arduino_skal_M</a>)-><a id="486c70" class="tk">derivs</a>);</td></tr>
|
||
|
<tr name="487" id="487">
|
||
|
<td><a id="l487" class='ln'>487</a></td><td> <a id="487c5" class="tk">rtsiSetContStatesPtr</a>(<a id="487c26" class="tk">&</a>(<a id="487c28" class="tk">&</a><a id="487c29" class="tk">Arduino_skal_M</a>)-><a id="487c46" class="tk">solverInfo</a>, (<a id="487c59" class="tk">real_T</a> <a id="487c66" class="tk">*</a><a id="487c67" class="tk">*</a>)</td></tr>
|
||
|
<tr name="488" id="488">
|
||
|
<td><a id="l488" class='ln'>488</a></td><td> <a id="488c26" class="tk">&</a>(<a id="488c28" class="tk">&</a><a id="488c29" class="tk">Arduino_skal_M</a>)-><a id="488c46" class="tk">contStates</a>);</td></tr>
|
||
|
<tr name="489" id="489">
|
||
|
<td><a id="l489" class='ln'>489</a></td><td> <a id="489c5" class="tk">rtsiSetNumContStatesPtr</a>(<a id="489c29" class="tk">&</a>(<a id="489c31" class="tk">&</a><a id="489c32" class="tk">Arduino_skal_M</a>)-><a id="489c49" class="tk">solverInfo</a>, <a id="489c61" class="tk">&</a>(<a id="489c63" class="tk">&</a><a id="489c64" class="tk">Arduino_skal_M</a>)</td></tr>
|
||
|
<tr name="490" id="490">
|
||
|
<td><a id="l490" class='ln'>490</a></td><td> -><a id="490c9" class="tk">Sizes</a>.<a id="490c15" class="tk">numContStates</a>);</td></tr>
|
||
|
<tr name="491" id="491">
|
||
|
<td><a id="l491" class='ln'>491</a></td><td> <a id="491c5" class="tk">rtsiSetNumPeriodicContStatesPtr</a>(<a id="491c37" class="tk">&</a>(<a id="491c39" class="tk">&</a><a id="491c40" class="tk">Arduino_skal_M</a>)-><a id="491c57" class="tk">solverInfo</a>,</td></tr>
|
||
|
<tr name="492" id="492">
|
||
|
<td><a id="l492" class='ln'>492</a></td><td> <a id="492c7" class="tk">&</a>(<a id="492c9" class="tk">&</a><a id="492c10" class="tk">Arduino_skal_M</a>)-><a id="492c27" class="tk">Sizes</a>.<a id="492c33" class="tk">numPeriodicContStates</a>);</td></tr>
|
||
|
<tr name="493" id="493">
|
||
|
<td><a id="l493" class='ln'>493</a></td><td> <a id="493c5" class="tk">rtsiSetPeriodicContStateIndicesPtr</a>(<a id="493c40" class="tk">&</a>(<a id="493c42" class="tk">&</a><a id="493c43" class="tk">Arduino_skal_M</a>)-><a id="493c60" class="tk">solverInfo</a>,</td></tr>
|
||
|
<tr name="494" id="494">
|
||
|
<td><a id="l494" class='ln'>494</a></td><td> <a id="494c7" class="tk">&</a>(<a id="494c9" class="tk">&</a><a id="494c10" class="tk">Arduino_skal_M</a>)-><a id="494c27" class="tk">periodicContStateIndices</a>);</td></tr>
|
||
|
<tr name="495" id="495">
|
||
|
<td><a id="l495" class='ln'>495</a></td><td> <a id="495c5" class="tk">rtsiSetPeriodicContStateRangesPtr</a>(<a id="495c39" class="tk">&</a>(<a id="495c41" class="tk">&</a><a id="495c42" class="tk">Arduino_skal_M</a>)-><a id="495c59" class="tk">solverInfo</a>,</td></tr>
|
||
|
<tr name="496" id="496">
|
||
|
<td><a id="l496" class='ln'>496</a></td><td> <a id="496c7" class="tk">&</a>(<a id="496c9" class="tk">&</a><a id="496c10" class="tk">Arduino_skal_M</a>)-><a id="496c27" class="tk">periodicContStateRanges</a>);</td></tr>
|
||
|
<tr name="497" id="497">
|
||
|
<td><a id="l497" class='ln'>497</a></td><td> <a id="497c5" class="tk">rtsiSetErrorStatusPtr</a>(<a id="497c27" class="tk">&</a>(<a id="497c29" class="tk">&</a><a id="497c30" class="tk">Arduino_skal_M</a>)-><a id="497c47" class="tk">solverInfo</a>, (<a id="497c60" class="tk">&</a><a id="497c61" class="tk">rtmGetErrorStatus</a></td></tr>
|
||
|
<tr name="498" id="498">
|
||
|
<td><a id="l498" class='ln'>498</a></td><td> ((<a id="498c9" class="tk">&</a><a id="498c10" class="tk">Arduino_skal_M</a>))));</td></tr>
|
||
|
<tr name="499" id="499">
|
||
|
<td><a id="l499" class='ln'>499</a></td><td> <a id="499c5" class="tk">rtsiSetRTModelPtr</a>(<a id="499c23" class="tk">&</a>(<a id="499c25" class="tk">&</a><a id="499c26" class="tk">Arduino_skal_M</a>)-><a id="499c43" class="tk">solverInfo</a>, (<a id="499c56" class="tk">&</a><a id="499c57" class="tk">Arduino_skal_M</a>));</td></tr>
|
||
|
<tr name="500" id="500">
|
||
|
<td><a id="l500" class='ln'>500</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="501" id="501">
|
||
|
<td><a id="l501" class='ln'>501</a></td><td></td></tr>
|
||
|
<tr name="502" id="502">
|
||
|
<td><a id="l502" class='ln'>502</a></td><td> <a id="502c3" class="tk">rtsiSetSimTimeStep</a>(<a id="502c22" class="tk">&</a>(<a id="502c24" class="tk">&</a><a id="502c25" class="tk">Arduino_skal_M</a>)-><a id="502c42" class="tk">solverInfo</a>, <a id="502c54" class="tk">MAJOR_TIME_STEP</a>);</td></tr>
|
||
|
<tr name="503" id="503">
|
||
|
<td><a id="l503" class='ln'>503</a></td><td> (<a id="503c4" class="tk">&</a><a id="503c5" class="tk">Arduino_skal_M</a>)-><a id="503c22" class="tk">intgData</a>.<a id="503c31" class="tk">y</a> = (<a id="503c36" class="tk">&</a><a id="503c37" class="tk">Arduino_skal_M</a>)-><a id="503c54" class="tk">odeY</a>;</td></tr>
|
||
|
<tr name="504" id="504">
|
||
|
<td><a id="l504" class='ln'>504</a></td><td> (<a id="504c4" class="tk">&</a><a id="504c5" class="tk">Arduino_skal_M</a>)-><a id="504c22" class="tk">intgData</a>.<a id="504c31" class="tk">f</a>[0] = (<a id="504c39" class="tk">&</a><a id="504c40" class="tk">Arduino_skal_M</a>)-><a id="504c57" class="tk">odeF</a>[0];</td></tr>
|
||
|
<tr name="505" id="505">
|
||
|
<td><a id="l505" class='ln'>505</a></td><td> (<a id="505c4" class="tk">&</a><a id="505c5" class="tk">Arduino_skal_M</a>)-><a id="505c22" class="tk">intgData</a>.<a id="505c31" class="tk">f</a>[1] = (<a id="505c39" class="tk">&</a><a id="505c40" class="tk">Arduino_skal_M</a>)-><a id="505c57" class="tk">odeF</a>[1];</td></tr>
|
||
|
<tr name="506" id="506">
|
||
|
<td><a id="l506" class='ln'>506</a></td><td> (<a id="506c4" class="tk">&</a><a id="506c5" class="tk">Arduino_skal_M</a>)-><a id="506c22" class="tk">intgData</a>.<a id="506c31" class="tk">f</a>[2] = (<a id="506c39" class="tk">&</a><a id="506c40" class="tk">Arduino_skal_M</a>)-><a id="506c57" class="tk">odeF</a>[2];</td></tr>
|
||
|
<tr name="507" id="507">
|
||
|
<td><a id="l507" class='ln'>507</a></td><td> (<a id="507c4" class="tk">&</a><a id="507c5" class="tk">Arduino_skal_M</a>)-><a id="507c22" class="tk">contStates</a> = ((<a id="507c37" class="tk">X_Arduino_skal_T</a> <a id="507c54" class="tk">*</a>) <a id="507c57" class="tk">&</a><a id="507c58" class="tk">Arduino_skal_X</a>);</td></tr>
|
||
|
<tr name="508" id="508">
|
||
|
<td><a id="l508" class='ln'>508</a></td><td> <a id="508c3" class="tk">rtsiSetSolverData</a>(<a id="508c21" class="tk">&</a>(<a id="508c23" class="tk">&</a><a id="508c24" class="tk">Arduino_skal_M</a>)-><a id="508c41" class="tk">solverInfo</a>, <span class="kw">static_cast</span><a id="508c64" class="tk"><</a><span class="kw">void</span> <a id="508c70" class="tk">*</a><a id="508c71" class="tk">></a></td></tr>
|
||
|
<tr name="509" id="509">
|
||
|
<td><a id="l509" class='ln'>509</a></td><td> (<a id="509c22" class="tk">&</a>(<a id="509c24" class="tk">&</a><a id="509c25" class="tk">Arduino_skal_M</a>)-><a id="509c42" class="tk">intgData</a>));</td></tr>
|
||
|
<tr name="510" id="510">
|
||
|
<td><a id="l510" class='ln'>510</a></td><td> <a id="510c3" class="tk">rtsiSetSolverName</a>(<a id="510c21" class="tk">&</a>(<a id="510c23" class="tk">&</a><a id="510c24" class="tk">Arduino_skal_M</a>)-><a id="510c41" class="tk">solverInfo</a>,"ode3");</td></tr>
|
||
|
<tr name="511" id="511">
|
||
|
<td><a id="l511" class='ln'>511</a></td><td> <a id="511c3" class="tk">rtmSetTPtr</a>((<a id="511c15" class="tk">&</a><a id="511c16" class="tk">Arduino_skal_M</a>), <a id="511c33" class="tk">&</a>(<a id="511c35" class="tk">&</a><a id="511c36" class="tk">Arduino_skal_M</a>)-><a id="511c53" class="tk">Timing</a>.<a id="511c60" class="tk">tArray</a>[0]);</td></tr>
|
||
|
<tr name="512" id="512">
|
||
|
<td><a id="l512" class='ln'>512</a></td><td> <a id="512c3" class="tk">rtmSetTFinal</a>((<a id="512c17" class="tk">&</a><a id="512c18" class="tk">Arduino_skal_M</a>), 10.0);</td></tr>
|
||
|
<tr name="513" id="513">
|
||
|
<td><a id="l513" class='ln'>513</a></td><td> (<a id="513c4" class="tk">&</a><a id="513c5" class="tk">Arduino_skal_M</a>)-><a id="513c22" class="tk">Timing</a>.<a id="513c29" class="tk">stepSize0</a> = 0.2;</td></tr>
|
||
|
<tr name="514" id="514">
|
||
|
<td><a id="l514" class='ln'>514</a></td><td> <a id="514c3" class="tk">rtmSetFirstInitCond</a>((<a id="514c24" class="tk">&</a><a id="514c25" class="tk">Arduino_skal_M</a>), 1);</td></tr>
|
||
|
<tr name="515" id="515">
|
||
|
<td><a id="l515" class='ln'>515</a></td><td></td></tr>
|
||
|
<tr name="516" id="516">
|
||
|
<td><a id="l516" class='ln'>516</a></td><td> <span class="ct">/* Setup for data logging */</span></td></tr>
|
||
|
<tr name="517" id="517">
|
||
|
<td><a id="l517" class='ln'>517</a></td><td> <span class="br">{</span></td></tr>
|
||
|
<tr name="518" id="518">
|
||
|
<td><a id="l518" class='ln'>518</a></td><td> <span class="kw">static</span> <a id="518c12" class="tk">RTWLogInfo</a> <a id="518c23" class="tk">rt_DataLoggingInfo</a>;</td></tr>
|
||
|
<tr name="519" id="519">
|
||
|
<td><a id="l519" class='ln'>519</a></td><td> <a id="519c5" class="tk">rt_DataLoggingInfo</a>.<a id="519c24" class="tk">loggingInterval</a> = (<a id="519c43" class="tk">NULL</a>);</td></tr>
|
||
|
<tr name="520" id="520">
|
||
|
<td><a id="l520" class='ln'>520</a></td><td> (<a id="520c6" class="tk">&</a><a id="520c7" class="tk">Arduino_skal_M</a>)-><a id="520c24" class="tk">rtwLogInfo</a> = <a id="520c37" class="tk">&</a><a id="520c38" class="tk">rt_DataLoggingInfo</a>;</td></tr>
|
||
|
<tr name="521" id="521">
|
||
|
<td><a id="l521" class='ln'>521</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="522" id="522">
|
||
|
<td><a id="l522" class='ln'>522</a></td><td></td></tr>
|
||
|
<tr name="523" id="523">
|
||
|
<td><a id="l523" class='ln'>523</a></td><td> <span class="ct">/* Setup for data logging */</span></td></tr>
|
||
|
<tr name="524" id="524">
|
||
|
<td><a id="l524" class='ln'>524</a></td><td> <span class="br">{</span></td></tr>
|
||
|
<tr name="525" id="525">
|
||
|
<td><a id="l525" class='ln'>525</a></td><td> <a id="525c5" class="tk">rtliSetLogXSignalInfo</a>((<a id="525c28" class="tk">&</a><a id="525c29" class="tk">Arduino_skal_M</a>)-><a id="525c46" class="tk">rtwLogInfo</a>, (<a id="525c59" class="tk">NULL</a>));</td></tr>
|
||
|
<tr name="526" id="526">
|
||
|
<td><a id="l526" class='ln'>526</a></td><td> <a id="526c5" class="tk">rtliSetLogXSignalPtrs</a>((<a id="526c28" class="tk">&</a><a id="526c29" class="tk">Arduino_skal_M</a>)-><a id="526c46" class="tk">rtwLogInfo</a>, (<a id="526c59" class="tk">NULL</a>));</td></tr>
|
||
|
<tr name="527" id="527">
|
||
|
<td><a id="l527" class='ln'>527</a></td><td> <a id="527c5" class="tk">rtliSetLogT</a>((<a id="527c18" class="tk">&</a><a id="527c19" class="tk">Arduino_skal_M</a>)-><a id="527c36" class="tk">rtwLogInfo</a>, "tout");</td></tr>
|
||
|
<tr name="528" id="528">
|
||
|
<td><a id="l528" class='ln'>528</a></td><td> <a id="528c5" class="tk">rtliSetLogX</a>((<a id="528c18" class="tk">&</a><a id="528c19" class="tk">Arduino_skal_M</a>)-><a id="528c36" class="tk">rtwLogInfo</a>, "");</td></tr>
|
||
|
<tr name="529" id="529">
|
||
|
<td><a id="l529" class='ln'>529</a></td><td> <a id="529c5" class="tk">rtliSetLogXFinal</a>((<a id="529c23" class="tk">&</a><a id="529c24" class="tk">Arduino_skal_M</a>)-><a id="529c41" class="tk">rtwLogInfo</a>, "");</td></tr>
|
||
|
<tr name="530" id="530">
|
||
|
<td><a id="l530" class='ln'>530</a></td><td> <a id="530c5" class="tk">rtliSetLogVarNameModifier</a>((<a id="530c32" class="tk">&</a><a id="530c33" class="tk">Arduino_skal_M</a>)-><a id="530c50" class="tk">rtwLogInfo</a>, "rt_");</td></tr>
|
||
|
<tr name="531" id="531">
|
||
|
<td><a id="l531" class='ln'>531</a></td><td> <a id="531c5" class="tk">rtliSetLogFormat</a>((<a id="531c23" class="tk">&</a><a id="531c24" class="tk">Arduino_skal_M</a>)-><a id="531c41" class="tk">rtwLogInfo</a>, 4);</td></tr>
|
||
|
<tr name="532" id="532">
|
||
|
<td><a id="l532" class='ln'>532</a></td><td> <a id="532c5" class="tk">rtliSetLogMaxRows</a>((<a id="532c24" class="tk">&</a><a id="532c25" class="tk">Arduino_skal_M</a>)-><a id="532c42" class="tk">rtwLogInfo</a>, 0);</td></tr>
|
||
|
<tr name="533" id="533">
|
||
|
<td><a id="l533" class='ln'>533</a></td><td> <a id="533c5" class="tk">rtliSetLogDecimation</a>((<a id="533c27" class="tk">&</a><a id="533c28" class="tk">Arduino_skal_M</a>)-><a id="533c45" class="tk">rtwLogInfo</a>, 1);</td></tr>
|
||
|
<tr name="534" id="534">
|
||
|
<td><a id="l534" class='ln'>534</a></td><td> <a id="534c5" class="tk">rtliSetLogY</a>((<a id="534c18" class="tk">&</a><a id="534c19" class="tk">Arduino_skal_M</a>)-><a id="534c36" class="tk">rtwLogInfo</a>, "");</td></tr>
|
||
|
<tr name="535" id="535">
|
||
|
<td><a id="l535" class='ln'>535</a></td><td> <a id="535c5" class="tk">rtliSetLogYSignalInfo</a>((<a id="535c28" class="tk">&</a><a id="535c29" class="tk">Arduino_skal_M</a>)-><a id="535c46" class="tk">rtwLogInfo</a>, (<a id="535c59" class="tk">NULL</a>));</td></tr>
|
||
|
<tr name="536" id="536">
|
||
|
<td><a id="l536" class='ln'>536</a></td><td> <a id="536c5" class="tk">rtliSetLogYSignalPtrs</a>((<a id="536c28" class="tk">&</a><a id="536c29" class="tk">Arduino_skal_M</a>)-><a id="536c46" class="tk">rtwLogInfo</a>, (<a id="536c59" class="tk">NULL</a>));</td></tr>
|
||
|
<tr name="537" id="537">
|
||
|
<td><a id="l537" class='ln'>537</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="538" id="538">
|
||
|
<td><a id="l538" class='ln'>538</a></td><td></td></tr>
|
||
|
<tr name="539" id="539">
|
||
|
<td><a id="l539" class='ln'>539</a></td><td> <span class="ct">/* Matfile logging */</span></td></tr>
|
||
|
<tr name="540" id="540">
|
||
|
<td><a id="l540" class='ln'>540</a></td><td> <a id="540c3" class="tk">rt_StartDataLoggingWithStartTime</a>((<a id="540c37" class="tk">&</a><a id="540c38" class="tk">Arduino_skal_M</a>)-><a id="540c55" class="tk">rtwLogInfo</a>, 0.0,</td></tr>
|
||
|
<tr name="541" id="541">
|
||
|
<td><a id="l541" class='ln'>541</a></td><td> <a id="541c5" class="tk">rtmGetTFinal</a>((<a id="541c19" class="tk">&</a><a id="541c20" class="tk">Arduino_skal_M</a>)), (<a id="541c39" class="tk">&</a><a id="541c40" class="tk">Arduino_skal_M</a>)-><a id="541c57" class="tk">Timing</a>.<a id="541c64" class="tk">stepSize0</a>,</td></tr>
|
||
|
<tr name="542" id="542">
|
||
|
<td><a id="l542" class='ln'>542</a></td><td> (<a id="542c6" class="tk">&</a><a id="542c7" class="tk">rtmGetErrorStatus</a>((<a id="542c26" class="tk">&</a><a id="542c27" class="tk">Arduino_skal_M</a>))));</td></tr>
|
||
|
<tr name="543" id="543">
|
||
|
<td><a id="l543" class='ln'>543</a></td><td></td></tr>
|
||
|
<tr name="544" id="544">
|
||
|
<td><a id="l544" class='ln'>544</a></td><td> <span class="ct">/* Start for Constant: '<S1>/X0' */</span></td></tr>
|
||
|
<tr name="545" id="545">
|
||
|
<td><a id="l545" class='ln'>545</a></td><td> <a id="545c3" class="tk">Arduino_skal_B</a>.<a id="545c18" class="tk">X0</a>[0] = <a id="545c26" class="tk">Arduino_skal_P</a>.<a id="545c41" class="tk">X0_Value</a>[0];</td></tr>
|
||
|
<tr name="546" id="546">
|
||
|
<td><a id="l546" class='ln'>546</a></td><td> <a id="546c3" class="tk">Arduino_skal_B</a>.<a id="546c18" class="tk">X0</a>[1] = <a id="546c26" class="tk">Arduino_skal_P</a>.<a id="546c41" class="tk">X0_Value</a>[1];</td></tr>
|
||
|
<tr name="547" id="547">
|
||
|
<td><a id="l547" class='ln'>547</a></td><td> <a id="547c3" class="tk">Arduino_skal_B</a>.<a id="547c18" class="tk">X0</a>[2] = <a id="547c26" class="tk">Arduino_skal_P</a>.<a id="547c41" class="tk">X0_Value</a>[2];</td></tr>
|
||
|
<tr name="548" id="548">
|
||
|
<td><a id="l548" class='ln'>548</a></td><td> <a id="548c3" class="tk">Arduino_skal_B</a>.<a id="548c18" class="tk">X0</a>[3] = <a id="548c26" class="tk">Arduino_skal_P</a>.<a id="548c41" class="tk">X0_Value</a>[3];</td></tr>
|
||
|
<tr name="549" id="549">
|
||
|
<td><a id="l549" class='ln'>549</a></td><td></td></tr>
|
||
|
<tr name="550" id="550">
|
||
|
<td><a id="l550" class='ln'>550</a></td><td> <span class="ct">/* InitializeConditions for Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="551" id="551">
|
||
|
<td><a id="l551" class='ln'>551</a></td><td> <span class="kw">if</span> (<a id="551c7" class="tk">rtmIsFirstInitCond</a>((<a id="551c27" class="tk">&</a><a id="551c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="552" id="552">
|
||
|
<td><a id="l552" class='ln'>552</a></td><td> <a id="552c5" class="tk">Arduino_skal_X</a>.<a id="552c20" class="tk">MemoryX_CSTATE</a>[0] = 0.0;</td></tr>
|
||
|
<tr name="553" id="553">
|
||
|
<td><a id="l553" class='ln'>553</a></td><td> <a id="553c5" class="tk">Arduino_skal_X</a>.<a id="553c20" class="tk">MemoryX_CSTATE</a>[1] = 0.0;</td></tr>
|
||
|
<tr name="554" id="554">
|
||
|
<td><a id="l554" class='ln'>554</a></td><td> <a id="554c5" class="tk">Arduino_skal_X</a>.<a id="554c20" class="tk">MemoryX_CSTATE</a>[2] = 0.0;</td></tr>
|
||
|
<tr name="555" id="555">
|
||
|
<td><a id="l555" class='ln'>555</a></td><td> <a id="555c5" class="tk">Arduino_skal_X</a>.<a id="555c20" class="tk">MemoryX_CSTATE</a>[3] = 0.0;</td></tr>
|
||
|
<tr name="556" id="556">
|
||
|
<td><a id="l556" class='ln'>556</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="557" id="557">
|
||
|
<td><a id="l557" class='ln'>557</a></td><td></td></tr>
|
||
|
<tr name="558" id="558">
|
||
|
<td><a id="l558" class='ln'>558</a></td><td> <a id="558c3" class="tk">Arduino_skal_DW</a>.<a id="558c19" class="tk">MemoryX_IWORK</a> = 1;</td></tr>
|
||
|
<tr name="559" id="559">
|
||
|
<td><a id="l559" class='ln'>559</a></td><td></td></tr>
|
||
|
<tr name="560" id="560">
|
||
|
<td><a id="l560" class='ln'>560</a></td><td> <span class="ct">/* End of InitializeConditions for Integrator: '<S1>/MemoryX' */</span></td></tr>
|
||
|
<tr name="561" id="561">
|
||
|
<td><a id="l561" class='ln'>561</a></td><td></td></tr>
|
||
|
<tr name="562" id="562">
|
||
|
<td><a id="l562" class='ln'>562</a></td><td> <span class="ct">/* SystemInitialize for Enabled SubSystem: '<S22>/MeasurementUpdate' */</span></td></tr>
|
||
|
<tr name="563" id="563">
|
||
|
<td><a id="l563" class='ln'>563</a></td><td> <span class="ct">/* SystemInitialize for Product: '<S53>/Product3' incorporates:</span></td></tr>
|
||
|
<tr name="564" id="564">
|
||
|
<td><a id="l564" class='ln'>564</a></td><td><span class="ct"> * Outport: '<S53>/L*(y[k]-yhat[k|k-1])'</span></td></tr>
|
||
|
<tr name="565" id="565">
|
||
|
<td><a id="l565" class='ln'>565</a></td><td><span class="ct"> */</span></td></tr>
|
||
|
<tr name="566" id="566">
|
||
|
<td><a id="l566" class='ln'>566</a></td><td> <a id="566c3" class="tk">Arduino_skal_B</a>.<a id="566c18" class="tk">Product3</a>[0] = <a id="566c32" class="tk">Arduino_skal_P</a>.<a id="566c47" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="567" id="567">
|
||
|
<td><a id="l567" class='ln'>567</a></td><td> <a id="567c3" class="tk">Arduino_skal_B</a>.<a id="567c18" class="tk">Product3</a>[1] = <a id="567c32" class="tk">Arduino_skal_P</a>.<a id="567c47" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="568" id="568">
|
||
|
<td><a id="l568" class='ln'>568</a></td><td> <a id="568c3" class="tk">Arduino_skal_B</a>.<a id="568c18" class="tk">Product3</a>[2] = <a id="568c32" class="tk">Arduino_skal_P</a>.<a id="568c47" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="569" id="569">
|
||
|
<td><a id="l569" class='ln'>569</a></td><td> <a id="569c3" class="tk">Arduino_skal_B</a>.<a id="569c18" class="tk">Product3</a>[3] = <a id="569c32" class="tk">Arduino_skal_P</a>.<a id="569c47" class="tk">Lykyhatkk1_Y0</a>;</td></tr>
|
||
|
<tr name="570" id="570">
|
||
|
<td><a id="l570" class='ln'>570</a></td><td></td></tr>
|
||
|
<tr name="571" id="571">
|
||
|
<td><a id="l571" class='ln'>571</a></td><td> <span class="ct">/* End of SystemInitialize for SubSystem: '<S22>/MeasurementUpdate' */</span></td></tr>
|
||
|
<tr name="572" id="572">
|
||
|
<td><a id="l572" class='ln'>572</a></td><td></td></tr>
|
||
|
<tr name="573" id="573">
|
||
|
<td><a id="l573" class='ln'>573</a></td><td> <span class="ct">/* set "at time zero" to false */</span></td></tr>
|
||
|
<tr name="574" id="574">
|
||
|
<td><a id="l574" class='ln'>574</a></td><td> <span class="kw">if</span> (<a id="574c7" class="tk">rtmIsFirstInitCond</a>((<a id="574c27" class="tk">&</a><a id="574c28" class="tk">Arduino_skal_M</a>))) <span class="br">{</span></td></tr>
|
||
|
<tr name="575" id="575">
|
||
|
<td><a id="l575" class='ln'>575</a></td><td> <a id="575c5" class="tk">rtmSetFirstInitCond</a>((<a id="575c26" class="tk">&</a><a id="575c27" class="tk">Arduino_skal_M</a>), 0);</td></tr>
|
||
|
<tr name="576" id="576">
|
||
|
<td><a id="l576" class='ln'>576</a></td><td> <span class="br">}</span></td></tr>
|
||
|
<tr name="577" id="577">
|
||
|
<td><a id="l577" class='ln'>577</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="578" id="578">
|
||
|
<td><a id="l578" class='ln'>578</a></td><td></td></tr>
|
||
|
<tr name="579" id="579">
|
||
|
<td><a id="l579" class='ln'>579</a></td><td><span class="ct">/* Model terminate function */</span></td></tr>
|
||
|
<tr name="580" id="580">
|
||
|
<td><a id="l580" class='ln'>580</a></td><td><span class="kw">void</span> <a id="580c6" class="tk">Arduino_skalModelClass</a>::<a id="580c30" class="tk">terminate</a>()</td></tr>
|
||
|
<tr name="581" id="581">
|
||
|
<td><a id="l581" class='ln'>581</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="582" id="582">
|
||
|
<td><a id="l582" class='ln'>582</a></td><td> <span class="ct">/* (no terminate code required) */</span></td></tr>
|
||
|
<tr name="583" id="583">
|
||
|
<td><a id="l583" class='ln'>583</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="584" id="584">
|
||
|
<td><a id="l584" class='ln'>584</a></td><td></td></tr>
|
||
|
<tr name="585" id="585">
|
||
|
<td><a id="l585" class='ln'>585</a></td><td><span class="ct">/* Constructor */</span></td></tr>
|
||
|
<tr name="586" id="586">
|
||
|
<td><a id="l586" class='ln'>586</a></td><td><a id="586c1" class="tk">Arduino_skalModelClass</a>::<a id="586c25" class="tk">Arduino_skalModelClass</a>() <a id="586c50" class="tk">:</a></td></tr>
|
||
|
<tr name="587" id="587">
|
||
|
<td><a id="l587" class='ln'>587</a></td><td> <a id="587c3" class="tk">Arduino_skal_B</a>(),</td></tr>
|
||
|
<tr name="588" id="588">
|
||
|
<td><a id="l588" class='ln'>588</a></td><td> <a id="588c3" class="tk">Arduino_skal_DW</a>(),</td></tr>
|
||
|
<tr name="589" id="589">
|
||
|
<td><a id="l589" class='ln'>589</a></td><td> <a id="589c3" class="tk">Arduino_skal_X</a>(),</td></tr>
|
||
|
<tr name="590" id="590">
|
||
|
<td><a id="l590" class='ln'>590</a></td><td> <a id="590c3" class="tk">Arduino_skal_M</a>()</td></tr>
|
||
|
<tr name="591" id="591">
|
||
|
<td><a id="l591" class='ln'>591</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="592" id="592">
|
||
|
<td><a id="l592" class='ln'>592</a></td><td> <span class="ct">/* Currently there is no constructor body generated.*/</span></td></tr>
|
||
|
<tr name="593" id="593">
|
||
|
<td><a id="l593" class='ln'>593</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="594" id="594">
|
||
|
<td><a id="l594" class='ln'>594</a></td><td></td></tr>
|
||
|
<tr name="595" id="595">
|
||
|
<td><a id="l595" class='ln'>595</a></td><td><span class="ct">/* Destructor */</span></td></tr>
|
||
|
<tr name="596" id="596">
|
||
|
<td><a id="l596" class='ln'>596</a></td><td><a id="596c1" class="tk">Arduino_skalModelClass</a>::<a id="596c25" class="tk">~</a><a id="596c26" class="tk">Arduino_skalModelClass</a>()</td></tr>
|
||
|
<tr name="597" id="597">
|
||
|
<td><a id="l597" class='ln'>597</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="598" id="598">
|
||
|
<td><a id="l598" class='ln'>598</a></td><td> <span class="ct">/* Currently there is no destructor body generated.*/</span></td></tr>
|
||
|
<tr name="599" id="599">
|
||
|
<td><a id="l599" class='ln'>599</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="600" id="600">
|
||
|
<td><a id="l600" class='ln'>600</a></td><td></td></tr>
|
||
|
<tr name="601" id="601">
|
||
|
<td><a id="l601" class='ln'>601</a></td><td><span class="ct">/* Real-Time Model get method */</span></td></tr>
|
||
|
<tr name="602" id="602">
|
||
|
<td><a id="l602" class='ln'>602</a></td><td><a id="602c1" class="tk">RT_MODEL_Arduino_skal_T</a> <a id="602c25" class="tk">*</a> <a id="602c27" class="tk">Arduino_skalModelClass</a>::<a id="602c51" class="tk">getRTM</a>()</td></tr>
|
||
|
<tr name="603" id="603">
|
||
|
<td><a id="l603" class='ln'>603</a></td><td><span class="br">{</span></td></tr>
|
||
|
<tr name="604" id="604">
|
||
|
<td><a id="l604" class='ln'>604</a></td><td> <span class="kw">return</span> (<a id="604c11" class="tk">&</a><a id="604c12" class="tk">Arduino_skal_M</a>);</td></tr>
|
||
|
<tr name="605" id="605">
|
||
|
<td><a id="l605" class='ln'>605</a></td><td><span class="br">}</span></td></tr>
|
||
|
<tr name="606" id="606">
|
||
|
<td><a id="l606" class='ln'>606</a></td><td></td></tr>
|
||
|
</table>
|
||
|
</pre>
|
||
|
</body>
|
||
|
</html>
|