Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#3195 closed defect (fixed)

Translation error with integer inputs

Reported by: Rüdiger Franke Owned by: Lennart Ochel
Priority: high Milestone:
Component: Backend Version: trunk
Keywords: Cc:

Description

This case is motivated by transformer models of the PowerSystems library that have integer inputs for tap changers. The models are of the form:

package InputIndex
  model Component
    parameter Real[3] data = {1, 2, 3};
    input Integer index;
    Real x;
    output Real y;
  initial equation
    y = 0;
  equation
    x = data[1 + index];
    der(y) = x - y;
  end Component;

  model Test
    Component c(index = 1);
  end Test;
end InputIndex;

InputIndex.Test gives the error messages:

[1] Translation Error
Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!

[2] Symbolic Error
Too many equations, over-determined system. The model has 3 equation(s) and 1 variable(s).

[3] Translation Error
Internal error pre-optimization module removeSimpleEquations failed.

See also:
PowerSystems.Examples.Spot.AC1ph_DC.Transformer
PowerSystems.Examples.Spot.AC3ph.Transformer
PowerSystems.Examples.Spot.TransformationAC1ph.TapChanger
PowerSystems.Examples.Spot.TransformationAC3ph.PhaseShifts
PowerSystems.Examples.Spot.TransformationAC1ph.TapChanger
...

Change History (12)

comment:1 by Lennart Ochel, 10 years ago

Owner: changed from somebody to Lennart Ochel
Status: newaccepted

comment:2 by Lennart Ochel, 10 years ago

This is a bug in the optimization module "removeSimpleEquations". Right now, there was no time to investigate it properly. Hence, I just caught the failure and skipped failing equation subsystems for now (see r25002).
It is planned to revise (or even replace) the entire module, so maybe this is a suitable solution for now.

comment:3 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:4 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:5 by Lennart Ochel, 9 years ago

Resolution: fixed
Status: acceptedclosed

This issue seems to be fixed. If not, please reopen this ticket.

comment:6 by Rüdiger Franke, 9 years ago

Resolution: fixed
Status: closedreopened

Well, none of the PowerSystems examples given above is working yet (see nightly tests). Basically the error message changed, e.g. for PowerSystems.Examples.Spot.AC1ph_DC.Transformer:

Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 96 * Number of variables: 96 
Error: An independent subset of the model has imbalanced number of equations (8) and variables (6). variables: TapChanger.cnt_2 TapChanger.cnt_1 TapChanger.tap_n TapChanger.tap_p $whenCondition2 $whenCondition1 equations: 1 : algorithm $whenCondition1 := time > TapChanger.t_switch_1[min(TapChanger.cnt_1, 2)]; when $whenCondition1 then TapChanger.cnt_1 := 1 + TapChanger.cnt_1; TapChanger.tap_p := TapChanger.preset_1[min(TapChanger.cnt_1, 3)]; end when; $whenCondition2 := time > TapChanger.t_switch_2[min(TapChanger.cnt_2, 2)]; when $whenCondition2 then TapChanger.cnt_2 := 1 + TapChanger.cnt_2; TapChanger.tap_n := TapChanger.preset_2[min(TapChanger.cnt_2, 3)]; end when; 2 : TapChanger.tap_p = 0.0 3 : TapChanger.tap_n = 0.0 
Error: pre-optimization module encapsulateWhenConditions failed. 

in reply to:  6 comment:7 by Lennart Ochel, 9 years ago

Replying to rfranke:

Well, none of the PowerSystems examples given above is working yet (see nightly tests). Basically the error message changed, e.g. for PowerSystems.Examples.Spot.AC1ph_DC.Transformer:

At least the model from the description is now working without any error/warning. So maybe there is another bug that causes the error for the PowerSystems examples. Anyway, we can keep this ticket for that.

comment:8 by Rüdiger Franke, 9 years ago

I think the title of the ticket still matches. The example from the description was an attempt to break the problem down. You might close this ticket and open a new one if this helps.

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:10 by Rüdiger Franke, 9 years ago

Resolution: fixed
Status: reopenedclosed

The ticket was re-opened in #3274. Close this one because the introductory example works now.

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

Milestone: 1.9.51.10.0

Milestone renamed

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

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.