Welcome to the TRNSYS Users Forum.

The forum is a place where people can interact and have discussions about different topics involving the use of the TRNSYS software package. Here you can post topics for discussion or questions on using TRNSYS and get advice from other users or TRNSYS experts. This forum is not intended for detailed technical support. Users should contact their distributor’s hotline for such assistance.

Some tips for success on using the forum:

  • Follow the Forum Rules posted in Forum Administration.
  • There are categories for different types of topics and questions. Post your topic or question into the proper category.
  • Before posting a topic or question search the existing topics  (and the TRNSYS Users listserv archive or Post archive) to see if a similar topic or question has already been answered.
  • Use a descriptive topic name. Don’t use attention getting subjects, they don’t get attention and only annoy people.
  • State the version of TRNSYS and which add-ons your are using.
  • Include enough specific details for your topic of question to be answered. Just posting “Why am I getting an error?” without describing the specific error and what you are trying to do when you get the error will not receive a response that fixes your issue.
  • Remember when people help you, they are doing you a favor. Be patient, help people out by posting good descriptions of what you need help with, and be polite even if a response does not solve your issue.
  • Moderators may edit your post for clarity or move your topic to a more appropriate category.

Notifications
Clear all

Delayed input for more than 25 time steps

1 Posts
2 Users
0 Reactions
5 Views
0
Topic starter

Hi,

I would like to use the average output value during the previous day in TRNSYS. In this forum, I have found that type 150 could be used for this purpose, but there is a limit of maximum 25 time steps in type 150. Since I use the time step 0.1 hr, the limit means that I can´t use type 150. Furthermore, I only want to do this calculation once in a day, not in every time step.

Does anyone know how this could be solved?

Best regards, Johan

Topic Tags
1 Answer
0

There are (as with most things in TRNSYS) a few ways to approach this. 

The limit of 25 time steps in Type 150 exists because the storage array in the Type is sized to only hold 25 values. That size (Max_Held) can easily be increased to 240 timesteps or more by re-compiling the source code and modifying the proforma (the icon in Simulation Studio that holds parameter/input/output settings). You may contact your TRNSYS distributor and request a modified .dll and proforma for Type150 with the increased limits. You may also re-compile the source code and change the proforma limits yourself. This video shows how to open and re-compile TRNSYS using Microsoft Visual Studio: Debugging Errors in TRNSYS Using Visual Studio. Visual Studio is free, and download and installation instructions are included in the first (chronological) comment on the video. Once the source code is changed, the proforma can be modified within Simulation Studio, as demonstrated here: Changing Cycle or Parameter Limits in a TRNSYS Proforma

Another option would be to write your own Type similar to Type150. You could use TypeStudio with the source code from Type150 to write a Type identical to Type150 except with a larger Max_Held value, or you could go a step further and write the new Type to only save and update values every X hours or X timesteps, instead of saving and updating values on every timestep. More guidance on using TypeStudio and writing new Types is available in the ProgrammersGuide.pdf in the Documentation folder of your main TRNSYS directory. 

A final possibility: I'm not sure which 'average output value during the previous day' you wish to use in your simulation, but if it's something read from external data (like an outdoor air temperature), you could do some pre-processing of your data, and create a data file you read into TRNSYS with average values from the previous day. 

Share: