Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2866 closed defect (fixed)

initial() influences DAE

Reported by: Vitalij Ruge Owned by: Lennart Ochel
Priority: low Milestone: 1.9.4
Component: Backend Version: trunk
Keywords: Cc:

Description

Consider this example

model nls
  Real x;
  Real y;
  Real z;
equation
  if initial() then
    x = y^2;
    y = x^2 + z;
    z = sqrt(x);
  else
    x = y;
    y = z;
    z = 2*x + time;
  end if;
end nls;

model ls
  Real x;
  Real y;
  Real z;
initial equation
  x = y^2;
  y = x^2 + z;
  z = sqrt(x);
equation
  x = y; // y = x
  y = z; // y = x = z
  z = 2*x + time; // x = 2*x - time // x = time
end ls;

In nls we creating a nonlinear system and in ls we creating a linear system for the DAE.
The models nls and ls are should be have the same DAE!

Change History (9)

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

Summary: initail() influenced DAEinitial() influences DAE

comment:2 by Lennart Ochel, 10 years ago

Priority: highlow

First, there is no DAE at all ;-). The models are poorly designed. Probably there is a much better way to do whatever you want to do. What is the goal of this ticket? Just to do more simplifications on the dynamic problem?
The initial problems of both systems are different but weird anyway. Why should one formulate such a system?
The dynamic equations should be equal but are different due to the current back end design. Currently, there is no special optimization for the dynamic equations that evaluates initial() (same for #2751). That is the reason why there is a non-linear system in one case and a linear system in the other case.

comment:3 by Vitalij Ruge, 10 years ago

First, there is no DAE at all ;-).

the dummy state say it's a DAE

The models are poorly designed.

this comment is still unhelpful

Probably there is a much better way to do whatever you want to do.

this comment is still unhelpful

What is the goal of this ticket?

Handling linear equation as linear equation, pls read description.

Just to do more simplifications on the dynamic problem?

Handling linear equation as linear equation, pls read description(it's a short one).

The initial problems of both systems are different but weird anyway.

Has not to do with the issue.

Why should one formulate such a system?

To show the issue

The dynamic equations should be equal but are different due to the current back end design.

The description tell, that the issue is spliting linear system and not lienear system on the relation with initial().
This issue can be expanded of general relations and not really binding on initial(). initial() is a good start, because is a known fixed realation and there must be are many groundwork for this case.

Currently, there is no special optimization for the dynamic equations that evaluates initial() (same for #2751).

I would prefer a solution with spliting ls and nls on realtion( for expanding it for all realtions/events).

comment:4 by Vitalij Ruge, 10 years ago

So we can improve the evaluation of initial() or the splitting of linear system and not linear system depends on relation for solving this issues. I hope the second strategies is not really a design question of the BackEnd.

Last edited 10 years ago by Vitalij Ruge (previous) (diff)

comment:5 by Lennart Ochel, 9 years ago

Owner: changed from somebody to Lennart Ochel
Status: newaccepted

I split up the equation systems for simulation and initialization in 56d186b60d7904ed253b34995e6ff4543a16e09d/OMCompiler. Now there are just some simplifications missing.

comment:6 by Lennart Ochel, 9 years ago

Milestone: Future1.9.4

comment:7 by Lennart Ochel, 9 years ago

Resolution: fixed
Status: acceptedclosed

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

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

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

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.