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

Err: Class Modelica.Electrical.Analog.Basic.Resistor not found in scop

Err: Class Modelica.Electrical.Analog.Basic.Resistor not found in scop

hi,
while I am executing the "DCmotorcircuit model"in DR control tutorial in O M N book
an error is occurring
this is the code

loadModel(Modelica);

model DCMotorCircuit
  Modelica.Electrical.Analog.Basic.Resistor     resistor1(R = 10);
  Modelica.Electrical.Analog.Basic.Inductor     inductor1(L = 0.2);
  Modelica.Electrical.Analog.Basic.Ground       ground1;
  //Modelica.Mechanics.Rotational.Components.Inertia      inertia1(J = 1);   
  //Modelica 3.1
  Modelica.Mechanics.Rotational.Inertia         inertia1(J = 1);
  Modelica.Electrical.Analog.Basic.EMF          emf1;
  Modelica.Blocks.Sources.Step                  step1;
  Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage1;
equation
  //connect(step1.outport, signalVoltage1.inPort);
  connect(step1.y, signalVoltage1.v);
  connect(signalVoltage1.p, resistor1.p);
  connect(resistor1.n, inductor1.p);
  connect(inductor1.n, emf1.p);
  connect(emf1.flange_b, inertia1.flange_a);
  connect(signalVoltage1.n, ground1.p);
  connect(ground1.p, emf1.n);
end DCMotorCircuit;

simulate( DCMotorCircuit, stopTime=150 )

the following error occured

record SimulationResult
    resultFile = "",
    messages = "Simulation failed for model: DCMotorCircuit
[<interactive>:2:3-2:66:writable] Error: Class Modelica.Electrical.Analog.Basic.Resistor not found in scope DCMotorCircuit.
Error: Error occurred while flattening model DCMotorCircuit
"
end SimulationResult;


plot( signalVoltage1.i );

i am using modelica 3.2

any one help to resolve this problem

the libraries are found in my modelica library

Re: Err: Class Modelica.Electrical.Analog.Basic.Resistor not found in scop

Hi parameswararaob,

you just have two small errors in your code:

Code:

Modelica.Mechanics.Rotational.Inertia         inertia1(J = 1);

should be still:

Code:

Modelica.Mechanics.Rotational.Components.Inertia      inertia1(J = 1);   

and

Code:

connect(emf1.flange_b, inertia1.flange_a);

should be

Code:

connect(emf1.flange, inertia1.flange_a);

OM pops up with a warning, that iteration start values are missing, but does the simulation now.

Hope this works for you.
Uwe

There are 0 guests and 0 other users also viewing this topic
You are here: