Opened 12 years ago

Closed 7 years ago

#2242 closed defect (worksforme)

function with multiple outputs is treated strange

Reported by: Willi Braun Owned by: somebody
Priority: normal Milestone: 1.12.0
Component: Frontend Version: trunk
Keywords: Cc: Per Östlund, Adrian Pop, Vitalij Ruge

Description

In the following model the function f1 is simplified wrong to 1.
For some reasons the function f is constant, when f1 is simplified.

function f
  input Real x;
  output Real y;
  output Real y1;
algorithm
  y := exp(x);
end f;

function f1
  input Real x;
  output Real y;
algorithm
  y := 1 / f(x); // don't work
  //y := (-f(x)) / (-2); // works
  //y := f(x) / 2; // don't work
  //y := f(x) + f(x); // don't work !!!
end f1;

model A
  Real y;
equation
  y = f1(time);
end A;

Change History (11)

comment:1 by Willi Braun, 12 years ago

Priority: highnormal

Okay, I found a missing case for tuples in ExpressionSimplify(r16348). So that the first 3 cases are fixed.

But following is still open:

function f
  input Real x;
  output Real y;
  output Real y1;
algorithm
  y := exp(x);
end f;

function f1
  input Real x;
  output Real y;
algorithm
  y := f(x) + f(x); // fails !!!
  y := (-f(x)) + f(x); // works
  y := f(x) + (-f(x)); // works
  y := (-f(x)) + (-f(x)); //works
end f1;

model A
  Real y;
equation
  y = f1(time);
end A;

I guess we need to expand tuples somewhere.

Last edited 12 years ago by Willi Braun (previous) (diff)

comment:2 by Martin Sjölund, 12 years ago

I think these probably just lack the DAE.TSUB on the right side. Factors, etc, should not handle tuples!

Last edited 12 years ago by Martin Sjölund (previous) (diff)

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

Resolution: worksforme
Status: newclosed

Works as expected in v1.13.0-dev-155-g68350e9

Note: See TracTickets for help on using tickets.