modeci_mdf.mdf.Parameter

class modeci_mdf.mdf.Parameter(id: str, value: EvaluableExpression | List | Dict | ndarray | int | float | str | None = None, default_initial_value: EvaluableExpression | List | Dict | ndarray | int | float | str | None = None, time_derivative: str | None = None, function: str | None = None, args: Dict[str, Any] | None = None, conditions: List[ParameterCondition] = NOTHING, *, metadata: Dict[str, Any] | None = 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 (modelspec.base_types.EvaluableExpression | List | Dict | numpy.ndarray | int | float | str | None) – The next value of the parameter, in terms of the inputs, functions and PREVIOUS parameter values

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

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

  • function (str | None) – Which of the in-build MDF functions (linear etc.) this uses, See https://mdf.readthedocs.io/en/latest/api/MDF_function_specifications.html

  • args (Dict[str, Any] | None) – 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.