Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## libmesh-users

 [Libmesh-users] solving nonlinear equations From: yunfei zhu - 2008-10-10 13:59:20 ```Hi, I am solving a set of nonlinear and steady equations. 1. Following ex13, I just create LinearImplicitSystem & system = equation_systems.add_system("axis"); is this correct? or should I creat something like: NonlinearImplicitSystem & system = equation_systems.add_system("axis"); ? 2. In ex13, I am not sure what the following code do. Are these the codes of Newton's method for solving nonlinear equations? Usually, when choice Newton's method, tangent stiffness matrix will be calcualated. But I can not find the corresponding code for achieving this? Thanks in advance for your kind help. *for* (*unsigned* *int* l=0; lzero(); last_nonlinear_soln->add(*navier_stokes_system.solution); perf_log.start_event(*"linear solve"*); equation_systems.get_system(*"Navier-Stokes"*).solve(); perf_log.stop_event(*"linear solve"*); last_nonlinear_soln->add (-1., *navier_stokes_system.solution); last_nonlinear_soln->close(); *const* Real norm_delta = last_nonlinear_soln->l2_norm(); *const* *unsigned* *int* n_linear_iterations = navier_stokes_system.n_linear_iterations(); *const* Real final_linear_residual = navier_stokes_system.final_linear_residual(); *std*::cout << *"Linear solver converged at step: "* << n_linear_iterations << *", final residual: "* << final_linear_residual << *" Nonlinear convergence: ||u - u_old|| = "* << norm_delta << std::endl; *if* ((norm_delta < nonlinear_tolerance) && (navier_stokes_system.final_linear_residual() < nonlinear_tolerance)) { *std*::cout << *" Nonlinear solver converged at step "* << l << std::endl; *break*; } equation_systems.parameters.set (*"linear solver tolerance"*) = *Utility*::pow<2>(final_linear_residual); } *// end nonlinear loop * * * ```