Opened 5 years ago
Last modified 3 years ago
#5853 assigned defect
-d=-disableDirectionalDerivatives Fails
Reported by: | Owned by: | Andreas Heuermann | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | FMI | Version: | v1.16.0-dev |
Keywords: | Simulation Flags | Cc: | Lennart Ochel |
Description
Hello,
i want to enable the directional derivates in generated FMU.
To do so, I set under tools -> options -> Simulation the flag
-d=-disableDirectionalDerivatives
Saving and generating the FMU via Data - Export - FMU gives me an FMU file.
Opening it in Python (PyFMI) returns the Error:
FMUException: This FMU does not provide directional derivatives
Watching the flags shows following result:
model = load_fmu('simuflag.fmu')
model.get_capability_flags()
Out[44]:
{'needsExecutionTool': False,
'completedIntegratorStepNotNeeded': False,
'canBeInstantiatedOnlyOncePerProcess': False,
'canNotUseMemoryManagementFunctions': False,
'canGetAndSetFMUstate': False,
'canSerializeFMUstate': False,
'providesDirectionalDerivatives': False,
'completedEventIterationIsProvided': True}
Why is this flag still set as false?
Any bug, or mishandling by myself?
Best regards
Henrik
Attachments (1)
Change History (15)
by , 5 years ago
comment:1 by , 5 years ago
Component: | OMEdit → FMI |
---|---|
Milestone: | Future → 1.16.0 |
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 5 years ago
Running the file vial terminal with:
C:\Programme\OpenModelica1.16.0-dev-64bit\bin>omc -d=-disableDirectionalDerivatives fmu.mos
gave me the same result, directional derivatives still not provided.
The fmu.mos looks the following:
loadModel(Modelica);
loadFile("C:\Users\user\folder\grid.mo");
translateModelFMU(grid.network);
getErrorString();
comment:3 by , 5 years ago
Cc: | added |
---|
comment:4 by , 5 years ago
Status: | assigned → accepted |
---|
I think this feature is right now available only with the cpp runtime.
comment:5 by , 5 years ago
Minimal working example:
loadModel(Modelica); getErrorString(); setCommandLineOptions("-d=newInst,-disableDirectionalDerivatives "); getErrorString(); translateModelFMU(Modelica.Electrical.Analog.Examples.CauerLowPassAnalog); getErrorString();
I get a modelDescription.xml with
... <ModelExchange modelIdentifier="Modelica_Electrical_Analog_Examples_CauerLowPassAnalog" providesDirectionalDerivative="true"> <SourceFiles> ...
comment:6 by , 5 years ago
I don't have PyFMI installed, so I can't check what it's saying to this fmu.
comment:7 by , 5 years ago
I wrote those lines in the fmu.mos and called it with the following command in the terminal
C:\Programme\OpenModelica1.16.0-dev-64bit\bin>omc fmu.mos
true
""
true
""
"C:/Programme/OpenModelica1.16.0-dev-64bit/bin/grid.network.fmu"
"Notification: Automatically loaded package grid default due to uses annotation.
My modelDescriptions looks the following:
... numberOfEventIndicators="0"> <ModelExchange modelIdentifier="grid_network"> <SourceFiles> <File name="grid_network.c" /> ...
No Information about any flags regarding the directional derivatives.
comment:8 by , 5 years ago
With your model, it works. But i can´t set this flag in my grid model.
Could you please take a look, why it is not working with my file? I´ll attach it here.
Would be awesome if it works :-)
Best regards
Henrik
comment:10 by , 5 years ago
Seems to be an error with your model. You are initializing the parameters wrong.
Try parameter Integer myParameter = 42;
But in any case we should produce an error when providesDirectionalDerivatives
can't be generated but was requested by the user (like for C).
I will look into it tomorrow and see if I can use the Cpp solution for C as well.
comment:11 by , 5 years ago
Cc: | added; removed |
---|---|
Owner: | changed from | to
Status: | accepted → assigned |
comment:13 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
The Model "network" should be exported as an FMU with enabled directional derivates