Skip to content

interfaces

IBalanceModel

IBalanceModel(
    sagging_temperature: ndarray,
    parameter: ndarray,
    section_array: SectionArray,
    cable_array: CableArray,
    span_model: ISpan,
    deformation_model: IDeformation,
    cable_loads: CableLoads,
    span_loads: SpanLoads,
    find_param_solver_type: Type[
        IFindParamSolver
    ] = FindParamSolverForLoop,
)

Bases: IModelForSolver, ABC

Interface for balance models. Used by BalanceEngine to find insulator chain positions.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
def __init__(
    self,
    sagging_temperature: np.ndarray,
    parameter: np.ndarray,
    section_array: SectionArray,
    cable_array: CableArray,
    span_model: ISpan,
    deformation_model: IDeformation,
    cable_loads: CableLoads,
    span_loads: SpanLoads,
    find_param_solver_type: Type[
        IFindParamSolver
    ] = FindParamSolverForLoop,
):
    self.adjustment: bool = NotImplemented
    self.current_temperature: np.ndarray = sagging_temperature
    self.deformation_model = deformation_model
    self.cable_loads = cable_loads
    self.span_loads = span_loads
    self.span_model = span_model
    self.nodes_span_model: ISpan = copy(self.span_model)
    self.parameter: np.ndarray = parameter
    self.cable_array = cable_array
    self.a: np.ndarray
    self.b: np.ndarray
    self.Th: np.ndarray
    self.Tv_d: np.ndarray
    self.Tv_g: np.ndarray
    self.nodes: Any  # Concrete type is Nodes (defined in model_ducloux)
    self.L_ref: np.ndarray

adjustment abstractmethod property writable

adjustment: bool

Boolean indicating if the model is in adjustment mode or change of state mode.

attachment_altitude_after_solve abstractmethod property

attachment_altitude_after_solve: ndarray

Attachment altitude after considering chain displacement.

Format: [z0, z1, z2,...]

has_loads abstractmethod property

has_loads: bool

Indicates if the balance model has loads applied.

state_vector abstractmethod property writable

state_vector: ndarray

Vector of state variables to be optimized.

chain_displacement abstractmethod

chain_displacement() -> ndarray

Get the displacement vectors of the chains.

dxdydz and chain_displacement are the transpose of each other

Format: [[x0, y0, z0], [x1, y1, z1],...]

Source code in src/mechaphlowers/core/models/balance/interfaces.py
114
115
116
117
118
119
120
121
122
@abstractmethod
def chain_displacement(self) -> np.ndarray:
    """Get the displacement vectors of the chains.

    dxdydz and chain_displacement are the transpose of each other

    Format: [[x0, y0, z0], [x1, y1, z1],...]
    """
    pass

dict_to_store

dict_to_store() -> dict

Returns a dictionary of values to store after each loop iteration. Used only for debugging purposes. Can stay empty.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
57
58
59
60
61
def dict_to_store(self) -> dict:
    """Returns a dictionary of values to store after each loop iteration.
    Used only for debugging purposes. Can stay empty.
    """
    return {}

get_dxdydz abstractmethod

get_dxdydz() -> ndarray

Get the dxdydz vector of the nodes.

dxdydz and chain_displacement are the transpose of each other

Format: [[x0, x1, x2,...], [y0, y1, y2,...], [z0, z1, z2,...]]

Source code in src/mechaphlowers/core/models/balance/interfaces.py
124
125
126
127
128
129
130
131
132
@abstractmethod
def get_dxdydz(self) -> np.ndarray:
    """Get the dxdydz vector of the nodes.

    dxdydz and chain_displacement are the transpose of each other

    Format: [[x0, x1, x2,...], [y0, y1, y2,...], [z0, z1, z2,...]]
    """
    pass

objective_function abstractmethod

objective_function() -> ndarray

Function to minimize that depends on state_vector.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
47
48
49
50
@abstractmethod
def objective_function(self) -> np.ndarray:
    """Function to minimize that depends on state_vector."""
    pass

reset abstractmethod

Reset the model references, optionally performing a full re-initialization.

Parameters:

Name Type Description Default

cable_array

CableArray

cable data

required

span_model

ISpan

span model

required

deformation_model

IDeformation

deformation model

required

cable_loads

CableLoads

cable loads

required

span_loads

SpanLoads

span loads

required

full

bool

if True, re-initialize all attributes; otherwise only update model references.

False
Source code in src/mechaphlowers/core/models/balance/interfaces.py
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
@abstractmethod
def reset(
    self,
    cable_array: CableArray,
    span_model: ISpan,
    deformation_model: IDeformation,
    cable_loads: CableLoads,
    span_loads: SpanLoads,
    full: bool = False,
) -> None:
    """Reset the model references, optionally performing a full re-initialization.

    Args:
        cable_array (CableArray): cable data
        span_model (ISpan): span model
        deformation_model (IDeformation): deformation model
        cable_loads (CableLoads): cable loads
        span_loads (SpanLoads): span loads
        full (bool): if True, re-initialize all attributes; otherwise only update model references.
    """
    pass

update abstractmethod

update() -> None

Update any variables of the model if necessary. Can stay empty.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
52
53
54
55
@abstractmethod
def update(self) -> None:
    """Update any variables of the model if necessary. Can stay empty."""
    pass

update_L_ref abstractmethod

update_L_ref() -> ndarray

Update the reference length L_ref after an adjustment solve.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
 98
 99
100
101
@abstractmethod
def update_L_ref(self) -> np.ndarray:
    """Update the reference length L_ref after an adjustment solve."""
    pass

update_nodes_span_model abstractmethod

update_nodes_span_model() -> None

Update the span model of the nodes if loads are applied.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
182
183
184
185
@abstractmethod
def update_nodes_span_model(self) -> None:
    """Update the span model of the nodes if loads are applied."""
    pass

vhl_under_chain abstractmethod

vhl_under_chain() -> VhlResult

Get the VHL efforts under chain: without considering insulator_weight. Format: [[V0, H0, L0], [V1, H1, L1], ...] Default unit is daN

Source code in src/mechaphlowers/core/models/balance/interfaces.py
142
143
144
145
146
147
@abstractmethod
def vhl_under_chain(self) -> VhlResult:
    """Get the VHL efforts under chain: without considering insulator_weight.
    Format: [[V0, H0, L0], [V1, H1, L1], ...]
    Default unit is daN"""
    pass

vhl_under_chain_left abstractmethod

vhl_under_chain_left() -> VhlResult

Get the VHL efforts under chain: without considering insulator_weight.

VHL at the left of the support.

Format: [[V0, H0, L0], [V1, H1, L1], ...] Default unit is daN

Source code in src/mechaphlowers/core/models/balance/interfaces.py
149
150
151
152
153
154
155
156
157
@abstractmethod
def vhl_under_chain_left(self) -> VhlResult:
    """Get the VHL efforts under chain: without considering insulator_weight.

    VHL at the left of the support.

    Format: [[V0, H0, L0], [V1, H1, L1], ...]
    Default unit is daN"""
    pass

vhl_under_chain_right abstractmethod

vhl_under_chain_right() -> VhlResult

Get the VHL efforts under chain: without considering insulator_weight.

VHL at the right of the support.

Format: [[V0, H0, L0], [V1, H1, L1], ...] Default unit is daN

Source code in src/mechaphlowers/core/models/balance/interfaces.py
159
160
161
162
163
164
165
166
167
@abstractmethod
def vhl_under_chain_right(self) -> VhlResult:
    """Get the VHL efforts under chain: without considering insulator_weight.

    VHL at the right of the support.

    Format: [[V0, H0, L0], [V1, H1, L1], ...]
    Default unit is daN"""
    pass

vhl_under_console abstractmethod

vhl_under_console() -> VhlResult

Get the VHL efforts under console: considering insulator_weight. Format: [[V0, H0, L0], [V1, H1, L1], ...] Default unit is daN

Source code in src/mechaphlowers/core/models/balance/interfaces.py
169
170
171
172
173
174
@abstractmethod
def vhl_under_console(self) -> VhlResult:
    """Get the VHL efforts under console: considering insulator_weight.
    Format: [[V0, H0, L0], [V1, H1, L1], ...]
    Default unit is daN"""
    pass

IModelForSolver

Bases: ABC

Interface for models used by BalanceSolver. This interface defines the necessary methods and properties that a model in order to be compatible with BalanceSolver.

state_vector abstractmethod property writable

state_vector: ndarray

Vector of state variables to be optimized.

dict_to_store

dict_to_store() -> dict

Returns a dictionary of values to store after each loop iteration. Used only for debugging purposes. Can stay empty.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
57
58
59
60
61
def dict_to_store(self) -> dict:
    """Returns a dictionary of values to store after each loop iteration.
    Used only for debugging purposes. Can stay empty.
    """
    return {}

objective_function abstractmethod

objective_function() -> ndarray

Function to minimize that depends on state_vector.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
47
48
49
50
@abstractmethod
def objective_function(self) -> np.ndarray:
    """Function to minimize that depends on state_vector."""
    pass

update abstractmethod

update() -> None

Update any variables of the model if necessary. Can stay empty.

Source code in src/mechaphlowers/core/models/balance/interfaces.py
52
53
54
55
@abstractmethod
def update(self) -> None:
    """Update any variables of the model if necessary. Can stay empty."""
    pass