Opened 10 years ago
Closed 7 years ago
#2764 closed defect (fixed)
ModelStructure with wrong dependencies for states and without dependencies for outputs
Reported by: | Owned by: | Willi Braun | |
---|---|---|---|
Priority: | high | Milestone: | 1.13.0 |
Component: | FMI | Version: | trunk |
Keywords: | Cc: |
Description
Using the current nightly build 1.9.1+dev (r21649), the following model
within ; model DIC "Double Integrator Continuous-time" parameter Real p = 1 "gain for input"; parameter Real y1_start = 1 "start value for first state"; parameter Real y2_start = 0 "start value for second state"; input Real u(start = -2); output Real y1, y2; initial equation y1 = y1_start; y2 = y2_start; equation der(y1) = p*u; der(y2) = y1; end DIC;
can be exported as FMU 2.0 with the omc commands:
loadFile("DIC.mo"); translateModelFMU(DIC, version="2.0");
The file modelDescription.xml contains the following ModelStructure:
<ModelStructure> <Outputs> <Unknown index="1" dependenciesKind="fixed" /> <Unknown index="2" dependenciesKind="fixed" /> </Outputs> <Derivatives> <Unknown index="3" dependencies="1" dependenciesKind="fixed" /> <Unknown index="4" dependencies="2" dependenciesKind="fixed" /> </Derivatives> <InitialUnknowns> </InitialUnknowns> </ModelStructure>
The Outputs section lists dependeciesKind, but is lacking the dependencies (indices). The Derivatives section states wrong dependencies. The expected ModelStructure is:
\partial y / \partial x
\partial y / \partial u
\partial der(x) / \partial x
\partial der(x) / \partial u
<ModelStructure> <Outputs> <Unknown index="1" dependencies="1" dependenciesKind="fixed" /> <Unknown index="2" dependencies="2" dependenciesKind="fixed" /> </Outputs> <Derivatives> <Unknown index="3" dependencies="5" dependenciesKind="fixed" /> <Unknown index="4" dependencies="1" dependenciesKind="fixed" /> </Derivatives> <InitialUnknowns> </InitialUnknowns> </ModelStructure>
Change History (17)
comment:1 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
Status: | assigned → accepted |
---|
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
follow-up: 7 comment:4 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Now the Derivatives section looks good for the given example! The Outputs section still is wrong though:
<ModelStructure> <Outputs> <Unknown index="1" dependencies="5" dependenciesKind="dependent" /> <Unknown index="2" dependencies="1" dependenciesKind="dependent" /> </Outputs> <Derivatives> <Unknown index="3" dependencies="5" dependenciesKind="dependent" /> <Unknown index="4" dependencies="1" dependenciesKind="dependent" /> </Derivatives> <InitialUnknowns> </InitialUnknowns> </ModelStructure>
Note: the Outputs section looks good if additional variables are introduced for states, so that state variables differ from outputs.
comment:5 by , 10 years ago
This would mean I need to ignore the output declaration in the model, is this desired?
Since I really haven't found any specification text that a variable can't be a state and a output
at the same time.
comment:6 by , 10 years ago
A variable can generally be state and output. See also Modelica.Blocks.Continuous.Integrator
. I had discussed this in the FMI group and was told that FMI has intentionally be defined in a way supporting such models. Such outputs depend on themselves, i.e. output with index 1 depends on state with index 1 and output with index 2 depends on state with index 2.
comment:7 by , 10 years ago
Doh, you are of course right the output section is wrong. Somehow I mixed there somewhere states and states derivatives. I check that.
Replying to rfranke:
Note: the Outputs section looks good if additional variables are introduced for states, so that state variables differ from outputs.
Now, I also get the idea of that comment.
comment:8 by , 10 years ago
Status: | reopened → accepted |
---|
comment:9 by , 10 years ago
comment:10 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:11 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:16 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:17 by , 7 years ago
Milestone: | 1.12.0 → 1.13.0 |
---|---|
Resolution: | → fixed |
Status: | accepted → closed |
Fixed in OMCompiler/bba43625.
fixed in r22294.