0

I revive this question because

1) Michael says the Base and the CustomizedClass are not necessary. I could not figure out how to eliminate them. You basically need a customised model, where you override the equation. How can this be done without these additional constructs Base and CustomizedClass?

2) most importantly - How would the example work for several variables/ equations? Let's say you have 3 equations. How can you override only 1 or 2 of them - without redeclaring the 3rd one? Or to reformulate the question: How can a model - including all the equations - be redeclared/overridden by a model which redefines only parts of its equations?

Thanks in advance.

y4cine
  • 396
  • 2
  • 20
  • a) you use several modifications: equations(x=1, y=a+b*c, z=u+d+y) or b) you replace an entire class that contains different equations – Adrian Pop Jun 16 '17 at 10:13
  • For your point 2) you cannot do that, if you have an equation (in an equation section, not a binding Real x=2;) in the base class you cannot override it via extends. You can only replace the entire model one level up but then you need to write *all* equations, repeating some of them. Alternatively you could use if equations and have all the alternative equations in the base class and you only activate them via modifications to if conditions. – Adrian Pop Jun 16 '17 at 10:20
  • Thank you very much Adrian. Pity for me. – y4cine Jun 16 '17 at 10:25
  • My actual problem, is that I want to model fluid flows (valves, pumps, vessels, etc.), but have a very hard time to understand how to get flows and streams working. I will open a new question specifically for this issue. Thanks again. – y4cine Jun 16 '17 at 10:30

0 Answers0