Dear TRNSYS users,
I am modelling a 3D multizone building with Type 56. In my deck file I have 3 different MATLAB Type 155 units which do all the same thing: increase a step variable by 1 each time step (just for debugging). The variable names are all different as I know
the 3 .m files share the same workspace. I output the step counter each time step and they all go up 1 at a time, as you can see in the output file (I hope the formatting turns out alright):
But when I now connect Type 56 (e.g. some air node temp) output to one of the MATLAB Type 155 (counter_1) as an input, I get a different results:
Counter_1 goes from 1 directly to 3. It seems as if the iterative call in that MATLAB unit is done twice, therefore going from 1 to 3, before outputting 3 as a result. But only after the first call and then never again?
I made sure to read my inputs in each MATLAB like this,
file1:
MyInputs1 = trnInputs(1:nI);
file2:
MyInputs2 = trnInputs(1:nI);
file3:
MyInputs3 = trnInputs(1:nI);
as is stated in the example file. Same goes for the outputs.
What am I missing here? Why is a Type 56 output looping my iterative MATLAB step twice after the first timestep? Is it not advised to have multiple MATLAB units in the deck file?
Any help is appreciated.
Best regards,
Daniel Weber
PS: This is regarding the topic "Surface Gain Inside - Pane Temp Error" that I've asked before. I've
narrowed it down to this now, so you can close the other one.
|