<p class="MsoNormal"><span lang="EN-US">Hello!</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Currently I
am working on the implementation of a two-point (bang-bang) controller using
the <span style="color:red">Matlab Type 155 for TRNSYS</span>.</span></p>

<p class="MsoNormal"><span lang="EN-US">As a matter
of fact, the code is quite simple, shown as follows: </span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">if</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"> Tso<45 && </span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"><0.5</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""></span></p>



<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">        </span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">=1.0;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""></span></p>



<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">elseif</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"> Tso>50 && </span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">>0.5</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""></span></p>



<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">        </span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">=0.0;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""></span></p>



<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:blue">end</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""></span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style="text-align:justify"><span lang="EN-US">The variable “</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US">”
(state variable, storage variable) is supposed to toggle depending upon the
values of “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Tso</span><span lang="EN-US">”. Regarding the code above, this means that
within the range of “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">45</span><span lang="EN-US">” and “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">50</span><span lang="EN-US">” the variable
“</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US">” should not change (therefore remain “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">1.0</span><span lang="EN-US">”).</span></p>



<p class="MsoNormal"><span lang="EN-US">However, when I run the simulation, the
variable “</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">” </span><span lang="EN-US">toggles to “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">0.0</span><span lang="EN-US">” as “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">Tso</span><span lang="EN-US">” as exceeds “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">45</span><span lang="EN-US">” (should
remain “</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">1.0</span><span lang="EN-US">” tough) , which therefore leads to the
assumption that Matlab does not store “</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:red">flag_boiler_act</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">” </span><span lang="EN-US">at all</span><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'">. </span></p>



<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:'Courier New'"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Can you please give me some advice about the
better way to do that?</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Best regards.</span></p>

<p class="MsoNormal"><span lang="EN-US">Tarik</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p><p class="MsoNormal"><span lang="EN-US">P.S.: I am well aware of the fact that I can use the standard controller with a hysterisis, however, I would like to understand the concept of the Type 155 and also exploit its full potential. </span></p>