Hi Miroslava,<div><br></div><div>I struggled with this same problem, hopefully my solution will help you.</div><div><br></div><div>GenOpt has an option where you can define 'FirstCharacterAt' in the ObjectiveFunctionLocation section of your .ini file. This allows you to extract two outputs from one line of text.</div>
<div><br></div><div>Here is an example from my work that might help you: (In my opinion, the GenOpt manual does a poor job of explaining how to use 'FirstCharacterAt'!)</div><div><br></div><div>My output text file looks like this: (I want to read kWh_total and BTU_total from the last line of the file)</div>
<div><br></div><div><br></div><div><div>TIME                                         ,kWh_total                                 ,BTU_total                ,</div><div>  +0.0000000000000000E+00,  +0.0000000000000000E+00,  +0.0000000000000000E+00,</div>
<div>  +8.7600000000000000E+03,  +9.6507009364595826E+04,  +3.5498954575250727E+08,</div></div><div><br></div><div><br></div><div>In order to read kWh_total and BTU_total into GenOpt as objective functions, I define my the ObjectiveFunctionLocation of my .ini file as follows:</div>
<div><br></div><div><br></div><div> ObjectiveFunctionLocation {</div><div><div>        Name1      = "BTU";</div><div>        Delimiter1 = "," ; </div><div><span class="Apple-tab-span" style="white-space:pre">      </span>FirstCharacterAt1 = 52;</div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>Name2 = "kWh";</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>Delimiter2 = ",";</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>FirstCharacterAt2 = 26;<span class="Apple-tab-span" style="white-space:pre">             </span></div><div>    }</div></div><div><br></div><div><br></div><div><br></div>
<div>GenOpt reads files by starting at the <u>bottom</u> of the file. The 'FirstCharacterAt' parameter tells GenOpt where to look for the Delimiter that you have defined. So, for my first objective function (BTU), I defined FirstCharacterAt to be 52, which is one position to the left of the delimiter for the BTU data. (i.e., just to the left of the comma in the string ',  +3.5498954575250727E+08') I did the same for the kWh output, but this time the FirstCharacterAt position is 26, which is just to the left of the comma delimiter for the kWh output.</div>
<div><br></div><div>I think it is probably easier to have both outputs in one file. If you have two output files, GenOpt will only read the second output file if it can't find the Objective Function in the first output file. Having two output files doesn't really simplify anything, you still have to figure out how to define your Delimiter and ObjectiveFunctionLocation so that two values can be read.</div>
<div><br></div><div>I hope that helps! Please reply if something does not make sense.</div><div>-Graham</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br>
</div><div><br></div><div><br><br><div class="gmail_quote">On Sat, May 5, 2012 at 11:04 AM, Miroslava Kavgic <span dir="ltr"><<a href="mailto:miroslava.kavgic@gmail.com" target="_blank">miroslava.kavgic@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<div><br></div><div><div>I'am using GenOpt with TRNSYS for optimization of  building. My first cost function on which optimization should be performed is Qheat and the second cost function that should serve as restriction function (penalty) is PPD (predicted percent of dissatisfied people), and both functions are calculated by TRNSYS. However I'am having trouble with writing the <b>.ini file</b> so both functions could be red by GenOpt. Namely, GenOpt only reads the first one (Qheat) while it ignores the second one, even thoug it exists in the output file after the first one. </div>

<div><br></div><div><br></div><div>For example, if Name1=''Qheat''; Delimiter1=''04032000000000000E+0004''; (simulate only winter season),</div><div>how Name and Delimiter of the second cost function should be defined, that is of the PPD function? </div>

<div>More precisely I don't know how to define Delimiter of the second function in order to be red by GenOpt. </div><div>Should both function be in the same output file or in the separate output files? </div>
<div><br></div><div>Thank you very much!!!</div><div><br></div><div>Kind Regards,</div><div><br></div><div>Miroslava Kavgic</div><div><div style="background-color:rgb(241,241,241);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(221,221,221);border-right-color:rgb(221,221,221);border-bottom-color:rgb(221,221,221);border-left-color:rgb(221,221,221);clear:both;line-height:6px;outline-style:none;outline-width:initial;outline-color:initial;width:20px">

<img style="background-image:url('');background-color:initial;min-height:8px;width:20px;background-repeat:no-repeat no-repeat"></div><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br>Miroslava Kavgic Dipling, MSc<br>PhD Candidate<br> <br>Bartlett School of Graduate Studies<br>University College London (UCL)<br>Central House<br>
14 Upper Woburn Place<br>
London     WC1H 0NN    UK<br> <br><a href="mailto:E-mail%3Amiroslava.kavgic@gmail.com" target="_blank">E-mail:miroslava.kavgic@gmail.com</a><br>
</font></span></div>
<br>_______________________________________________<br>
TRNSYS-users mailing list<br>
<a href="mailto:TRNSYS-users@cae.wisc.edu">TRNSYS-users@cae.wisc.edu</a><br>
<a href="https://mailman.cae.wisc.edu/listinfo/trnsys-users" target="_blank">https://mailman.cae.wisc.edu/listinfo/trnsys-users</a><br>
<br></blockquote></div><br></div>