[TRNSYS-users] type 155 and GenOpt

Riccardo Nesa riccardo_sas at hotmail.it
Mon Jan 22 03:13:09 PST 2018


Hi elisa


you have to put "mFileErrorCode=some_number" in the m.file to get the point when your script fails and you MUST write "mFileErrorCode=0" at the end of the m.file.

[cid:ec28adef-8cbc-4f0a-9b64-5e7b386b2d6f]



you have to write


"mFileErrorCode=0

return

"

also at the end of some particular  "if statment" like:



if trnInfo(8)==-1

...

...

...

mFileErrorCode=0

return





________________________________
Da: TRNSYS-users <trnsys-users-bounces at lists.onebuilding.org> per conto di Elisa Ghirardi via TRNSYS-users <trnsys-users at lists.onebuilding.org>
Inviato: lunedì 22 gennaio 2018 09:30
A: trnsys-users at lists.onebuilding.org
Cc: Elisa Ghirardi
Oggetto: [TRNSYS-users] type 155 and GenOpt


Hi TRNSYS users,



I’m trying to run an optimization with TrnOpt with a link with matlab (type 155). The single simulation works, but when I run the optimization I have always the same error: “The M-File did not properly set 'mFileErrorCode' to 0 when it was called. This may indicate that an error occurred in Matlab while running the M-File. 'mFileErrorCode' was left to 1 by the M-File. You can set ignoreEngineClose to 1 and run the 'lasterr' command in Matlab to help diagnose the  problem. The error occurred at info(7) =            0 , info(13) =            0”.

I think it’s a problem  with matlab file access because , despite the .m file being inserted into the GenOpt input file, the GenOpt seems unable to start it, in fact GenOpt starts matlab but then fails to open the file.



Someone of you has already dealt with this issue?



Kind regards,



Elisa Ghirardi

University of Bergamo, Italy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20180122/fa5f2fcc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 5743 bytes
Desc: pastedImage.png
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20180122/fa5f2fcc/attachment.png>


More information about the TRNSYS-users mailing list