- Index
- » Programming
- » Modelica Language
- » Permanent Magnet model in MSL works....
Permanent Magnet model in MSL works. But why?
Permanent Magnet model in MSL works. But why?
The model
Modelica.Electrical.Machines.Examples.SMPM_CurrentSource gives reasonable results both in OM and Dymola.
It uses the model
Modelica.Electrical.Machines.BasicMachines.Components.PermanentMagnet.
If we instantiate this latter model in OM we get:
Code:
class Modelica.Electrical.Machines.BasicMachines.Components.PermanentMagnet "Permanent magnet excitation"
parameter Real Ie(quantity = "ElectricCurrent", unit = "A") "Equivalent excitation current";
Real spacePhasor_r.v_[1](quantity = "ElectricPotential", unit = "V") "1=real, 2=imaginary part";
Real spacePhasor_r.v_[2](quantity = "ElectricPotential", unit = "V") "1=real, 2=imaginary part";
Real spacePhasor_r.i_[1](quantity = "ElectricCurrent", unit = "A") "1=real, 2=imaginary part";
Real spacePhasor_r.i_[2](quantity = "ElectricCurrent", unit = "A") "1=real, 2=imaginary part";
equation
spacePhasor_r.i_[1] = -Ie;
spacePhasor_r.i_[2] = 0.0;
spacePhasor_r.i_[1] = 0.0;
spacePhasor_r.i_[2] = 0.0;
end Modelica.Electrical.Machines.BasicMachines.Components.PermanentMagnet;
This seems indeed invalid for several reasons. Eq. 1 conflicts with Eq. 3 and eq. 2 is the same as eq. 4.
How come that this can work?
More in general, How it is possible that the "spacePhasor" connectors, that contain a flow variable can be used in a component like this
that has a single connector, not a pair?
- ceraolo
- 147 Posts
Re: Permanent Magnet model in MSL works. But why?
Well,
maybe it was a stupid post.
I think I can find myself the answers.
About the "conflicting" equations. The two latter equations are added only when the permanent magnet is isolated. When it is connected to other parts they are substituted with connection equations that in normal situations will solve the conflict.
About the possibility to have components containing a unique connector containing a flow variable.
Now I understand that flow variables are considered such by Modelica tools when connections between components are involved.
Modelica interpreters to not care about what occurs inside models. That enables permanent magnets containing a single connectors.
Obviously, ordinary electric components carry two pins (they are one port components) because the physics of current requires this.
But space phasor currents are mathematical entities that are not subject to the ordinary physics laws for currents.
MC
- ceraolo
- 147 Posts
- Index
- » Programming
- » Modelica Language
- » Permanent Magnet model in MSL works....