Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » archanaroy
  • » Profile

Posts

Posts

Jul-18-20 06:48:15
Found a component with same name when looking for type %

How to change the name of the model? Actually IineNew is one model which have been used as a component in another model linetest.

Jul-17-20 13:42:44
Found a component with same name when looking for type %

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
You are here: