pyHarm.NonLinearSolver.ScipyRoot ================================ .. py:module:: pyHarm.NonLinearSolver.ScipyRoot Classes ------- .. autoapisummary:: pyHarm.NonLinearSolver.ScipyRoot.Solver_ScipyRoot Module Contents --------------- .. py:class:: Solver_ScipyRoot(residual, jacobian, solver_options) Bases: :py:obj:`pyHarm.NonLinearSolver.ABCNonLinearSolver.ABCNLSolver` This nonlinear solver is a wrapping of scipy.root nonlinear solver adapted to the interfaces of pyHarm. .. attribute:: factory_keyword keyword that is used to call the creation of this class in the system factory. :type: str .. attribute:: solver_options dictionary containing other options for creation of the solver class. :type: dict .. attribute:: residual function that returns the residual vector of the system to be solved. :type: Callable .. attribute:: jacobian function that returns the jacobian matrix of the system to be solved. :type: Callable .. attribute:: solver_options_root dictionary containing options for the root function. :type: dict .. attribute:: extcall root function of scipy.optimize. :type: Callable .. attribute:: end_status_accepted list of accepted ended status of the non-linear solver. :type: list .. py:attribute:: factory_keyword :type: str :value: 'scipyroot' keyword that is used to call the creation of this class in the system factory. :type: str .. py:attribute:: name :value: 'scipyroot solver' .. py:attribute:: default dictionary containing the default solver_options :type: dict .. py:method:: __post_init__() .. py:method:: Solve(sol: pyHarm.Solver.SystemSolution, SolList: list[pyHarm.Solver.SystemSolution]) -> pyHarm.Solver.SystemSolution Runs the solver. :param sol: SystemSolution that contains the starting point. :type sol: SystemSolution :param SolList: list of previously solved solutions. :type SolList: SystemSolution :returns: SystemSolution solved and completed with the output information. :rtype: sol (SystemSolution) .. py:method:: solution_accepted(S, sol) Updates the flag_accepted attribute of the SystemSolution. :param S: output of root function. :type S: SystemSolution :param sol: SystemSolution that ran into the solver.. :type sol: SystemSolution .. attribute:: flag_accepted SystemSolution in output is considered accepted if True. :type: bool .. py:method:: 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) :param S: output of root function. :type S: SystemSolution :param sol: SystemSolution that ran into the solver. :type sol: SystemSolution :param SolList: list of previously solved solutions. :type SolList: SystemSolution .. py:method:: _complete_solution(S, sol: pyHarm.Solver.SystemSolution, SolList: list[pyHarm.Solver.SystemSolution]) Completes the SystemSolution class with solver informations. :param S: output of root function. :type S: SystemSolution :param sol: SystemSolution that ran into the solver. :type sol: SystemSolution :param SolList: list of previous solved solutions. :type SolList: SystemSolution