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

Revision history [back]

click to hide/show revision 1
initial version

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it. What I did so far: - Made a model in SketchUp & OpenStudio (simulation + outputs worked) - took the in.idf file and edited in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate: filename = "..path/to/fmu.fmu" result = simulate_fmu(filename)

[ERROR] fmi2Instantiate: Failed to parse the model description

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed. Thx in advance!! Burns

(I cannot attach files so far, try it later again)

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it. What I did so far: - Made a model in SketchUp & OpenStudio (simulation + outputs worked) - took the in.idf file and edited in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate: filename = "..path/to/fmu.fmu" result = simulate_fmu(filename)

[ERROR] fmi2Instantiate: Failed to parse the model description

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed. Thx in advance!! Burns

(I cannot attach files so far, try it later again)

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it. What I did so far: - Made a model in SketchUp & OpenStudio (simulation + outputs worked) - took the in.idf file and edited in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate: simulate:

from fmpy import *

filename = "..path/to/fmu.fmu" result = simulate_fmu(filename)

[ERROR] fmi2Instantiate: Failed to parse the model description

and the ModelDescribtion.xml part:

<modelvariables> <scalarvariable name="Q" valuereference="1" variability="continuous" causality="input" description="IDF line 10719"> <real start="0"/> </scalarvariable> <scalarvariable name="TRooMea" valuereference="100001" variability="continuous" causality="output" description="IDF line 10711"> <real/> </scalarvariable> </modelvariables> <modelstructure> <outputs> <unknown index="2"/> </outputs> </modelstructure>

idf file snippet about external interface:

!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE ===========

ExternalInterface, FunctionalMockupUnitExport; !- Name of External Interface

! --------- ExternalInterface, ! --------- FunctionalMockupUnitImport; !- Name of External Interface

!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT ===========

ExternalInterface:FunctionalMockupUnitImport, MeanAir.fmu, !- FMU File Name 0, !- FMU Timeout {ms} 0; !- FMU LoggingOn

!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitImport:From:Variable, THERMAL ZONE 1, !- Output:Variable Index Key Name Zone Mean Air Temperature , !- Output:Variable Name MeanAir.fmu, !- FMU File Name Model_AC40, !- FMU Instance Name TMeanAir; !- FMU Variable Name

!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitImport:To:Schedule, FMU_OthEquSen_Zone1, !- Name Thermal Zone 1 Thermostat Schedule Type Limits, !- Schedule Type Limits Names MeanAir.fmu, !- FMU File Name Model_AC40, !- FMU Instance Name QSensible, !- FMU Variable Name 0; !- Initial Value

!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitExport:From:Variable, THERMAL ZONE 1, !- Output:Variable Index Key Name Zone Mean Air Temperature, !- Output:Variable Name TRooMea; !- FMU Variable Name

!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitExport:To:Schedule, FMU_OthEquSen_Zone1, !- Schedule Name Thermal Zone 1 Thermostat Schedule Type Limits, !- Schedule Type Limits Names Q, !- FMU Variable Name 0; !- Initial Value

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed. Thx in advance!! Burns

(I cannot attach files so far, try it later again)

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it. What I did so far: - Made a model in SketchUp & OpenStudio (simulation + outputs worked) - took the in.idf file and edited in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate:

 from fmpy import *

* filename = "..path/to/fmu.fmu" result = simulate_fmu(filename)

simulate_fmu(filename) [ERROR] fmi2Instantiate: Failed to parse the model description

description

and the ModelDescribtion.xml part:

<modelvariables> <scalarvariable

<ModelVariables>
<!-- Note valueReferences are (1, 2, 3...) for causality="input" (to E+). -->
<!-- Note valueReferences are (100001, 100002, 100003...) for "output" (from E+). -->
<!-- Note the order of valueReferences should match the order of elements in file 'variables.cfg'. -->
<!-- Index for next variable is '1'. -->
<ScalarVariable  name="Q" valuereference="1"  valueReference="1"
  variability="continuous" causality="input"  causality="input"
  description="IDF line 10719">
      <real <Real  start="0"/>
    </scalarvariable>
    
    <scalarvariable </ScalarVariable>
<!-- Index for next variable is '2'. -->
<ScalarVariable  name="TRooMea" valuereference="100001"  valueReference="100001"
  variability="continuous" causality="output"  causality="output"
  description="IDF line 10711">
      <real/>
    </scalarvariable>
  </modelvariables>
  
  <modelstructure>
    
    <outputs>
         <unknown <Real/>
</ScalarVariable>
</ModelVariables>
<!-- ModelStructure details for co-simulation. -->
<ModelStructure>
<!-- Outputs variables of the FMU. -->
<Outputs>
     <Unknown  index="2"/> 
    </outputs>
  </modelstructure>

</Outputs> </ModelStructure>

idf file snippet about external interface:

!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE ===========

=========== ExternalInterface, FunctionalMockupUnitExport; !- Name of External Interface

Interface ! --------- ExternalInterface, ! --------- FunctionalMockupUnitImport; !- Name of External Interface

Interface !- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT ===========

=========== ExternalInterface:FunctionalMockupUnitImport, MeanAir.fmu, !- FMU File Name 0, !- FMU Timeout {ms} 0; !- FMU LoggingOn

LoggingOn !- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE ===========

=========== ExternalInterface:FunctionalMockupUnitImport:From:Variable, THERMAL ZONE 1, !- Output:Variable Index Key Name Zone Mean Air Temperature , !- Output:Variable Name MeanAir.fmu, !- FMU File Name Model_AC40, !- FMU Instance Name TMeanAir; !- FMU Variable Name

Name !- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:TO:SCHEDULE ===========

=========== ExternalInterface:FunctionalMockupUnitImport:To:Schedule, FMU_OthEquSen_Zone1, !- Name Thermal Zone 1 Thermostat Schedule Type Limits, !- Schedule Type Limits Names MeanAir.fmu, !- FMU File Name Model_AC40, !- FMU Instance Name QSensible, !- FMU Variable Name 0; !- Initial Value

Value !- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE ===========

=========== ExternalInterface:FunctionalMockupUnitExport:From:Variable, THERMAL ZONE 1, !- Output:Variable Index Key Name Zone Mean Air Temperature, !- Output:Variable Name TRooMea; !- FMU Variable Name

Name !- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE ===========

=========== ExternalInterface:FunctionalMockupUnitExport:To:Schedule, FMU_OthEquSen_Zone1, !- Schedule Name Thermal Zone 1 Thermostat Schedule Type Limits, !- Schedule Type Limits Names Q, !- FMU Variable Name 0; !- Initial Value

Value

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed. Thx in advance!! Burns

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it. What I did so far: -

  • Made a model in SketchUp & OpenStudio (simulation + outputs worked) - worked)
  • took the in.idf file and edited in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate:

from fmpy import *

filename = "..path/to/fmu.fmu"
result = simulate_fmu(filename)

[ERROR] fmi2Instantiate: Failed to parse the model description

and the ModelDescribtion.xml part:

<ModelVariables>
<!-- Note valueReferences are (1, 2, 3...) for causality="input" (to E+). -->
<!-- Note valueReferences are (100001, 100002, 100003...) for "output" (from E+). -->
<!-- Note the order of valueReferences should match the order of elements in file 'variables.cfg'. -->
<!-- Index for next variable is '1'. -->
<ScalarVariable  name="Q"  valueReference="1"
  variability="continuous"  causality="input"
  description="IDF line 10719">
  <Real  start="0"/>
</ScalarVariable>
<!-- Index for next variable is '2'. -->
<ScalarVariable  name="TRooMea"  valueReference="100001"
  variability="continuous"  causality="output"
  description="IDF line 10711">
  <Real/>
</ScalarVariable>
</ModelVariables>
<!-- ModelStructure details for co-simulation. -->
<ModelStructure>
<!-- Outputs variables of the FMU. -->
<Outputs>
     <Unknown  index="2"/> 
</Outputs>
</ModelStructure>

idf file snippet about external interface:

!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE ===========

ExternalInterface,
  FunctionalMockupUnitExport;  !- Name of External Interface

! --------- ExternalInterface,
! ---------     FunctionalMockupUnitImport;  !- Name of External Interface


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT ===========

ExternalInterface:FunctionalMockupUnitImport,
  MeanAir.fmu,             !- FMU File Name
  0,                       !- FMU Timeout {ms}
  0;                       !- FMU LoggingOn


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitImport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature ,  !- Output:Variable Name
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  TMeanAir;                !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitImport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  QSensible,               !- FMU Variable Name
  0;                       !- Initial Value


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitExport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature,  !- Output:Variable Name
  TRooMea;                 !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitExport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Schedule Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  Q,                       !- FMU Variable Name
  0;                       !- Initial Value

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed. Thx in advance!! Burns

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it.

My first goal is to have the possibility to set the AirCondition Setpoints from Python, simulate it in E+ and have the IndoorMeanAirTemperature and the AC Energy Usage plotted (or similar).

What I did so far:

  • Made a model in SketchUp & OpenStudio (simulation + outputs worked)
  • took the in.idf file and edited it in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html
  • Converted the .idf with EnergyPlusToFMU.py to an .fmu (worked, or at least completed without errors)

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate:

from fmpy import *

filename = "..path/to/fmu.fmu"
result = simulate_fmu(filename)

[ERROR] fmi2Instantiate: Failed to parse the model description

and the ModelDescribtion.xml part:

<ModelVariables>
<!-- Note valueReferences are (1, 2, 3...) for causality="input" (to E+). -->
<!-- Note valueReferences are (100001, 100002, 100003...) for "output" (from E+). -->
<!-- Note the order of valueReferences should match the order of elements in file 'variables.cfg'. -->
<!-- Index for next variable is '1'. -->
<ScalarVariable  name="Q"  valueReference="1"
  variability="continuous"  causality="input"
  description="IDF line 10719">
  <Real  start="0"/>
</ScalarVariable>
<!-- Index for next variable is '2'. -->
<ScalarVariable  name="TRooMea"  valueReference="100001"
  variability="continuous"  causality="output"
  description="IDF line 10711">
  <Real/>
</ScalarVariable>
</ModelVariables>
<!-- ModelStructure details for co-simulation. -->
<ModelStructure>
<!-- Outputs variables of the FMU. -->
<Outputs>
     <Unknown  index="2"/> 
</Outputs>
</ModelStructure>

idf file snippet about external interface:

!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE ===========

ExternalInterface,
  FunctionalMockupUnitExport;  !- Name of External Interface

! --------- ExternalInterface,
! ---------     FunctionalMockupUnitImport;  !- Name of External Interface


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT ===========

ExternalInterface:FunctionalMockupUnitImport,
  MeanAir.fmu,             !- FMU File Name
  0,                       !- FMU Timeout {ms}
  0;                       !- FMU LoggingOn


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitImport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature ,  !- Output:Variable Name
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  TMeanAir;                !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitImport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  QSensible,               !- FMU Variable Name
  0;                       !- Initial Value


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitExport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature,  !- Output:Variable Name
  TRooMea;                 !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitExport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Schedule Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  Q,                       !- FMU Variable Name
  0;                       !- Initial Value

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed. changed.

Thx in advance!! Burns

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it.

My first goal is to have the possibility to set the AirCondition Setpoints from Python, simulate it in E+ and have the IndoorMeanAirTemperature and the AC Energy Usage plotted (or similar).

What I did so far:

  • Made a model in SketchUp & OpenStudio (simulation + outputs worked)
  • took the in.idf file and edited it in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html
  • Converted the .idf with EnergyPlusToFMU.py to an .fmu (worked, or at least completed without errors)

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate:

from fmpy import *

filename = "..path/to/fmu.fmu"
result = simulate_fmu(filename)

[ERROR] fmi2Instantiate: Failed to parse the model description

and the ModelDescribtion.xml part:

<ModelVariables>
<!-- Note valueReferences are (1, 2, 3...) for causality="input" (to E+). -->
<!-- Note valueReferences are (100001, 100002, 100003...) for "output" (from E+). -->
<!-- Note the order of valueReferences should match the order of elements in file 'variables.cfg'. -->
<!-- Index for next variable is '1'. -->
<ScalarVariable  name="Q"  valueReference="1"
  variability="continuous"  causality="input"
  description="IDF line 10719">
  <Real  start="0"/>
</ScalarVariable>
<!-- Index for next variable is '2'. -->
<ScalarVariable  name="TRooMea"  valueReference="100001"
  variability="continuous"  causality="output"
  description="IDF line 10711">
  <Real/>
</ScalarVariable>
</ModelVariables>
<!-- ModelStructure details for co-simulation. -->
<ModelStructure>
<!-- Outputs variables of the FMU. -->
<Outputs>
     <Unknown  index="2"/> 
</Outputs>
</ModelStructure>

idf file snippet about external interface:

!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE ===========

ExternalInterface,
  FunctionalMockupUnitExport;  !- Name of External Interface

! --------- ExternalInterface,
! ---------     FunctionalMockupUnitImport;  !- Name of External Interface


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT ===========

ExternalInterface:FunctionalMockupUnitImport,
  MeanAir.fmu,             !- FMU File Name
  0,                       !- FMU Timeout {ms}
  0;                       !- FMU LoggingOn


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitImport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature ,  !- Output:Variable Name
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  TMeanAir;                !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitImport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  QSensible,               !- FMU Variable Name
  0;                       !- Initial Value


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitExport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature,  !- Output:Variable Name
  TRooMea;                 !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitExport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Schedule Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  Q,                       !- FMU Variable Name
  0;                       !- Initial Value

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed.

Thx in advance!! Burns

FMU file simulation failed with FMPy

Dear all,

I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it.

My first goal is to have the possibility to set the AirCondition Setpoints from Python, simulate it in E+ and have the IndoorMeanAirTemperature and the AC Energy Usage plotted (or similar).

What I did so far:

  • Made a model in SketchUp & OpenStudio (simulation + outputs worked)
  • took the in.idf file and edited it in IDF Editor. Added External Interface Import, Export, following this Tutorial: https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html
  • Converted the .idf with EnergyPlusToFMU.py to an .fmu (worked, or at least completed without errors)

The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".

Currently I am facing the error, when trying to simulate:

from fmpy import *

filename = "..path/to/fmu.fmu"
result = simulate_fmu(filename)

[ERROR] fmi2Instantiate: Failed to parse the model description

and the ModelDescribtion.xml part:

<ModelVariables>
<!-- Note valueReferences are (1, 2, 3...) for causality="input" (to E+). -->
<!-- Note valueReferences are (100001, 100002, 100003...) for "output" (from E+). -->
<!-- Note the order of valueReferences should match the order of elements in file 'variables.cfg'. -->
<!-- Index for next variable is '1'. -->
<ScalarVariable  name="Q"  valueReference="1"
  variability="continuous"  causality="input"
  description="IDF line 10719">
  <Real  start="0"/>
</ScalarVariable>
<!-- Index for next variable is '2'. -->
<ScalarVariable  name="TRooMea"  valueReference="100001"
  variability="continuous"  causality="output"
  description="IDF line 10711">
  <Real/>
</ScalarVariable>
</ModelVariables>
<!-- ModelStructure details for co-simulation. -->
<ModelStructure>
<!-- Outputs variables of the FMU. -->
<Outputs>
     <Unknown  index="2"/> 
</Outputs>
</ModelStructure>

idf file snippet about external interface:

!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE ===========

ExternalInterface,
  FunctionalMockupUnitExport;  !- Name of External Interface

! --------- ExternalInterface,
! ---------     FunctionalMockupUnitImport;  !- Name of External Interface


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT ===========

ExternalInterface:FunctionalMockupUnitImport,
  MeanAir.fmu,             !- FMU File Name
  0,                       !- FMU Timeout {ms}
  0;                       !- FMU LoggingOn


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitImport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature ,  !- Output:Variable Name
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  TMeanAir;                !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitImport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  MeanAir.fmu,             !- FMU File Name
  Model_AC40,              !- FMU Instance Name
  QSensible,               !- FMU Variable Name
  0;                       !- Initial Value


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE ===========

ExternalInterface:FunctionalMockupUnitExport:From:Variable,
  THERMAL ZONE 1,          !- Output:Variable Index Key Name
  Zone Mean Air Temperature,  !- Output:Variable Name
  TRooMea;                 !- FMU Variable Name


!-   ===========  ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE ===========

ExternalInterface:FunctionalMockupUnitExport:To:Schedule,
  FMU_OthEquSen_Zone1,     !- Schedule Name
  Thermal Zone 1 Thermostat Schedule Type Limits,  !- Schedule Type Limits Names
  Q,                       !- FMU Variable Name
  0;                       !- Initial Value

I would highly appreciate if you can check my files and tell me whats wrong and has to be changed.

Thx in advance!! Burns