Opened 10 years ago

Closed 6 years ago

#3274 closed defect (fixed)

Inheritance problems on power systems library

Reported by: anonymous Owned by: Per Östlund
Priority: blocker Milestone: 2.0.0
Component: New Instantiation Version: trunk
Keywords: Cc: Adeel Asghar

Description

I analyze for a lot of time the power system library.
We can see in the Recursive BuildModel Test of the power system library that some test fails to run.
Most of the fails appear when transformers are involved in the model.
The examples under the spot file using transformers have most of them a change in the configuration of the transformers.
All the transformers in the power system library 3ph have Y-Y topology configuration by default. In the real world the Delta-Y configuration is the most used.
To reuse the transformer model a redeclaration statement needs to be used at the model of the system under construction.
According with choices explicit in the model, to change the topology of the transformer term the follow statement is needed.
PowerSystems.AC3ph.Transformers.TrafoStray trafo(par = data, redeclare PowerSystems.AC3ph.Ports.Topology.Delta top_p)
If I am not wrong, this redeclare statement supposes to work, but when I analyzed the initialized model, the topology change in the port is missing and it remains an Y topology.
When I tried to run the simulation, an error message in pop-up window appears saying that there more variables than equations.
Analyzing the topology definition port of the transformer, YDportTrafo_p_n, The definition is done by default Y topology for both ports when the possibility to redeclare each port into Delta topology. This definition includes same variables declarations about Voltages and Currents to connect the port with its terminals considering the relations between the coils.
According with my tests, the discrepancy between the number of the number of variables and the number of equations is the result of the redeclaration statement, the variables definition are lost. In the other hand, the topology of the port remains Y.
When I tried to redefine the variables again, the compiler ignore the statement with a warning message.
I check the same model without changing the topology of the transformer and it works find.
I suppose that there is a bug in the omc compiler when it try to translate the model and the redeclare statement fails.
Fixing this problem will increase the success when running Recursive BuildModel Test of the power system library.

Attachments (2)

test10.mo (1.9 KB ) - added by anonymous 10 years ago.
test11.mo (1.8 KB ) - added by Rüdiger Franke 9 years ago.

Download all attachments as: .zip

Change History (16)

by anonymous, 10 years ago

Attachment: test10.mo added

comment:1 by anonymous, 10 years ago

Owner: changed from danielwindleree@… to somebody
Status: newassigned

comment:2 by Adrian Pop, 10 years ago

Component: UnknownFrontend
Owner: changed from somebody to Adrian Pop
Status: assignedaccepted

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

Priority: highblocker

The error was already reported and partly solved in #3195. This is really a blocker for the PowerSystems library. Thank you for the additional analysis.

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

Milestone: Future1.9.5

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

Milestone: 1.9.51.10.0

Milestone renamed

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

I'm planning to change replaceable instances to replaceable model and record types in the PowerSystems library since a while. This shall unify the modeling patterns with other Modelica libraries. Wanted to wait until OMEdit will support it, but can't wait forever :-(

The following commit starts with transformers:
https://github.com/modelica/PowerSystems/commit/41db88d307635a428cc23fc8f93dabb404c44e13

This does not solve this ticket yet, but it changes the error messages. Find attached the updated example test11.mo.

*** test10.mo 2016-03-25 20:16:09.488001000 +0100
--- test11.mo 2016-03-25 20:16:13.734123007 +0100
***************
*** 1,9 ****
! model test10
    inner PowerSystems.System system(sim = "st") annotation(Placement(visible = true, transformation(origin = {-80, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Nodes.GroundOne grd1 annotation(Placement(visible = true, transformation(origin = {-80, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Sources.PQsource PQsource1(V_nom = 24000, S_nom = 50000000) annotation(Placement(visible = true, transformation(origin = {-46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
!   PowerSystems.AC3ph.Transformers.TrafoStray trafo(par = data, redeclare PowerSystems.AC3ph.Ports.Topology.Delta top_p) annotation(Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
!   parameter PowerSystems.AC3ph.Transformers.Parameters.TrafoStray data(V_nom = {24000, 161000}, S_nom = 50000000, r = {0.022, 1}, x = {1.17, 52.65}) annotation(Placement(visible = true, transformation(origin = {0, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Nodes.GroundOne grd11 annotation(Placement(visible = true, transformation(origin = {92, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Sources.InfBus infBus(V_nom = 161000) annotation(Placement(visible = true, transformation(origin = {54, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  equation
--- 1,11 ----
! model test11
    inner PowerSystems.System system(sim = "st") annotation(Placement(visible = true, transformation(origin = {-80, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Nodes.GroundOne grd1 annotation(Placement(visible = true, transformation(origin = {-80, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Sources.PQsource PQsource1(V_nom = 24000, S_nom = 50000000) annotation(Placement(visible = true, transformation(origin = {-46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
!   PowerSystems.AC3ph.Transformers.TrafoStray trafo(
!     redeclare model Topology_p = PowerSystems.AC3ph.Ports.Topology.Delta,
!     redeclare record Data = PowerSystems.AC3ph.Transformers.Parameters.TrafoStray(V_nom = {24000, 161000}, S_nom = 50000000, r = {0.022, 1}, x = {1.17, 52.65}))
!     annotation(Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Nodes.GroundOne grd11 annotation(Placement(visible = true, transformation(origin = {92, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    PowerSystems.AC3ph.Sources.InfBus infBus(V_nom = 161000) annotation(Placement(visible = true, transformation(origin = {54, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  equation

Use test11 with PowerSystems 0.5 dev (and test10 with the released PowerSystems 0.4.0).
Hopefully we can achieve both: better coverage and a better library!

by Rüdiger Franke, 9 years ago

Attachment: test11.mo added

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

Cc: Adeel Asghar added

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

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:9 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:10 by Francesco Casella, 7 years ago

Component: FrontendNF - New FrontEnd
Milestone: 1.12.02.0.0
Owner: changed from Adrian Pop to Per Östlund
Status: acceptedassigned

All front end issues will be handled by the new front end.

@perost, lots of interesting test cases here for the new front-end, besides the MSL

comment:11 by Per Östlund, 7 years ago

Component: NF - New FrontEndNew Instantiation

Move all tickets from NF - New Frontend to New Instantiation so we don't have two different categories for the same thing.

comment:12 by Francesco Casella, 7 years ago

I put here a link to the report on the results of using the new front end on the Power system library. This does not include the attached test, but it starts giving an idea on the degree of coverage.

We should review this issue when the coverage is close to 100%

comment:13 by Francesco Casella, 6 years ago

The PowerSystems library has changed a bit since the time this ticket was opened, ans so has OMC. I searched for examples with the keyword 'transform' in the model name, among the results obtained by the new front-end on 3-phase models. I found:

I'm not sure if the root cause is inheritance, I'll leave this ticket open for later analysis. The issue will be fixed in 2.0.0

comment:14 by Francesco Casella, 6 years ago

Resolution: fixed
Status: assignedclosed

Regarding PowerSystems.Examples.AC3ph.Transformation.PhaseShifts, see #5302.

Looking at the latest report it seems that the problems raised in this ticket have been solved. Remaining issue mostly concern mixed-determined initialization (#5302) and structural parameters that cannot be evaluated (#5243).

Note: See TracTickets for help on using tickets.