[TRNSYS-users] Linking MATLAB and TRNSYS

Arno Dentel Arno.Dentel at ohm-hochschule.de
Thu Sep 8 05:55:32 PDT 2011


Ehsan,

 

here is a small m-file example, which change a value in the dck-file
(shift2), saves the dck-file and finally run TRNSYS.

 

 

 

% m file, which calls TRNSYS

%

 

%Test for open an external file and write a value to the file

% Each character uses 8 bits (1 byte)

 

const = 'shift2 = 30';

 

fid = fopen('OneZoneModel.dck', 'r+');

 

fseek(fid, 1102, -1);

fprintf(fid, '%s', const);

 

 

fclose(fid);

 

 

dos('C:\Programme\TRNSYS17\EXE\TRNExe.exe
C:\Programme\Trnsys17\MyProjects\test\callTRNSYS\OneZoneModel.dck /n')

 

 

Freundliche Grüße,
Arno Dentel

____________________________________

Arno Dentel - MEng, Dipl.-Ing.(FH)

Forschungsgebiet Gebäudesysteme 

 

ieg - Institut für Energie und Gebäude

Georg-Simon-Ohm-Hochschule 

für angewandte Wissenschaften - 

Fachhochschule Nürnberg

 

Keßlerplatz 12

90489 Nürnberg

 

Fon: +49 – 911 – 5880 1846

Fax: +49 – 911 – 5880 5846

 

E-Mail:  <mailto:arno.dentel at ohm-hochschule.de>
arno.dentel at ohm-hochschule.de

Web:     <http://www.ieg.ohm-hochschule.de/> www.ieg.ohm-hochschule.de

 

P Be green - please print only when necessary.

 

Von: trnsys-users-bounces at cae.wisc.edu
[mailto:trnsys-users-bounces at cae.wisc.edu] Im Auftrag von Ehsan Asadi
Gesendet: Donnerstag, 8. September 2011 13:36
An: trnsys-users at cae.wisc.edu
Betreff: [TRNSYS-users] Linking MATLAB and TRNSYS

 

Hi,

 

I know that it is possible to call MATLAB from TRNSYS, Using TYPE 155, but
don't know if it is possible to call TRNSYS from MATLAB. What I'm trying to
do is using MATLAB optimization tools to solve a multi-objective
optimization problem. I'm trying to ask MATLAB to read TRNSYS output file,
modify it to create a new input file and initiate TRNSYS. 

Any ideas?





Regards

Ehsan









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20110908/8de29d3e/attachment-0005.htm>


More information about the TRNSYS-users mailing list