-
Notifications
You must be signed in to change notification settings - Fork 177
Closed
Labels
discussionDiscussion issue that it not necessarily related to a concrete bug or featureDiscussion issue that it not necessarily related to a concrete bug or feature
Description
Is it legal Modelica to include a function definition in a parameter record?
record Data "Material parameters"
extends Modelica.Icons.Record;
parameter Real x1 "Nominal point x";
parameter Real y1 "Nominal pint y";
parameter Real s0 "Slope beyond nominal point";
function approx
extends Modelica.Icons.Function;
input Data data "Materal parameters";
input Real x "Actual x";
output Real y "Actual y";
algorithm
y:=data.y1/data.x1*min(x, data.x1) + data.s0*max(x - data.x1, 0);
end approx;
end Data;
This would open the possibility to use different approximations for material behaviour just by choosing the material,
if the approximation functions for different materials have the same name and structure (inputs and output).
Metadata
Metadata
Assignees
Labels
discussionDiscussion issue that it not necessarily related to a concrete bug or featureDiscussion issue that it not necessarily related to a concrete bug or feature