Interfacing TRNSYS with MATLAB for Building Energy System Optimization
Abstract
:1. Introduction
2. Related Work and Research Question
2.1. Tool Coupling to TRNSYS
2.1.1. Functional Mock-Up Interface (FMI)
2.1.2. Building Controls Virtual Test Bed (BCVTB)
2.1.3. TRNSYS Type 155
2.1.4. Open Platform Communications Unified Architecture (OPC UA)
2.1.5. TCP/IP
2.1.6. Dynamic Link Library (DLL)
2.1.7. TRNSYS Type 163/169
2.1.8. TRNSYS Type 3157 (CFFI)
2.1.9. File Input/Output (FIO)
- Path_to_TRNExe.exe\TRNExe.exe Path_to_Dck_file\Dck_file.dck \switch
- n: This skips the dialog boxes that inform the user at the end of simulation on errors during the simulation process and therefore enables a batch mode.
- h: This implies the n-switch and enables the hidden batch mode that makes TRNSYS completely invisible. Graphical output by online plotter is not possible and has to be disabled by setting parameter 9 of the online plotter to −1. As an advantage, the simulation will be speed up noticeably.
2.2. Review
2.3. Research Question
Publication | Purpose of Tool Coupling | Tool Coupling Method with TRNSYS | Used Software Tools and Programming Languages | Used Metrics | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Optimization Objectives | Automation | Model Extension | Parametric Analysis | Model Comparison | ||||||||
Design-Oriented | Operation-Oriented | Number and Name of Solvers | ||||||||||
Single | Multi | |||||||||||
Kalkan et al. [27] | - | - | - | - | - | - | xC,P,M | - | - | Type 155M Type 3157P DLLC | TRNSYS MATLAB C++ | |
Nayak et al. [28] | - | - | - | - | - | - | xM | - | - | Type 155M | TRNSYS MATLAB | MAE |
Mazzeo et al. [29] | - | - | - | - | - | - | - | - | x | - | TRNSYS EnergyPlus IDA ICE | RMSE, , NRMSE |
Magni et al. [30] | - | - | - | - | - | - | - | - | x | - | TRNSYS EnergyPlus IDA ICE Simulink CarnotUIBK ALMABuild Modelica DALEC PHPP | RMSE, , MAE, MBE |
Asadi et al. [31] | x | - | - | xM | 1 (bintprog)M | xG | - | - | - | FIOG,M | TRNSYS MATLAB GenOpt | |
Magnier et al. [32] | x | - | - | xM | 2 (ANN NSGA-II)M | xG | - | - | - | FIOG | TRNSYS MATLAB GenOpt | |
Fernandes et al. [33] | x | - | xG | - | 1 (GPS CS)G | - | xM | - | - | n/a | TRNSYS MATLAB GenOpt | |
Narayan et al. [34] | - | x | - | xM | 3 (PSO, GA, GPS)M | - | - | - | - | FIOM | TRNSYS MATLAB | |
Mylonas et al. [35] | - | x | xO | n/a | xpt | xP | - | - | Type 1630ct | TRNSYS Python pytrnsys OR tools | ||
Arenas-Larrañaga et al. [36] | - | - | - | - | - | xpt | - | x | - | FIOpt | TRNSYS pytrnsys | |
Meiers et al. [37] | - | - | - | - | - | xM | xM | - | - | BCVTB | TRNSYS MATLAB BCVTB LabVIEW | RMSE |
Tadayon et al. [39] | x | - | xG | xM | 2 (MOPSO NSGA-II)M | xM | xM | - | - | FIOG,M | TRNSYS MATLAB GenOpt | |
This paper | x | - | xM,G | - | 6 *,G,9 *,M | - | - | - | - | FIOG,M | TRNSYS MATLAB GenOpt | , AE |
- TRNSYS–GenOpt (TG).
- TRNSYS–MATLAB Optimization Toolbox (TM).
- Description of the design of both MATLAB–TRNSYS frameworks, TG and TM, respectively, for automated parameterization of models for design optimization and a parameter estimation as a use case.
- Comparison of the required computation times for the estimation process.
- Comparison of the solver accuracy for the estimation process.
3. Methodology
3.1. Introduction to the Used Software Tools
3.2. TRNSYS Benchmark Model
3.3. Optimization Frameworks
- A
- Coordinated coupling of TRNSYS and GenOpt by MATLABWithin the first framework, optimization is performed through GenOpt. In general, the complete process can be divided in three sections:
- 1
- Coordination.
- 2
- Optimization.
- 3
- Simulation.
By default, GenOpt has no functionality to start several solvers one after another automatically. To circumvent this disadvantage, MATLAB takes this over. In the coordination part, MATLAB calls GenOpt in different solver configurations in a loop. In the first section, MATLAB coordinates the user-defined configuration of the GenOpt files, such as file locations, algorithm choice and algorithm parameters, simulation configuration and its input. In general, when the user finishes the configuration in the GUI, GenOpt prepares the TRNSYS model deck file, which has to be created once in TRNSYS before starting the optimization process, to be a template as follows:- It replaces the optimization variable through the variable name in the case of a one-dimensional optimization problem.
- It adds an output printer, named Type 758, to write the chosen optimization variable value and the resulting cost variable value to the output files OutputListingMain.txt and OutputListingAll.txt. Note that in TRNSYS 18, the structure of the deck file changes at the end of the file, which makes further modifications necessary.
These two steps are also performed in the coordination part of the developed framework in MATLAB to bypass the configuration in the GenOpt GUI. The second section, optimization, is then handled mainly by GenOpt. For each optimization step, GenOpt writes a modified deck file and TRNSYS reads this modified template dck file and simulates the model (Section 3: simulation).Finally, MATLAB processes the output files of GenOpt for analysis and visualization of the results. Figure 3 shows the schema of the GenOpt interface [11] with the above described extensions.In the following, the process flow of the coordination, optimization and simulation parts is called generic optimization and will be explained in steps that are more detailed. The generic optimization process has a main function and the evalGenOpt function. Both are subdivided into 3 phases (Figure 4):- 1
- Preprocessing phase.
- 2
- Optimization phase.
- 3
- Postprocessing phase.
In the preprocessing phase of the main function, configuration steps are performed as listed below:- A table of all solver names is created.
- Paths are defined for the model deck file, GenOpt working directory in the TRNSYS path and new folder of the result files.
- Common solver parameters and boundary settings are defined, such as solver step size, min and max boundary values, initial start value, maximum iteration number and maximum number of equal results before optimization process stops.
- Additional parameter settings are defined, like the name of the optimization and cost variables, the number of repetitions of a complete optimization cycle to calculate a mean optimization time, mode of the TRNSYS simulation process bar during the optimization process and the number of time steps in idle state of the GenOpt GUI. The GenOpt GUI has no capability to close automatically when an optimization process has finished. Therefore, the process will be observed and terminated when it comes back to idle mode with no processor load for a user-defined time period as described later.
In the optimization phase of the main function, the GenOpt optimization with the user-defined parameters can be called as a MATLAB function:[output] = evalGenOpt(input)
where input are the configurations performed in the preprocessing part and the solver algorithm name of GenOpt. The output is a MATLAB data structure containing the optimization time, solution value, number of solver evaluations and objective value. In the postprocessing part, the result files are accumulated and processed for visualization. Within the evalGenOpt, function preprocessing is composed of extracting the date from the function input structure and writing the configuration files TRNSYS17.ini, TRNSYS.cfg, command.txt and template.dck. Then, sequentially, the optimization phase will be started once with GenOpt in normal mode with GUI using MATLAB’s system() command with the following input string:cmd /C java -jar genopt.jar TRNSYS.ini &
cmd starts a new instance of the Microsoft Windows command interpreter. /C carries out the command specified by the string and then terminates. The trailing & dispatches the command window to the background, while MATLAB can continue. This is required due to the drawback that the GenOpt GUI will not close itself or be closed by command attribute after the optimization has finished. Therefore, observation and manual termination of the task is implemented with the following .NET methods:System.Diagnostics.Process.GetProcessesByName(process_name)}, System.Diagnostics.PerformanceCounter(process_name)}.
where java.exe is the GenOpt process name.Both GenOpt and the command window will be terminated when the CPU utilization is zero for a certain time (here 10 s) using the following in the MATLAB system() function:“C:\Windows\System32\taskkill.exe” /F /im java.exe /im cmd.exe
where /F forces the termination of the task specified with the parameter /im for the image or executable names. In hidden mode, without GUI, GenOpt can be started with the following command:java -classpath genopt.jar genopt.GenOpt TRNSYS.ini
After each of these two optimization phases, a timer is started to measure the optimization time for the benchmark, the GenOpt result txt file is read and data are collected. - B
- Coupling of TRNSYS and MATLAB Optimization ToolboxIn the second framework, the complete process can also be divided into the three sections coordination, optimization and simulation. In contrast to the first approach, the coordination and optimization are handled by MATLAB and its Optimization Toolbox, which triggers the simulation in TRNSYS. This approach is similar to that of GenOpt. MATLAB creates a copy of the dck files and modifies the optimization variable to fulfill the objective function. This takes into account the user configuration information of file paths and solver algorithm parameters. A TRNSYS output printer (Type 25) is added to the dck file, printing the objective value after each optimization iteration. MATLAB reads the objective value from this TRNSYS output file.When the solver finishes, the results of the optimization iteration process are written to a log file and an output file (Figure 5).The complete framework contains three function layers: main(), evalMatOpt() and runTRNmodel(). Each of the function layers can also be subdivided into a preprocessing, an optimization and a postprocessing phase (Figure 6).In the preprocessing phase of the main function, starting an optional timer to measure the overall processing time (not used for this benchmark) and declaring the optimization boundaries and the solver take place. In addition, a mat file with function arguments is created, which is loaded by the runTRNmodel function in every optimization iteration step.In the same way as it was developed with GenOpt, and as described in the section above, in the optimization phase, the second function layer call
[output] = evalMatOpt(input)
allows the user to run the complete optimization process, which also includes calling the TRNSYS model. The preprocessing phase of evalMatOpt() is composed of reading the function input data structure, starting the MATLAB Parallel Computing Pool, included in the MATLAB Parallel Computing Toolbox, and writing the solver’s individual optimization options file using optimoptions().In the third function layer, the TRNSYS model with the modified deck files is simulated using the following function call:[output] = runTRNmodel(input)
In the preprocessing part of this function layer, the modified TRNSYS deck file is built by replacing the value of the optimization variable and adding an output printer (Type 25) to write the value of the optimization and cost variable to a txt file which will be read in again in the postprocessing part to create the function output.When the simulation has finished and the output in runTRNmodel() has been prepared, the temporary folder containing the TRNSYS dck file and the log file and output file of the printer with the final value of the cost function will be deleted. When running GenOpt optimization, TRNSYS sometimes throws an error due to collisions in multiple file access during parallel computing. The MATLAB function parfeval() executes the simulations asynchronously on a parallel computing pool, but the described error also arises and cannot be avoided by the function.The simulated value of the cost function will be returned to evalMatOpt() as an input for the solver’s calculation in the next iteration step.
4. Evaluation Indicators, Solver Settings and Benchmark Results
- Generalized Pattern Search implementation of the Coordinate Search algorithm (GPS Coordinate Search).
- Hooke–Jeeves Generalized Pattern Search implementation (GPS Hooke-Jeeves).
- Hooke–Jeeves Generalized Pattern Search implementation combined with leaded Particle Swarm Optimization algorithm with Constriction Coefficient as particle update Equation (GPS-PSOCCHJ).
- Golden Section.
- Particle Swarm Optimization algorithm with Constriction Coefficient (PSO-CC).
- Particle Swarm Optimization algorithm with Constriction Coefficient restricted to Mesh (PSO-CCMesh).
- Particle Swarm Optimization algorithm with Inertia Weighting (PSO-IW).
- Find minimum of unconstrained multivariable function using derivative-free method (fminsearch).
- Find minimum of single-variable function on fixed interval (fminbnd).
- Particle Swarm Optimization (particleswarm).
- Simulated annealing algorithm (simulannealbnd).
- Pattern search algorithm (patternsearch).
- Genetic Algorithm (ga).
- Find minimum of constrained nonlinear multivariable function (fmincon).
- Find global minimum (GlobalSearch).
- Find multiple local minima (MultiStart).
5. Conclusions and Outlook
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
List of Acronyms
ANN | Artificial Neural Network |
BACS | Building Automation and Control System |
BCVTB | Building Controls Virtual Test Bed |
BES | Building Energy Systems |
BPST | Building Performance Simulaton Tool |
CFFI | C Foreign Function Interface |
COM | Component Object Model |
DLL | Dynamic Link Library |
EPBD | Energy Performance of Buildings Directive |
FIO | File Input/Output |
FMI | Functional Mock-up Interface |
FMU | Functional Mock-up Unit |
GA | Genetic Algorithms |
GEG 2023 | Building Energy Act |
GenOpt | Generic Optimization Program |
GPS | Generalized Pattern Search |
GPSCS | Generalized Pattern Search Coordinated Search |
GPS-PSOCCHJ | Generalized Pattern Search–Particle Swarm Optimization algorithm with Constriction Coefficient as particle update equation |
GUI | Grapical User Interface |
HVAC | Heating, Ventilation and Air Conditioning |
IDAICE | IDA Indoor Climate and Energy |
IEASHC | International Energy Agency Solar Heating and Cooling |
LabVIEW | Laboratory Virtual Instrumentation Engineering Workbench |
MATLAB | MATrix LABoratory |
MOPSO | MOPS]Multiobjective Particle Swarm Optimization |
MPC | Model Predictive Controller |
NSGA-II | Nondominated Sorting Genetic Algorithm 2 |
OPC UA | Open Platform Communications Unified Architecture |
PCM | Phase Change Material |
PSO | Particle Swarm Optimization |
PSO-CC | Particle Swarm Optimization algorithm with Constriction Coefficient |
PSO-CCMesh | Particle Swarm Optimization algorithm with Constriction Coefficient restricted to Mesh |
PSO-IW | Particle Swarm Optimization algorithm with Inertia Weighting |
RE | Renewable Energies |
TCP/IP | Transmission Control Protocol/Internet Protocol |
TRNSYS | TRaNsient SYstem Simulation Program |
References
- Wang, H.; Zhai, Z.J. Advances in building simulation and computational techniques: A review between 1987 and 2014. Energy Build. 2016, 128, 319–335. [Google Scholar] [CrossRef]
- Crawley, D.B.; Hand, J.W.; Kummert, M.; Griffith, B.T. Contrasting the capabilities of building energy performance simulation programs. Build. Environ. 2008, 43, 661–673. [Google Scholar] [CrossRef]
- EN 15232-1:2017; Energy Performance of Buildings—Energy Performance of Buildings—Part 1: Impact of Building Automation, Controls and Building Management—Modules M10-4,5,6,7,8,9,10. European Committee for Standardization: Brussels, Belgium, 2017.
- Federation of European Heating, Ventilation and Air Conditioning Associations (REHVA). EPB (Energy Performance of Buildings) Standards. 2024. Available online: https://www.rehva.eu/activities/epb-center-on-standardization/epb-standards-energy-performance-of-buildings-standards (accessed on 6 November 2024).
- Allegrini, J.; Orehounig, K.; Mavromatidis, G.; Ruesch, F.; Dorer, V.; Evins, R. A review of modelling approaches and tools for the simulation of district-scale energy systems. Renew. Sustain. Energy Rev. 2015, 52, 1391–1404. [Google Scholar] [CrossRef]
- Modelica Association. FMI-Functional Mock-Up Inferface—The Leading Standard to Exchange Dynamic Simulation Models. 2024. Available online: https://fmi-standard.org/ (accessed on 6 December 2024).
- Shao, X.; Ringsberg, J.W.; Johnson, E.; Li, Z.; Yao, H.D.; Skjoldhammer, J.G.; Björklund, S. An FMI-based co-simulation framework for simulations of wave energy converter systems. Energy Convers. Manag. 2025, 323, 119220. [Google Scholar] [CrossRef]
- Wolf, C.; Schleipen, M.; Frey, G. Secure Exchange of Black-Box Simulation Models using FMI in the Industrial Context. In Proceedings of the 15th International Modelica Conference 2023, Aachen, Germany, 9–11 October 2023; pp. 487–496. [Google Scholar] [CrossRef]
- Solar Energy Laboratory, University of Wisconsin. TRNSYS—A Transient System Simulation Program, Version: 17.02; Solar Energy Laboratory, University of Wisconsin: Madison, WI, USA, 2014.
- The MathWorks Inc. MATLAB, Version: 9.3 (R2017b); The MathWorks Inc.: Natick, MA, USA, 2017. Available online: https://www.mathworks.com (accessed on 9 December 2024).
- Wetter, M. GenOpt—A Generic Optimization Program. In Proceedings of the 7th International Buildings Simulation Conference, Rio de Janeiro, Brazil, 13–15 August 2001. [Google Scholar]
- Gomes, C.; Thule, C.; Broman, D.; Larsen, P.G.; Vangheluwe, H. Co-simulation: State of the art. arXiv 2017, arXiv:1702.00686. [Google Scholar] [CrossRef]
- Sagerschnig, C.; Gyalistras, D.; Seerig, A.; Prívara, S.; Cigler, J.; Vana, Z. Co-simulation for building controller development: The case study of a modern office building. In Proceedings of the International Conference–Cleantech for Sustainable Buildings. CISBAT, Lausanne, Switzerland, 14–16 September 2011; pp. 955–960. [Google Scholar]
- Engel, G.; Schweiger, G. A comparison of co-simulation interfaces between Trnsys and Simulink: A thermal engineering case study. In Proceedings of the 9th International Conference on Mathematical Modelling. MATHMOD, Vienna, Austria, 21–23 February 2018; pp. 47–48. [Google Scholar] [CrossRef]
- Trcka, M. Co-Simulation for Performance Prediction of Innovative Integrated Mechanical Energy Systems in Buildings. Ph.D. Thesis, University of Technology, Eindhoven, The Netherlands, 2008. [Google Scholar] [CrossRef]
- Widl, E. The FMI++ TRNSYS FMU Export Utility. 2022. Available online: https://github.com/fmipp/trnsys-fmu (accessed on 15 November 2024).
- Widl, E.; Müller, W. Generic FMI-compliant Simulation Tool Coupling. In Proceedings of the 12th International Modelica Conference, Prague, Czech Republic, 15–17 May 2017; pp. 321–327. [Google Scholar] [CrossRef]
- Wetter, M. A Modular Building Controls Virtual Test Bed for the Integrations of Heterogeneous Systems. Ph.D. Thesis, Lawrence Berkeley National Laboratory, Berkeley, CA, USA, Oak Ridge, TN, USA, 2008. [Google Scholar]
- Pan, Y.; Lin, X.; Huang, Z.; Sun, J.; Ahmed, O. A verification test bed for buildingcontrol strategy coupling TRNSYS with a real controller. In Proceedings of the 12th Conference of International Building Performance Simulation Association. IBPSA, Sydney, Australia, 14–16 November 2011; pp. 215–222. [Google Scholar]
- Junge, M. Simulationsgestützte Entwicklung und Optimierung Einer Energieeffizienten Produktionssteuerung. Ph.D. Thesis, Kassel University, Kassel, Germany, 2007. [Google Scholar]
- Riederer, P.; Keilholz, W.; Ducreux, V. Coupling of TRNSYS with Simulink—A method to automatically export and use TRNSYS models within Simulink and vice versa. In Proceedings of the 11th International Buildings Simulation Conference, Glasgow, UK, 27–30 July 2009. [Google Scholar]
- Al-Saadi, S.N. Modeling and Simulation of PCM-Enhanced Facade Systems. Ph.D. Thesis, University of Colorado at Boulder, Boulder, CO, USA, 2014. [Google Scholar]
- Bernier, N.; Marcotte, B.; Kummert, M. Calling Python from TRNSYS with CFFI. 2022. Available online: https://www.trnsys.de/addons (accessed on 6 November 2024).
- Institute for Solar Technology (SPF)-Eastern Switzerland University of Applied Sciences (OST). Pytrnsys: The Python TRNSYS Tool Kit. 2022. Available online: https://pytrnsys.readthedocs.io/en/latest/ (accessed on 6 November 2024).
- Solmaz, A.S. A critical review on building performance simulation tools. Alam Cipta 2019, 12, 7–21. [Google Scholar]
- Barber, K.A.; Krarti, M. A review of optimization based tools for design and control of building energy systems. Renew. Sustain. Energy Rev. 2022, 160, 112359. [Google Scholar] [CrossRef]
- Kalkan, C.; Ward, C.; Duquette, J.; Khouli, F.; Ezan, M.A. Lessons Learned From Modelling a Complex Residential Building Energy System in TRNSYS. In Proceedings of the 13th eSim Building Simulation Conference 2024. IBPSA, Edmonton, AB, Canada, 5–7 June 2024. [Google Scholar]
- Nayak, A.K.; Hagishima, A. Modification of building energy simulation tool TRNSYS for modelling nonlinear heat and moisture transfer phenomena by TRNSYS/MATLAB integration. E3S Web Conf. 2020, 172, 25009. [Google Scholar] [CrossRef]
- Mazzeo, D.; Matera, N.; Cornaro, C.; Oliveti, G.; Romagnoni, P.; De Santoli, L. EnergyPlus, IDA ICE and TRNSYS predictive simulation accuracy for building thermal behaviour evaluation by using an experimental campaign in solar test boxes with and without a PCM module. Energy Build. 2020, 212, 109812. [Google Scholar] [CrossRef]
- Magni, M.; Ochs, F.; de Vries, S.; Maccarini, A.; Sigg, F. Detailed cross comparison of building energy simulation tools results using a reference office building as a case study. Energy Build. 2021, 250, 111260. [Google Scholar] [CrossRef]
- Asadi, E.; da Silva, M.G.; Antunes, C.H.; Dias, L. A multi-objective optimization model for building retrofit strategies using TRNSYS simulations, GenOpt and MATLAB. Build. Environ. 2012, 56, 370–378. [Google Scholar] [CrossRef]
- Magnier, L.; Haghighat, F. Multiobjective optimization of building design using TRNSYS simulations, genetic algorithm, and Artificial Neural Network. Build. Environ. 2010, 45, 739–746. [Google Scholar] [CrossRef]
- Fernandes, M.; Gaspar, A.; Costa, V.; Costa, J.; Brites, G. Optimization of a thermal energy storage system provided with an adsorption module—A GenOpt application in a TRNSYS/MATLAB model. Energy Convers. Manag. 2018, 162, 90–97. [Google Scholar] [CrossRef]
- Narayanan, M.; Lima, A.F.d.; de Azevedo Dantas, A.F.O.; Commerell, W. Development of a Coupled TRNSYS-MATLAB Simulation Framework for Model Predictive Control of Integrated Electrical and Thermal Residential Renewable Energy System. Energies 2020, 13, 5761. [Google Scholar] [CrossRef]
- Mylonas, A.; Macià-Cid, J.; Péan, T.Q.; Grigoropoulos, N.; Christou, I.T.; Pascual, J.; Salom, J. Optimizing Energy Efficiency with a Cloud-Based Model Predictive Control: A Case Study of a Multi-Family Building. Energies 2024, 17, 5113. [Google Scholar] [CrossRef]
- Arenas-Larrañaga, M.; Gurruchaga, I.; Carbonell, D.; Martin-Escudero, K. Performance of solar-ice slurry systems for residential buildings in European climates. Energy Build. 2024, 307, 113965. [Google Scholar] [CrossRef]
- Meiers, J.; el Jeddab, A.; Theis, D.; Jonas, D.; Frey, G.; Deissenroth-Uhrig, M. Hardware-in-the-loop integration of PVT models using Internet of Things-enabled communication. In Proceedings of the ISES and IEA SHC International Conference on Solar Energy for Buildings and Industry, Eurosun, Kassel, Germany, 25–29 September 2022. [Google Scholar] [CrossRef]
- National Instruments Corp. LabVIEW—Laboratory Virtual Instrumentation Engineering Workbench; National Instruments Corp.: Austin, TX, USA, 2018. [Google Scholar]
- Tadayon, L.; Meiers, J.; Jonas, D.; Frey, G. Design of a building energy system using model-based multi-objective optimization. In Proceedings of the PESS 2023, Power and Energy Student Summit, Bielefeld, Germany, 15–17 November 2023; pp. 49–55. [Google Scholar]
System Parameters | Values |
---|---|
Processor | i5-3320M |
Total cores | 2 |
Processor clock rate (GHz) | 2.6 |
RAM (GB) | 16 |
Type of hard drive | SSD |
Operating system | Windows 10 Pro |
Architecture | x64 |
Solver Parameters | Values |
---|---|
Lower boundary | 0 |
Upper boundary | 5000 |
Initial start point | 2500 |
Maximum iteration steps | 500 |
Solver Parameters | Solver/Values | ||||
---|---|---|---|---|---|
GPS Coordinate Search/ GPS Hooke–Jeeves | GPS-PSOCCHJ | PSO-CC | PSO-CCMesh | PSO-IW | |
NeighborhoodTopology | - | gbest | gbest | gbest | gbest |
NeighborhoodSize | - | 1 | 1 | 1 | 1 |
NumberOfParticle | - | 5 | 5 | 5 | 5 |
NumberOfGeneration | - | 40 | 40 | 40 | 40 |
Seed | - | 0 | 0 | 0 | 0 |
CognitiveAcceleration | - | 0.5 | 0.5 | 0.5 | 0.5 |
SocialAcceleration | - | 0.5 | 0.5 | 0.5 | 0.5 |
MaxVelocityDiscrete | - | 0.5 | 0.5 | 0.5 | 0.5 |
ConstrictionGain | - | 0.5 | 0.5 | 0.5 | 0.5 |
MeshSizeDivider | 2 | 2 | - | 2 | - |
InitialMeshSizeExponent | 0 | 0 | - | 0 | - |
MeshSizeExponent Increment | 1 | 1 | - | - | - |
NumberOfStepReduction | 4 | 4 | - | - | - |
InitialInertiaWeight | - | - | - | - | 0.5 |
FinalInertiaWeight | - | - | - | - | 0.5 |
Max Equal Results | 5 | 5 | 5 | 5 | 5 |
Solver Parameters | Solver/Values | ||||||||
---|---|---|---|---|---|---|---|---|---|
fminsearch | fminbnd | particleswarm | simulannealbnd | patternsearch | ga | fmincon | GlobalSearch | MultiStart | |
Display | iter | iter | iter | iter | iter | iter | iter | iter | iter |
TolFun | - | - | - | - | - | - | |||
TolX | - | - | - | - | - | - | |||
FunValCheck | off | off | - | - | - | - | - | - | - |
MaxFunEvals | 500 | - | - | - | - | - | - | - | - |
OutputFcn | @fun | @fun | @fun | @fun | @fun | @fun | @fun | @fun | @fun |
OutputFcn | fun | fun | fun | fun | fun | fun | fun | fun | fun |
PlotFcns | (1)–(3) | (1)–(3) | (4) | (5)–(10) | (11)–(14) | (15)–(19) | (1)–(3), (20)–(21) | (22)–(23) | (24)–(25) |
setParallel | - | - | false | - | false | false | false | false | false |
HybridFcn | - | - | - | - | - | - | - | - | - |
ObjectiveLimit | - | - | - | - | - | - | - | - | |
MaxIterations/MaxIter | 500 | 500 | 500 | 500 | 500 | 500 | 500 | - | - |
SearchFcn | - | - | - | - | (a) | - | - | - | - |
StepTolerance | - | - | - | - | - | - | - | ||
FunctionTolerance | - | - | - | - | - | - | - | ||
Algorithm | - | - | - | - | - | - | sqp | sqp | sqp |
FiniteDifferenceStepSize | - | - | - | - | - | - | |||
FiniteDifferenceType | - | - | - | - | - | center | center | center | - |
ConstraintTolerance | - | - | - | - | - | - | |||
StartPointsToRun | - | - | - | - | - | - | - | bounds | bounds |
XTolerance | - | - | - | - | - | - | - | ||
NumTrialPoints | - | - | - | - | - | - | - | 10 | - |
NumStageOnePoints | - | - | - | - | - | - | - | 10 | - |
NumberOfStartPoints | - | - | - | - | - | - | - | - | 30 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Meiers, J.; Frey, G. Interfacing TRNSYS with MATLAB for Building Energy System Optimization. Energies 2025, 18, 255. https://doi.org/10.3390/en18020255
Meiers J, Frey G. Interfacing TRNSYS with MATLAB for Building Energy System Optimization. Energies. 2025; 18(2):255. https://doi.org/10.3390/en18020255
Chicago/Turabian StyleMeiers, Josef, and Georg Frey. 2025. "Interfacing TRNSYS with MATLAB for Building Energy System Optimization" Energies 18, no. 2: 255. https://doi.org/10.3390/en18020255
APA StyleMeiers, J., & Frey, G. (2025). Interfacing TRNSYS with MATLAB for Building Energy System Optimization. Energies, 18(2), 255. https://doi.org/10.3390/en18020255