modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
472 stars 169 forks source link

Add initial excitation current on ElectricalExcited Synchronous machines main dialog #4242

Open ceraolo opened 9 months ago

ceraolo commented 9 months ago

I have two models that should behave exactly the same. The two models are as follows (please remove ".txt" before using them): ZeroIniIexc.mo.txt NonZeroIniExc.mo.txt

I get important differences in the excitation currents (both in OM and Dymola): a

This is due to the fact that I did not specify the initial excitation current, and therefore the two simulations choose different values. Unfortunately, it is not possible to this initial current from the main model dialog. One has to resort to indirect designation as custom parameter "lesigma(i(start=0.4)".

AFAIK the general strategy of MSL models is that they give access to initial values of all state variabes from the main dialog. So, I think the same should be done also for ElectricalExcited Synchrnous machines.

In addition to state the current value in A, I think it would be useful to have a check-box "Steady-state" that sets the initial excitation current to the initial excitation voltage divided by the excitation resistance (as now occurs in model NonZeroIniExc.mo)

AHaumer commented 8 months ago

There's already present the line output SI.Current ie=pin_ep.i "Excitation current"; @ceraolo why do you have to use lesigma(i(start=0.4)? Like shown in the examples (e.g. Modelica.Electrical.Machines.Examples.SynchronousMachines.SMEE_DOL) one could use either an initial equation smee.ie=0.4 or a modifier smee(ie(start=0.4)) Ok we'll add ie(start=0) to Modelica.Electrical.BasicMachines.SynchronousMachines.SM_ElectricalExcited - and not to forget Modelica.Magnetic.FundamentalWave.BasicMachines.SynchronousMachines.SM_ElectricalExcited. @christiankral what's your opinion: Should we adapt the examples changing the initial equation to the use of the new start-value?

ceraolo commented 8 months ago

There's already present the line output SI.Current ie=pin_ep.i "Excitation current"; @ceraolo why do you have to use lesigma(i(start=0.4)?

Well, What I did was to have a look at the machine's diagram and there I saw that the excitation inductor was Lesigma. So I just thought to set the initial current for that inductor. I did not realise that I could use ie as well.

Ok we'll add ie(start=0) to Modelica.Electrical.BasicMachines.SynchronousMachines.SM_ElectricalExcited - and not to forget Modelica.Magnetic.FundamentalWave.BasicMachines.SynchronousMachines.SM_ElectricalExcited.

Thank you.