Help - Search - Members - Calendar
Full Version: replaceable function
Modelica Forum > Modelica > Modelica
Matze
I have a question regarding "replaceable function".

In my model I want to choose one out of three functions (functions "one", "two" and "three") for a calculation. For this i want to have a pull-down-menu with all three choices in the parameter-area, like it is for the FlowChar in the ValveLiq-model (ThermoPower.Water).

CODE
replaceable function FlowChar = Functions.ValveCharacteristics.linear
    extends Functions.ValveCharacteristics.baseFun "Flow characteristic";

In a pull-down-menu in the parameter-area i can choose between linear, constant, quadratic and so on. Standard is "Functions.ValveCharacteristics.linear ".

I built 4 functions, one base function and the three different functions for the calculation. As in the ValveLiq-model my base function is a "partial function", the other functions as "function".

That's what is in my model:
CODE
replaceable function ABC = Functions.one
    extends Functions.base;


But i don't get a pull-down-menu - there is no choice, the model is using "Functions.one" and that's it. I can't change it without changing the code to

CODE
replaceable function ABC = Functions.two
    extends Functions.base;

or

CODE
replaceable function ABC = Functions.three
    extends Functions.base;


What do i have to change to get a pull-down-menu?
Matze
Got it,

"replaceable function ABC = Functions.one
extends Functions.base annotation(choicesAllMatching=true);"

seems to be the key...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.