section_study
SectionStudy
SectionStudy(
cable_array: CableArray,
section_array: SectionArray,
span_model_type: Type[ISpan] = CatenarySpan,
deformation_model_type: Type[
IDeformation
] = DeformationRte,
)
User-facing facade that bundles all engines for a power-line section.
SectionStudy creates a
BalanceEngine and a
PositionEngine
eagerly, wiring the observer chain so that every solve automatically
refreshes downstream geometry. A
PlotEngine,
ThermalEngine,
and Guying are created lazily
on first access to avoid unnecessary dependencies (e.g. plotly).
All state-management features (save / restore, rollback on solver error,
intermediate warm-start) live here so that
BalanceEngine
is never modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CableArray
|
Cable specification data. |
required |
|
SectionArray
|
Support / section data. |
required |
|
Type[ISpan]
|
Span model class. Defaults to CatenarySpan. |
CatenarySpan
|
|
Type[IDeformation]
|
Deformation model class. Defaults to DeformationRte. |
DeformationRte
|
Examples:
1 2 3 4 | |
Source code in src/mechaphlowers/api/section_study.py
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 | |
intermediate_memento
property
intermediate_memento: BalanceEngineMemento | None
The memento captured after the intermediate warm-start solve, if any.
manipulation
property
manipulation: Manipulation
The [Manipulation][mechaphlowers.core.manipulation.Manipulation] object storing geometric overlays.
add_loads
add_loads(
load_position_distance: ndarray | list,
load_mass: ndarray | list,
) -> None
Delegate to BalanceEngine.add_loads.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray | list
|
Position of the loads, in meters. |
required |
|
ndarray | list
|
Mass of the loads. |
required |
Source code in src/mechaphlowers/api/section_study.py
395 396 397 398 399 400 401 402 403 404 405 406 | |
add_rope
Override insulator length and mass for specified supports with rope values.
Delegates to [Manipulation.add_rope][mechaphlowers.core.manipulation.Manipulation.add_rope].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[int, float]
|
Dictionary mapping support index (0-based) to rope length (meters). |
required |
|
float | None
|
Linear mass of the rope in kg/m. |
None
|
Source code in src/mechaphlowers/api/section_study.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
add_virtual_support
Insert virtual supports.
Delegates to [Manipulation.add_virtual_support][mechaphlowers.core.manipulation.Manipulation.add_virtual_support].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[int, dict[str, float]]
|
Dictionary mapping left-support index to virtual support parameters. |
required |
Source code in src/mechaphlowers/api/section_study.py
188 189 190 191 192 193 194 195 196 197 198 199 | |
get_data_spans
Delegate to BalanceEngine.get_data_spans.
Returns:
| Type | Description |
|---|---|
dict[str, list]
|
dict[str, list]: Dictionary with span data (parameter, tensions, etc.). |
Source code in src/mechaphlowers/api/section_study.py
430 431 432 433 434 435 436 | |
get_points_for_plot
Delegate to PositionEngine.get_points_for_plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
|
False
|
|
Index of the support frame for projection. |
0
|
Returns:
| Type | Description |
|---|---|
tuple[Points, Points, Points]
|
Tuple of |
Source code in src/mechaphlowers/api/section_study.py
459 460 461 462 463 464 465 466 467 468 469 470 471 | |
get_spans_points
get_spans_points(
frame: Literal[
'section', 'localsection', 'cable'
] = 'section',
) -> ndarray
Delegate to PositionEngine.get_spans_points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Literal['section', 'localsection', 'cable']
|
Coordinate frame. Defaults to "section". |
'section'
|
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Array of span points in the requested frame. |
Source code in src/mechaphlowers/api/section_study.py
438 439 440 441 442 443 444 445 446 447 448 449 | |
get_supports_points
get_supports_points() -> ndarray
Delegate to PositionEngine.get_supports_points.
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Array of support points coordinates. |
Source code in src/mechaphlowers/api/section_study.py
451 452 453 454 455 456 457 | |
modify_cable
modify_cable(
shift_support: dict[int, float] | None = None,
shorten_span: dict[int, float] | None = None,
) -> None
Validate and store cable shifting values.
Delegates to [Manipulation.modify_cable][mechaphlowers.core.manipulation.Manipulation.modify_cable].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[int, float] | None
|
Horizontal shifting per support, in meters. Dictionary mapping support index (0-based) to shift value; first and last supports are forced to 0. |
None
|
|
dict[int, float] | None
|
Span length modification per span, in meters. Dictionary mapping span index (0-based) to shortening value; positive values shorten the span. |
None
|
Source code in src/mechaphlowers/api/section_study.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
modify_support
Apply additive offsets to support geometry.
Delegates to
[Manipulation.modify_support][mechaphlowers.core.manipulation.Manipulation.modify_support].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[int, dict[str, float]]
|
Dictionary mapping support index (0-based) to
offsets with optional keys |
required |
Source code in src/mechaphlowers/api/section_study.py
145 146 147 148 149 150 151 152 153 154 155 156 157 | |
reset_all
reset_all() -> None
Remove all active manipulations.
Delegates to [Manipulation.reset_all][mechaphlowers.core.manipulation.Manipulation.reset_all].
Source code in src/mechaphlowers/api/section_study.py
234 235 236 237 238 239 | |
reset_cable
reset_cable() -> None
Remove cable shifting.
Delegates to [Manipulation.reset_cable][mechaphlowers.core.manipulation.Manipulation.reset_cable].
Source code in src/mechaphlowers/api/section_study.py
227 228 229 230 231 232 | |
reset_rope
reset_rope() -> None
Remove the rope overlay.
Delegates to [Manipulation.reset_rope][mechaphlowers.core.manipulation.Manipulation.reset_rope].
Source code in src/mechaphlowers/api/section_study.py
181 182 183 184 185 186 | |
reset_support
reset_support() -> None
Remove the support manipulation overlay.
Delegates to [Manipulation.reset_support][mechaphlowers.core.manipulation.Manipulation.reset_support].
Source code in src/mechaphlowers/api/section_study.py
159 160 161 162 163 164 | |
reset_virtual_support
reset_virtual_support() -> None
Remove all virtual supports.
Delegates to [Manipulation.reset_virtual_support][mechaphlowers.core.manipulation.Manipulation.reset_virtual_support].
Source code in src/mechaphlowers/api/section_study.py
201 202 203 204 205 206 | |
restore_state
restore_state(memento: BalanceEngineMemento) -> None
Restore state and notify observers to refresh geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
BalanceEngineMemento
|
Snapshot previously returned by
|
required |
Source code in src/mechaphlowers/api/section_study.py
418 419 420 421 422 423 424 425 426 | |
save_state
save_state() -> BalanceEngineMemento
Create an immutable snapshot of the current engine state.
Returns:
| Name | Type | Description |
|---|---|---|
BalanceEngineMemento |
BalanceEngineMemento
|
Independent copy of every mutable array. |
Source code in src/mechaphlowers/api/section_study.py
410 411 412 413 414 415 416 | |
solve_adjustment
solve_adjustment() -> None
Run adjustment on clean geometry, then apply manipulations if any.
- Build a clean engine from the original section array and solve
adjustment to obtain
initial_L_ref. - If manipulations are registered, call
[
Manipulation.from_section_array][mechaphlowers.core.manipulation.Manipulation.from_section_array] to produce a manipulated copy, then [Manipulation.initialize_engine][mechaphlowers.core.manipulation.Manipulation.initialize_engine] to build the target engine with injectedL_refand blocked adjustment. - Rewire downstream engines (caretaker, position, plot, guying).
On SolverError, the engine
state is restored to the snapshot taken before the solve attempt, and the
error is re-raised.
Raises:
| Type | Description |
|---|---|
SolverError
|
If the solver fails to converge. |
Source code in src/mechaphlowers/api/section_study.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
solve_change_state
solve_change_state(
wind_pressure: ndarray | float | None = None,
ice_thickness: ndarray | float | None = None,
new_temperature: ndarray | float | None = None,
wind_direction: Literal[
'clockwise', 'anticlockwise'
] = 'anticlockwise',
) -> None
Run BalanceEngine.solve_change_state with automatic rollback.
An intermediate solve at default conditions (T=15 °C, wind=0, ice=0) is performed first as a warm-start to improve convergence, unless the requested conditions already match the defaults.
On SolverError, the engine
state is restored to the snapshot taken before the solve attempt, and the
error is re-raised.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray | float | None
|
Wind pressure in Pa. Defaults to None. |
None
|
|
ndarray | float | None
|
Ice thickness in m. Defaults to None. |
None
|
|
ndarray | float | None
|
New temperature in °C. Defaults to None. |
None
|
|
Literal['clockwise', 'anticlockwise']
|
Direction of the wind. Defaults to "anticlockwise". |
'anticlockwise'
|
Raises:
| Type | Description |
|---|---|
SolverError
|
If the solver fails to converge. |
Source code in src/mechaphlowers/api/section_study.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
supports_number
supports_number() -> int
Return the number of supports in the balance engine.
Source code in src/mechaphlowers/api/section_study.py
482 483 484 | |