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

Creating a model similar to Multibody.World

Creating a model similar to Multibody.World

Hi,

I wanted to recreate the DCMotor model available in OMNotebook with one small change. I want to make the ground model similar to the Multibody.World model. i.e. it should be enough only if i drag and drop a ground component into the view. No need of connecting it.

For this, I made the ground component as an inner model by changing it in the annotation. 

Code:

model Ground

  Interfaces.Pin_a p ;
equation
  p.v = 0;
  annotation(defaultComponentName = "ground", defaultComponentPrefixes = "inner");
end Ground;

Then I gave a reference to this ground model in the voltage, emf, resistor and inductor components by

Code:

outer Ground ground;

But when i try to simulate the model, I get an error stating that Circular Equalities are detected. (This error comes in the normal DCMotor model when there is no ground component present.)


Can someone please tell me where I went wrong?

Regards,
Sanjay

Edited by: Sanjay_Kamath - May-12-14 13:20:53

Re: Creating a model similar to Multibody.World

OpenModelica does not (yet) add automatically and inner component. You have to add the inner component yourself in the top model!

Cheers,
Adrian Pop/

Re: Creating a model similar to Multibody.World

Hi Adrian,

I'm sorry I did not follow you. What do you mean by a top model? Is the DCMotor model my top model? I can see that the "inner Ground ground" has been added to my DCMotor model.

Re: Creating a model similar to Multibody.World

When you drag & drop the Ground model into DCMotor it should become,

Code:

inner Ground ground;

The top model Adrian is referring to is DCMotor.

Adeel.

Re: Creating a model similar to Multibody.World

That is what happens when I drag and drop the ground model. I can see

Code:

inner Ground ground;

in the Modelica text view added automatically. But the issue still exists

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