M A
M A

Reputation: 11

Plot time signals in Modelica.Electrical.Quasistationary

I am trying to model a balanced 3 phase star connection (see foto 1) foto 1 and I want to get this simulation results (see foto 2 )foto 2 : R1.V,R2.V,R3.V. Here are some of the basic equations used foto 3.

I tried many times without success, can someone check and fix my model, so that I can get the same simulation results like foto 2?

model Unnamed
 parameter Integer m=3 "Number of phases";
     Modelica.Electrical.QuasiStationary.MultiPhase.Basic.Star starS annotation (
     Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=180,
        origin={-22,70})));
  Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Ground groundS
    annotation (Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=0,
        origin={-56,18})));
 Modelica.Electrical.QuasiStationary.MultiPhase.Basic.Resistor resistor(R_ref=
        fill(1000, 3))
    annotation (Placement(transformation(extent={{42,60},{62,80}})));
  Modelica.Electrical.QuasiStationary.MultiPhase.Sources.VoltageSource
    voltageSource1(m=m,
    f=50,
    V=fill(230,m),
    phi=-Modelica.Electrical.MultiPhase.Functions.symmetricOrientation(3))
    "{(-(j - 1))*2*Modelica.Constants.pi/(m) for j in 1/m}"
    annotation (Placement(transformation(extent={{28,60},{8,80}})));
     Modelica.Electrical.QuasiStationary.MultiPhase.Basic.Star starS1
                                                                     annotation (
     Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=0,
        origin={82,70})));
equation 
  connect(groundS.pin, starS.pin_n)
    annotation (Line(points={{-56,28},{-36,28},{-36,70},{-32,70}},
                                                 color={85,170,255}));
  connect(starS.plug_p, voltageSource1.plug_n)
    annotation (Line(points={{-12,70},{8,70}}, color={85,170,255}));
  connect(voltageSource1.plug_p, resistor.plug_p)
    annotation (Line(points={{28,70},{42,70}}, color={85,170,255}));
  connect(resistor.plug_n, starS1.plug_p)
    annotation (Line(points={{62,70},{72,70}}, color={85,170,255}));
  connect(starS1.pin_n, groundS.pin) annotation (Line(points={{92,70},{92,26},{-56,
          26},{-56,28}}, color={85,170,255}));
  annotation (uses(Modelica(version="3.2.2")));
end Unnamed;

Thank you

Upvotes: 1

Views: 129

Answers (1)

Markus A.
Markus A.

Reputation: 7525

The Modelica.Electrical.QuasiStationary package is phasor-based and therefore it seems to be a bit difficult to plot the sinusoidal signals - at least I didn't find a straight-forward way...

Therefore: Is there any specific reason to use the QuasiStationary package? The more obvious way would be to use Modelica.Electrical.MultiPhase in my opinion. This could e.g. result in the flowing code, which is copied and modified from Modelica.Electrical.MultiPhase.Examples.TransformerYY:

model ResistorThreephase "Test example with multiphase components"
  extends Modelica.Icons.Example;
  parameter Integer m=3 "Number of phases";
  parameter Modelica.SIunits.Voltage V=230 "Amplitude of Star-Voltage";
  parameter Modelica.SIunits.Frequency f=50 "Frequency";
  parameter Modelica.SIunits.Resistance RL=1e3 "Load Resistance";

  Modelica.Electrical.MultiPhase.Sources.SineVoltage sineVoltage(
    V=fill(V, m),
    freqHz=fill(f, m),
    m=m) annotation (Placement(transformation(
        origin={-30,20},
        extent={{-10,-10},{10,10}},
        rotation=180)));
  Modelica.Electrical.MultiPhase.Basic.Star starS(m=m)
    annotation (Placement(transformation(
        origin={-70,20},
        extent={{-10,-10},{10,10}},
        rotation=180)));
  Modelica.Electrical.Analog.Basic.Ground groundS annotation (Placement(
        transformation(extent={{-100,-40},{-80,-20}})));
  Modelica.Electrical.MultiPhase.Basic.Resistor loadR(m=m, R=fill(RL, m))
    annotation (Placement(transformation(extent={{20,10},{40,30}})));
  Modelica.Electrical.MultiPhase.Basic.Star starL(m=m)
    annotation (Placement(transformation(
        origin={70,20},
        extent={{-10,-10},{10,10}},
        rotation=0)));

equation 
  connect(starS.pin_n, groundS.p)
    annotation (Line(points={{-80,20},{-90,20},{-90,-20}}, color={0,0,255}));
  connect(starS.plug_p, sineVoltage.plug_n)
    annotation (Line(points={{-60,20},{-40,20}}, color={0,0,255}));
  connect(loadR.plug_n, starL.plug_p)
    annotation (Line(points={{40,20},{60,20}}, color={0,0,255}));
  connect(sineVoltage.plug_p, loadR.plug_p) annotation (Line(points={{-20,20},{20,20}}, color={0,0,255}));
  connect(starL.pin_n, groundS.p) annotation (Line(points={{80,20},{90,20},{90,-20},{-90,-20}}, color={0,0,255}));

  annotation (
    experiment(StopTime=0.03, __Dymola_Algorithm="Dassl"),
    uses(Modelica(version="3.2.3")));
end ResistorThreephase;

Upvotes: 1

Related Questions