Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
4

Run EnergyPlus in Matlab

asked 2017-11-07 03:31:53 -0500

Gio's avatar

updated 2017-11-28 21:56:37 -0500

yongqingzhao's avatar

I'm trying to run EnergyPlus in Matlab. I found mle+ but I could only find guides for the GUI.

Since I have to run many simulations with data previously calculated in a Matlab script, it could be easier to run E+ directly inside a loop statement.

I found out how to do in python (https://unmethours.com/question/22157...) but I couldn't find it in Matlab.

Thank you!

edit retag flag offensive close merge delete

Comments

2

Do you want to run E+ and Matlab synchronous that mean at each timestep EnergyPlus exchange data with Matlab mutually? Or, you want to call E+ in Matlab?

TianZhichao's avatar TianZhichao  ( 2017-11-07 05:33:25 -0500 )edit
1

For now, I just need to call E+ in Matlab. Could you make an example typing the code?

What if I want to exchange data?

Gio's avatar Gio  ( 2017-11-07 06:19:51 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2017-11-07 19:02:27 -0500

yongqingzhao's avatar

updated 2017-11-23 22:40:36 -0500

You can use system or dos function to call RunEPlus.bat located in EnergyPlus directory. There are two ways rnning energyplus:

1. Runging RunEPlus.bat batch file

For example:
dos('D:\Your_EnergyPlus_installation_folder\RunEPlus.bat in(idf file name without idf extension) in(weather file without epw extension)')

system('D:\Your_EnergyPlus_installation_folder\RunEPlus.bat in(idf file name without idf extension) in(weather file without epw extension)')

2. Runing energyplus.exe

For example:

 system('C:\YOUR_ENERGYPLUS_INSTALLATION_FOLDER\EnergyPlus.exe -w weather_file.epw idf_file.idf')

where -w represents the weather file option. Without "-w" you only get a sizing run. Here are more details (https://github.com/NREL/EnergyPlus/bl...)

edit flag offensive delete link more

Comments

Hi, thanks for your answer but it's not working. I was successful typing this: system('C:\YOUR_ENERGYPLUS_INSTALLATION_FOLDER\EnergyPlus.exe -w weather_file.epw idf_file.idf') In my case: system('C:\EnergyPlusV8-5-0\EnergyPlus.exe -w SanFrancisco.epw Building1.idf')

where -w represents the weather file option. Without "-w" you only get a sizing run. Here are more details (https://github.com/NREL/EnergyPlus/bl...) Please change your answer.

Gio's avatar Gio  ( 2017-11-08 05:31:26 -0500 )edit
2

Running RunEPlus.bat can also work,my previous answer can not work may be bcause the file path of RunEPlus.bat is error and weather file name includes file extension!

yongqingzhao's avatar yongqingzhao  ( 2017-11-08 06:51:14 -0500 )edit

Perfect, thank you very much!

Gio's avatar Gio  ( 2017-11-09 03:35:35 -0500 )edit

Hi, I have the same problem. The running enegyplus.exe in Matlab works for me. However, instead of pushing the simulate button, I need it to be done automatically. Could you please tell me if you know how to make that run automatically?

yasamandadras's avatar yasamandadras  ( 2021-11-03 12:43:16 -0500 )edit

Sorry I can't help, I solved using python

Gio's avatar Gio  ( 2022-02-21 02:48:13 -0500 )edit
0

answered 2019-12-26 13:45:38 -0500

You can also use this Matlab toolbox https://uk.mathworks.com/matlabcentra...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

2 followers

Stats

Asked: 2017-11-07 03:31:53 -0500

Seen: 1,611 times

Last updated: Nov 28 '17