autopdex.dae.newton_solver

autopdex.dae.newton_solver(func, x0, atol=1e-08, max_iter=20, damping_factor=1, tangent_fun=None, lin_solve_fun=None, constrained_dofs=None, constrained_values=None, verbose=0, termination_mode='residual')[source]

Newton-Raphson solver to find a root of F(x)=0.

Parameters:
  • func – Function F(x) whose zero is sought.

  • x0 – Initial guess.

  • atol – Absolute tolerance.

  • max_iter – Maximum number of iterations.

  • tangent_fun – Function to compute the Jacobian. (Default: jax.jacfwd(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