Changes between Initial Version and Version 1 of Ticket #2667


Ignore:
Timestamp:
2014-04-16T06:35:35Z (11 years ago)
Author:
Martin Sjölund
Comment:

The funny thing is:

  1. We satisfy static_stock(time=0) = 1000
  2. We satisfy der(static_stock) = 0

There is an odd discrete jump at time=0 from 1000 down to 0 though...

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2667

    • Property Cc Lennart Ochel added
    • Property Component BackendRun-time
    • Property Owner changed from probably noone to Willi Braun
    • Property Priority normalcritical
    • Property Reporter changed from tmtuomas to Francesco Casella
    • Property Status newassigned
    • Property Summary Integration with a non-zero initial value plummets at the beginning of the simulationConditional connectors not handled by OMEdit
  • Ticket #2667 – Description

    initial v1  
    1 There's a problem simulating a model which has variables with if then else, ramping values, and integration with initial value != 0. The model attached. The problem is that the value of a variable which integrates zero and has the initial value of != 0, e.g., start=1000 plummets at the beginning of the simulation. When I run the model in OpenModelica-1.9.0-revision-17628, I get correctly:
     1Since cardinality was deprecated a few years ago, conditional connectors have been used extensively, in particular in the MSL.
    22
    3 C:\Data\Desktop\omc190test>C:\OpenModelica1.9.0\bin\omc Model.mos
    4 true
    5 {"C:/Data/Desktop/omc190test/Model","Model_init.xml"}
    6 
    7 C:\Data\Desktop\omc190test>Model.exe -output=static_stock
    8 time=10,static_stock=1000
    9 
    10 However, when I run the latest nightly (OpenModelica-revision-20160), I get:
    11 
    12 C:\Data\Desktop\omc191test>C:\OpenModelica1.9.1Nightly\bin\omc Model.mos
    13 true
    14 {"C:/Data/Desktop/omc191test/Model","Model_init.xml"}
    15 
    16 C:\Data\Desktop\omc191test>Model.exe -output=static_stock
    17 time=10,static_stock=2.9802322387695313e-005
    18 
    19 
    20 
    21 Model.mo:
    22 
    23 model Model
    24     Real ramp(start=0, fixed=true);
    25     Real out;
    26     Real static_stock(start=1000, fixed=true);
    27 equation
    28     der(ramp) = 1;
    29     out = if ramp > 0 then ramp else 0;
    30     der(static_stock) = 0;
    31 end Model;
    32 
    33 
    34 
    35 Model.mos:
    36 
    37 loadFile("Model.mo");
    38 buildModel(Model,startTime=0.0,stopTime=10.0,method="euler",outputFormat="mat",cflags="-O0",variableFilter=".*");
    39 
     3Currently OMEdit always display conditional connectors even when they are switched off, which might be a bit confusing for the user. It would be nice (and probably not too hard to implement in MetaModelica) if we only drew conditional connectors when they are active.