1

I am trying to model a pump system. The system consists of a controller, two ON/OFF valves, and a swept volume acting as a chamber. The controller is responsible for the state of the valves as well as filling the volume and pumping it. When connecting all the components together, i started getting errors saying " Failed to instantiate equation between components ", for example between the swept volume and the first valve. I tried to delete the valves from the whole system and connect the piston directly to the source, but i then got an error saying "Failed to instantiate equation .." between the piston displacment and its input.

I couldn't understand where is my problem to be exact. Is it with the model themselves that they cannot be connected together or am i missing something else?

I am not an expert in modelica obviously, but i got the basics of course.

To make things clearer, here's the link to my model:

https://www.dropbox.com/s/g9dr40jame3lk2n/pumpsystem.zip?dl=0

Any help would be appreciated.

data99
  • 59
  • 7

1 Answers1

2

OpenModelica complains about obsolete connections. You have many connections in your model between components which don't exist anymore.

For example:

connect(ChamberController.PistonDisplacment, sweptVolume1.flange) annotation(...);
connect(close.on, ChamberController.deflate)  annotation(...);

To remove these connections, simply click the link in the Messages Browser, which will bring you directly to the correct position in the code.

enter image description here

marco
  • 5,944
  • 10
  • 22
  • 1
    Yup, thats true. i thought like be deleting the connections directly from the diagram view, it will be directly deleted from the source code too. Thanks for the reply. So i fixed the connections and i tried to check th model, but modelica is saying that i got 385 equations with 384 variables, which results in an overdetermined system. My question is that is there a way or another that i can track the missing variable or where exactly i am missing it ? – data99 Jul 12 '19 at 07:56
  • Usually OpenModelica deletes connections from the code as well. I have no idea what went wrong. Regarding your missing variable: the simplest and often the only way to find such errors is to build minimal examples for every component to isolate the problem. – marco Jul 15 '19 at 09:27
  • Can you please tell me more about building minimal examples of my components ? what do you excatly mean or from where should i start ? appreciated @marco – data99 Jul 15 '19 at 10:29
  • Instantiate the components you want to test in a new model and provide only the necessary inputs. Set all parameters on simple literal values, connect basic components to the physical ports (e.g. a ground for electric components), connect simple signals to the inputs of blocks (usually a constant), etc. When this works, increase the complexity successively. – marco Jul 15 '19 at 10:59