pyHarm.NonLinearSolver.ScipyRoot¶
Classes¶
This nonlinear solver is a wrapping of scipy.root nonlinear solver adapted to the interfaces of pyHarm. |
Module Contents¶
- class pyHarm.NonLinearSolver.ScipyRoot.Solver_ScipyRoot(residual, jacobian, solver_options)¶
Bases:
pyHarm.NonLinearSolver.ABCNonLinearSolver.ABCNLSolverThis nonlinear solver is a wrapping of scipy.root nonlinear solver adapted to the interfaces of pyHarm.
- factory_keyword¶
keyword that is used to call the creation of this class in the system factory.
- Type:
str
- solver_options¶
dictionary containing other options for creation of the solver class.
- Type:
dict
- residual¶
function that returns the residual vector of the system to be solved.
- Type:
Callable
- jacobian¶
function that returns the jacobian matrix of the system to be solved.
- Type:
Callable
- solver_options_root¶
dictionary containing options for the root function.
- Type:
dict
- extcall¶
root function of scipy.optimize.
- Type:
Callable
- end_status_accepted¶
list of accepted ended status of the non-linear solver.
- Type:
list
- factory_keyword: str = 'scipyroot'¶
keyword that is used to call the creation of this class in the system factory.
- Type:
str
- name = 'scipyroot solver'¶
- default¶
dictionary containing the default solver_options
- Type:
dict
- __post_init__()¶
- Solve(sol: pyHarm.Solver.SystemSolution, SolList: list[pyHarm.Solver.SystemSolution]) pyHarm.Solver.SystemSolution¶
Runs the solver.
- Parameters:
sol (SystemSolution) – SystemSolution that contains the starting point.
SolList (SystemSolution) – list of previously solved solutions.
- Returns:
SystemSolution solved and completed with the output information.
- Return type:
sol (SystemSolution)
- solution_accepted(S, sol)¶
Updates the flag_accepted attribute of the SystemSolution.
- Parameters:
S (SystemSolution) – output of root function.
sol (SystemSolution) – SystemSolution that ran into the solver..
- flag_accepted¶
SystemSolution in output is considered accepted if True.
- Type:
bool
- check_residual_tol(sol)¶
Checks if residual at the output is below the residual tolerance.
This check is done only if the solver gave an ending status different than 1 (solved with no problem by root function)
- Parameters:
S (SystemSolution) – output of root function.
sol (SystemSolution) – SystemSolution that ran into the solver.
SolList (SystemSolution) – list of previously solved solutions.
- _complete_solution(S, sol: pyHarm.Solver.SystemSolution, SolList: list[pyHarm.Solver.SystemSolution])¶
Completes the SystemSolution class with solver informations.
- Parameters:
S (SystemSolution) – output of root function.
sol (SystemSolution) – SystemSolution that ran into the solver.
SolList (SystemSolution) – list of previous solved solutions.