modeci_mdf.mdf.Parameter

class modeci_mdf.mdf.Parameter(id: str, value: Optional[Union[EvaluableExpression, List, Dict, ndarray, int, float, str]] = None, default_initial_value: Optional[Union[EvaluableExpression, List, Dict, ndarray, int, float, str]] = None, time_derivative: Optional[str] = None, function: Optional[str] = None, args: Optional[Dict[str, Any]] = None, conditions: List[ParameterCondition] = _Nothing.NOTHING, *, metadata: Optional[Dict[str, Any]] = None)[source]

Bases: MdfBase

A parameter of the Node, which can be: 1) a specific fixed value (a constant (int/float) or an array) 2) a string expression for the value referencing other named Parameter`(s). which may be stateful (i.e. can change value over multiple executions of the :class:`Node); 3) be evaluated by an inbuilt function with args; 4) or change from a default_initial_value with a time_derivative.

Variables:
  • value (Optional[Union[modelspec.base_types.EvaluableExpression, List, Dict, numpy.ndarray, int, float, str]]) – The next value of the parameter, in terms of the inputs, functions and PREVIOUS parameter values

  • default_initial_value (Optional[Union[modelspec.base_types.EvaluableExpression, List, Dict, numpy.ndarray, int, float, str]]) – The initial value of the parameter, only used when parameter is stateful.

  • time_derivative (Optional[str]) – How the parameter changes with time, i.e. ds/dt. Units of time are seconds.

  • function (Optional[str]) – Which of the in-build MDF functions (linear etc.) this uses, See

  • https – //mdf.readthedocs.io/en/latest/api/MDF_function_specifications.html

  • args (Optional[Dict[str, Any]]) – Dictionary of values for each of the arguments for the function of the parameter, e.g. if the in-build function is linear(slope), the args here could be {"slope": 3} or {"slope": "input_port_0 + 2"}

  • conditions (List[modeci_mdf.mdf.ParameterCondition]) – Parameter specific conditions

Method generated by attrs for class Parameter.

Methods

is_stateful()

Is the parameter stateful?

summary()

Short summary of Parameter...

summary()[source]

Short summary of Parameter…

is_stateful() bool[source]

Is the parameter stateful?

A parameter is considered stateful if it has a time_derivative, default_initial_value, or its id is referenced in its value expression.

Returns:

True if stateful, False if not.