autopdex.dae.newton_solver
- autopdex.dae.newton_solver(func, x0, *, atol=1e-10, rtol=1e-08, max_iter=20, damping_factor=1.0, tangent_fun=None, lin_solve_fun=None, constrained_dofs=None, constrained_values=None, verbose=0, settings=None, static_settings=None, termination_mode='residual', _pre_iteration_update=None)[source]
Newton-Raphson solver to find a root of F(x)=0.
- Parameters:
func – Function F(x, settings (auxiliary data)) whose zero is sought.
x0 – Initial guess.
atol – Absolute tolerance.
rtol – Relative tolerance.
max_iter – Maximum number of iterations.
damping_factor – Constant damping factor for the Newton update (0 < damping_factor <= 1; 1 -> no damping).
tangent_fun – Function to compute the Jacobian. (Default: jax.jacfwd(func)), same signature as func.
lin_solve_fun – Function to solve the linear system. (Default: jnp.linalg.solve)
constrained_dofs – Boolean mask for fixed degrees of freedom.
constrained_values – Fixed values for constrained DOFs.
verbose – If >=1, prints the residual norm each iteration.
termination_mode – ‘residual’ uses the residual norm; ‘update’ uses the update size.
- Returns:
.root: the computed solution,
.num_iterations: number of updates performed,
.converged: convergence flag.
- Return type:
A RootSolverResult dataclass with fields