cosapp.drivers.fixedpoint¶
Functions
|
Default factory for dataclass fields. |
Classes
|
Driver attempting to solve the internal cyclic dependencies of its owner System by iteratively running it. |
|
Data class for solver solution |
- class cosapp.drivers.fixedpoint.FixedPointSolver(name='solver', owner: System | None = None, **options)[source]¶
Bases:
DriverDriver attempting to solve the internal cyclic dependencies of its owner System by iteratively running it.
- Parameters:
- get_init() Dict[str, Any][source]¶
Get the initial values used by the solver.
- Returns:
Dictionary of initial values, referenced by variable names.
- Return type:
dict[str, Any]
- is_standalone() bool[source]¶
Is this Driver able to solve a system?
- Returns:
Ability to solve a system or not.
- Return type:
bool
- problem: MathematicalProblem¶
- results¶
- set_init(modifications: Dict[str, Any]) None[source]¶
Define initial values for one or more variables.
The variable can be contextual child1.port2.var. The only rule is that it should belong to the owner System of this driver or any of its descendants.
- Parameters:
modifications (dict[str, Any]) – Dictionary of (variable name, value)
Examples
>>> driver.set_init({'myvar': 42, 'foo.dummy': 'banana'})
- class cosapp.drivers.fixedpoint.SolverResults(x: ~numpy.ndarray = <factory>, r: ~numpy.ndarray = <factory>, success: bool = False, message: str = '', tol: float = nan, n_iter: int = 0)[source]¶
Bases:
objectData class for solver solution
- - x [numpy.ndarray[float]]
Solution vector.
- - r [numpy.ndarray[float]]
Residue vector.
- - success [bool]
Whether or not the solver exited successfully.
- - message [str]
Description of the cause of the termination.
- - tol [float, optional]
Tolerance level; NaN if not available.
- - n_iter [int]
Number of iterations.
- message: str = ''¶
- n_iter: int = 0¶
- r: ndarray¶
- success: bool = False¶
- tol: float = nan¶
- x: ndarray¶