Custom set of TRNSYS Types that perform arithmetic operations and output the results.
Type3814-3825 allows simulating arithmetic operations within TRNSYS models. These Types process inputs using arithmetic operators (K,+, -, *, /, **, MOD,MIN, MAX, ABS, NEG & INV ) and output the resulting numerical value. This enables mathematical calculations, signal processing, and data manipulation directly within your simulations.
Note
TRNSYS already provides arithmetic operations within the Calculator Type, which are generally more optimized for simulation speed.
The advantage of this set of Types is that they do not require creating custom inputs or outputs within the Calculator, making them easier to integrate and more visually intuitive compared to code-based implementations.
- TRNSYS v.18
-
Clone the repo or download the source files:
git clone https://github.com/allachance/TRNSYS-ArithmeticOperators-Type3814-3824.git
-
Copy the folders into your TRNSYS 18 installation directory, e.g.,
C:\TRNSYS18
| Name | Description | Options |
|---|---|---|
Input-n |
Input value(s) for the arithmetic operation | — |
Number of Inputs |
Total number of input value(s) | Minimum: 1 or 2 / Maximum: 100 |
| Name | Description | Options |
|---|---|---|
Output-(n) |
Returns the result of the operation | — |
- Add the Component in TRNSYS Studio
-
Insert the desired operation into your simulation workspace:
Type3814:Constant (K)Type3815:Addition (+)Type3816:Subtraction (-)Type3817:Multiplication (*)Type3818:Division (/)Type3819:Power (**)Type3820:Modulo (%)Type3821:Minimum (MIN)Type3822:Maximum (MAX)Type3823:Absolute (|x|)Type3824:Negation (-x)Type3825:Reciprocal (1/x)
-