- Index
- » Users
- » archanaroy
- » Profile
Posts
Posts
How to change the name of the model? Actually IineNew is one model which have been used as a component in another model linetest.
Hello everyone
I am trying to simulate a code:
model lineNew
extends PowerSystems.Icons.Block;
extends PowerSystems.Generic.Ports.PartialTwoTerminal;
parameter Modelica.SIunits.Resistance R = 1 "active component";
parameter Modelica.SIunits.Inductance L = 1/314 "reactive component";
parameter Modelica.SIunits.AngularFrequency omegaRef;
model lineTest
PowerSystems.Generic.FixedVoltageSource fixedVoltageSource annotation(
Placement(visible = true, transformation(origin = {-62, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
lineNew lineNew annotation(
Placement(visible = true, transformation(origin = {8, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
PowerSystems.Generic.FixedCurrent fixedCurrent(I = 60) annotation(
Placement(visible = true, transformation(origin = {78, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
inner PowerSystems.System system(f_nom = 50) annotation(
Placement(visible = true, transformation(origin = {-64, 78}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(fixedVoltageSource.terminal, lineNew.terminal_p) annotation(
Line(points = {{-52, 10}, {-2, 10}, {-2, 10}, {-2, 10}}, color = {0, 120, 120}));
connect(lineNew.terminal_n, fixedCurrent.terminal) annotation(
Line(points = {{18, 10}, {68, 10}, {68, 10}, {68, 10}}, color = {0, 120, 120}));
end lineTest;
equation
if PhaseSystem.m > 0 then
omegaRef = der(PhaseSystem.thetaRef(terminal_p.theta));
else
omegaRef = 0;
end if;
v = R*i + omegaRef*L*j(i);
zeros(PhaseSystem.n)= terminal_p.i + terminal_n.i;
if PhaseSystem.m>0 then
terminal_p.theta = terminal_n.theta;
end if;
annotation(Icon, Diagram,
uses(PowerSystems(version = "1.0.0")));
end lineNew;
This is code for lineTest:
model Linetest
PowerSystems.Generic.FixedVoltageSource fixedVoltageSource annotation(
Placement(visible = true, transformation(origin = {-62, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
PowerSystems.Generic.FixedCurrent fixedCurrent(I = 60) annotation(
Placement(visible = true, transformation(origin = {78, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
inner PowerSystems.System system(f_nom = 50) annotation(
Placement(visible = true, transformation(origin = {-64, 78}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
lineNew lineNew annotation(
Placement(visible = true, transformation(origin = {8, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(lineNew.terminal_n, fixedCurrent.terminal) annotation(
Line(points = {{18, 10}, {68, 10}}, color = {0, 120, 120}));
connect(lineNew.terminal_p, fixedVoltageSource.terminal) annotation(
Line(points = {{-2, 10}, {-52, 10}}, color = {0, 120, 120}));
annotation(
uses(PowerSystems(version = "1.0.0")));
end Linetest;
I am getting error message as : Found a component with same name when looking for type lineNew
As I am new to openmodelica, not able to resolve this error. Please help me figuring out what is the mistake I am making.
- Index
- » Users
- » archanaroy
- » Profile