Equations#
Equations are grouped in a let section.
- class ansys.scadeone.core.swan.LetSection(equations: List[Equation])#
Bases:
ScopeSection
Implements:
let {{equation ;}} section.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.
Equations have a left-hand side (LHS), the flows that are defined by the equation and the equation expression.
- class ansys.scadeone.core.swan.Equation#
Bases:
SwanItem
Base class for equations.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.
- class ansys.scadeone.core.swan.EquationLHS(lhs_items: List[LHSItem], is_partial_lhs: bool | None = False)#
Bases:
SwanItem
Equation left-hand side part:
lhs ::= ( ) | lhs_item {{ , lhs_item }} [[ , .. ]]
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.
- class ansys.scadeone.core.swan.LHSItem(id: Identifier | str | None = None)#
Bases:
SwanItem
Defines an item on the left-hand side of an equation, an ID, or underscore ‘_’.
- Parameters:
- id
Identifier
(optional
) Identifier or None for underscore value.
- id
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property id: Identifier | None#
Returns id value or None.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.
- class ansys.scadeone.core.swan.ExprEquation(lhs: EquationLHS, expr: Expression, luid: Luid | None = None)#
Bases:
Equation
Flows definition using an expression:
equation ::= lhs [luid] = expr
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property expr: Expression#
Equation expression.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property lhs: EquationLHS#
Left-hand side of the equation.
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.