Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5001 closed defect (fixed)

Issue with Spice3 models in NF

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check Modelica.Electrical.Spice3.Examples.Graetz. The removeSimpleEquations module fails.

I flattened the model with the old and new FE. The equations seem to me equivalent, considering that the connection equations for 3 effort variables can be equivalently stated in the form a = b; b = c; as well as in the form a = b; a = c;

The only other difference I spotted was in the way a connection equation for flow variables is rendered:

D2.n.i = (-D2.icap) - D2.cc.m_dCurrent - D2.igmin;    // Old FE

D2.n.i = (-(D2.cc.m_dCurrent + D2.igmin)) - D2.icap;  // New FE

Of course the unary minus operator and the binary minus operator look the same when pretty printed, but maybe the - in the NF-produced AST is the binary operator, and that causes the removeSimpleEquations module to fail.

There are many other Spice3 models failing in the same place, so I guess this is a commonplace issue, please check.

Change History (5)

comment:1 by Per Östlund, 7 years ago

Resolution: fixed
Status: newclosed

Fixed in 1ed0e9d. But it seems like the Spice3 models doesn't really like the "put parameter bindings in initial equations and make them fixed" strategy, because it fails during initialization and complains a lot about missing values.

in reply to:  1 ; comment:2 by Francesco Casella, 7 years ago

Replying to perost:

Fixed in 1ed0e9d. But it seems like the Spice3 models doesn't really like the "put parameter bindings in initial equations and make them fixed"

I guess you mean not fixed, right?

in reply to:  2 comment:3 by Per Östlund, 7 years ago

Replying to casella:

Replying to perost:

Fixed in 1ed0e9d. But it seems like the Spice3 models doesn't really like the "put parameter bindings in initial equations and make them fixed"

I guess you mean not fixed, right?

That might explain why it's not working so well...

comment:4 by Francesco Casella, 7 years ago

Ops :)

in reply to:  4 comment:5 by Per Östlund, 7 years ago

Replying to casella:

Ops :)

Good thing you caught that, after correcting that slight misstep the Graetz model now simulates without issues.

Note: See TracTickets for help on using tickets.