[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] Linking MATLAB and TRNSYS



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: arno.dentel@ohm-hochschule.de

Web:    www.ieg.ohm-hochschule.de

 

P Be green - please print only when necessary.

 

Von: trnsys-users-bounces@cae.wisc.edu [mailto:trnsys-users-bounces@cae.wisc.edu] Im Auftrag von Ehsan Asadi
Gesendet: Donnerstag, 8. September 2011 13:36
An: trnsys-users@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