Equilibrium Stability¶
equilibrium_stability
¶
Eager local linear-stability evidence for candidate equilibria.
The diagnostic in this module is deliberately dense, host-only and local. It
does not change :func:op_engine.steady_state, certify nonlinear or global
stability, or imply that every Array API namespace provides an eigensolver.
EquilibriumDomain
¶
Bases: StrEnum
Whether declared one-sided state constraints affect interpretation.
LocalSpectrum
¶
Bases: StrEnum
Strict classification of an assessed reduced linear spectrum.
LocalStabilityConfig(residual_tolerance, spectral_absolute_tolerance, spectral_relative_tolerance, boundary_tolerance, finite_difference_step=None)
dataclass
¶
Explicit numerical thresholds for :func:local_stability.
residual_tolerance and boundary_tolerance may be scalars or one
value per state coordinate. Spectral tolerances have inverse-time units;
their effective band is absolute + relative * max(abs(eigenvalue)).
__post_init__()
¶
Reject invalid scalar controls before evaluating a model.
Raises:
| Type | Description |
|---|---|
ValueError
|
A spectral tolerance is negative, non-finite or not scalar. |
Source code in src/op_engine/equilibrium_stability.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
LocalStabilityResult(status, classification, message, state, time, coordinates, coordinate_system, time_unit, jacobian_source, jacobian_reference, model_digest, solver_converged, residual_tolerance, boundary_tolerance, fixed_mask, nonnegative_mask, domain=EquilibriumDomain.UNSPECIFIED, raw_residual=None, active_residual=None, residual_scaled_rms=None, boundary_coordinates=(), finite_difference_steps=None, jacobian=None, full_eigenvalues=None, active_jacobian=None, active_eigenvalues=None, invariant_rows=None, invariant_rank=0, constraint_rank=0, constraint_svd_tolerance=None, tangent_basis=None, tangent_jacobian=None, tangent_eigenvalues=None, conservation_error=None, conservation_tolerance=None, invariant_flow_error=None, invariant_flow_tolerance=None, expected_conservation_neutral_modes=0, observed_active_neutral_modes=None, effective_spectral_tolerance=None, spectral_abscissa=None, leading_eigenvalue=None, leading_timescale=None, timescale_kind=None)
dataclass
¶
Evidence and interpretation from one local linearization.
LocalStabilityStatus
¶
Bases: StrEnum
Numerical status, independent of any spectral classification.
StabilityJacobianSource
¶
Bases: StrEnum
Provenance of the dense full-state Jacobian.
StabilityTimescaleKind
¶
Bases: StrEnum
Interpretation of an e-folding timescale.
SymbolicDerivativeArtifact
¶
Bases: Protocol
Structural surface consumed from op_system.SymbolicDerivatives.
evaluate(t, y, **parameters)
¶
Evaluate derivative matrices in the artifact's declared order.
Source code in src/op_engine/equilibrium_stability.py
88 89 90 | |
local_stability(rhs, candidate, *, config, t=0.0, coordinates=None, coordinate_system='supplied state', fixed=None, invariants=None, nonnegative=False, derivatives=None, parameters=None, jacobian=None, jacobian_reference=None, time_unit=None)
¶
Assess a candidate equilibrium through an eager NumPy linearization.
The classification applies only to an interior, residual-qualified point and, when constraints are declared, only to their tangent manifold. A boundary status deliberately suppresses an interior stability conclusion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rhs
|
StabilityRhs
|
Dense NumPy right-hand side in the supplied coordinates. |
required |
candidate
|
NumpyArray | SteadyStateResult
|
NumPy state or NumPy-backed steady-state result. |
required |
config
|
LocalStabilityConfig
|
Explicit residual, spectral, boundary and difference controls. |
required |
t
|
float
|
Frozen evaluation time. A time-dependent RHS is only diagnosed there. |
0.0
|
coordinates
|
Sequence[str] | None
|
Ordered state labels. An op_system artifact supplies these. |
None
|
coordinate_system
|
str
|
Human-readable coordinate-system declaration. |
'supplied state'
|
fixed
|
Sequence[int] | NumpyArray | None
|
Coordinates held fixed, as indices or a boolean mask. |
None
|
invariants
|
ArrayLike | None
|
Declared invariant rows in the supplied coordinates. |
None
|
nonnegative
|
bool | Sequence[bool] | NumpyArray
|
Coordinates with a one-sided non-negative domain. |
False
|
derivatives
|
SymbolicDerivativeArtifact | None
|
Optional op_system symbolic derivative artifact. |
None
|
parameters
|
Mapping[str, object] | None
|
Exact runtime bindings for |
None
|
jacobian
|
StabilityJacobian | None
|
Optional dense full-state Jacobian callback. |
None
|
jacobian_reference
|
str | None
|
Required provenance label for |
None
|
time_unit
|
str | None
|
Unit attached to any reported e-folding timescale. |
None
|
Returns:
| Type | Description |
|---|---|
LocalStabilityResult
|
Partial or complete numerical evidence with an explicit status. |
Raises:
| Type | Description |
|---|---|
TypeError
|
The state, solver flag or configuration is not eager NumPy. |
ValueError
|
Input declarations, shapes, dtypes or controls conflict. |
Source code in src/op_engine/equilibrium_stability.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 | |