Opened 12 years ago

Last modified 7 years ago

#1869 new enhancement

detect completely constant parts

Reported by: Willi Braun Owned by: Willi Braun
Priority: normal Milestone: Future
Component: Backend Version: trunk
Keywords: Cc:

Description

We evaluate completely constant parts again an again, this should be avoided by detecting part that are independent on time, states or events. In particular we should avoid that for bigger non-linear loops. For example the non-linear loop below will solved 10000!

model M
  Real x,y;
equation
  x = sin(y);
  y = cos(x);
 annotation (experiment(StopTime=10, NumberOfIntervals=10000));
end M;

Change History (11)

comment:1 by Jens Frenkel, 12 years ago

This should not be too complicated. The systems are seperated by partition independent blocks. If there is a equation system with no state or event it could be solved before starting the integration. Maybe it could also solved during compilation time but therefore code generation or an interpreter is needed.

comment:2 by Willi Braun, 12 years ago

No, it's not that complicated, but just to check for states and events is not enough.
You need too check the dependencies for all variables that are involved in the system
If all of them are independent of time and states the system should be constant.

comment:3 by Martin Sjölund, 11 years ago

Milestone: 1.9.01.9.1

Postponed until 1.9.1

comment:4 by Martin Sjölund, 10 years ago

Milestone: 1.9.11.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:5 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:6 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:9 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:10 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:11 by Francesco Casella, 7 years ago

Milestone: 1.12.0Future

I tried this with v1.13.0-dev-155-g68350e9

model M
  Real x,y;

  function f_sin
    input Real x;
    output Real y;
  algorithm
    y:=sin(x);
    Modelica.Utilities.Streams.print("computed f_sin");
  //annotation(Inline = false);
  end f_sin;
  
equation
  x = f_sin(y);
  y = cos(x);
 annotation (experiment(StopTime=10, NumberOfIntervals=100));
end M;

and in fact the string is still written to the output 100 times during simulation.

The detection of the time-invariant variables should be improved.

Note: See TracTickets for help on using tickets.