Local varaibles in Energyplus EMS

asked 2024-09-03 10:58:44 -0500

AvgStudent's avatar

updated 2024-09-03 14:31:57 -0500

Hi,

I am using local variables within an EMS program for an Openstudio measure to store intermediate results. However, when running the simulation, a fatal error occurs and the .ERR file reads:

Error: EvaluateExpression: Variable = 'MAX_PWR_INCREASE' used in expression has not been initialized!.

However, a value is attributed to the local variable and I thought local variables did not need to be initialized. The following code snippet shows the definition of the local variables and the line at which the program crashes (last line with the @MIN function):

SET previous_timestep_avail_pwr = #{maximum_building_power.name} - #{building_power_dmd.name}
IF @TrendValue #{ets_power_trend.name} 1 > 0
  SET max_pwr_increase = 0.5 * @TrendValue #{ets_power_trend.name} 1
ELSE
  SET max_pwr_increase = 0.5 * #{maximum_building_power.name}
ENDIF
SET #{available_charging_power.name} =@MIN previous_timestep_avail_pwr max_pwr_increase

Thanks.

edit retag flag offensive close merge delete

Comments

Can you attach your full IDF via e.g. Google Drive or Dropbox?

shorowit's avatar shorowit  ( 2024-09-04 08:47:56 -0500 )edit

Due to the nature of the project, I cannot share the whole IDF. However, the code for the measure along with a snippet from the IDF where the measure is located are available in this Dropbox link.

AvgStudent's avatar AvgStudent  ( 2024-09-04 10:30:47 -0500 )edit