# M36. Nonlinear stationary equations on shapes in the plane **Package:** A4, its fourth part: stationary equations with a term that is nonlinear in the unknown, on a region that curves bound. The owner gave the package (decision D33.1). ## What was built - **Newton's method on spectral elements.** `shaped.rs` reads an equation $L u + N(\mathbf{x}, u) = f$ with a linear operator $L$ of second order (milestone 35) and solves it by Newton's method. Each step is a linear solve of milestone 35 with the slope of the nonlinear term as one more coefficient. - **A method in the plan**: `element_newton`, with the degree and the spacing of `spectral_elements` and the tolerance and the most steps of Newton's method. - **A starting value.** `guess=` of a problem is taken on a region, as on periodic boxes. - **Documentation**: a section of the guide and of the method page, and the overviews. Verified against exact solutions, from the problem to the solution: the problem of Bratu on the unit disk, whose two solutions are known in closed form, the lower one from zero and the upper one from a starting value. A cubic term with a coefficient that varies, in a medium, on the disk with a hole, with the error falling by more than a factor of 30 from each of the degrees 4, 6, 8 and 10 to the next. $\nabla^2 u - \sinh u = f$ on a triangle with a mix of value and slope. A complex unknown with a cubic term. A problem with slopes all around, which Newton's method cannot start from zero and solves from a starting value. ## What was found - **The residual needs no operator.** With each linear equation solved for the next iterate itself, that iterate satisfies the linear part of the equation, and what the nonlinear equation lacks is a formula in the two iterates at each point. - **The planner is cheap.** It solves at six degrees for the disk with a hole, in less time than the solve at the last one: Newton's method starts each degree from the solution at the one before. ## Decisions ### D36.1. Newton's method solves for the next iterate *Developer, 2026-11-19.* Decision D72 solves nonlinear stationary equations by Newton's method. On a shape the linear solve is direct, which changes what is cheap. - **Each step solves $(L + N'(u_k))\,u_{k+1} = f - N(u_k) + N'(u_k)\,u_k$** with the conditions of the problem, and not an equation for the change. No residual of the operator is needed for the right-hand side, and the first iterate satisfies the conditions whatever the start. - **The residual** of the nonlinear equation at the new iterate is $N(u_{k+1}) - N(u_k) - N'(u_k)(u_{k+1} - u_k)$ at the points where the equation is asked. It is measured against the larger of the source and the nonlinear term, and the tolerance is that of every iteration, $10^{-10}$. - **Steps are halved** from the second step on, until the residual falls. The residual of a shortened step follows from the one before and the same formula. The first step is taken in full, since the residual of the start is not known without the operator. - **A linearized equation without a unique solution** ends the method with a reason, and so does a term that is not finite at the start. - **The slope** $N'$ comes from differentiating the formula, as in decision D72. A term with a derivative of the unknown, or without a derivative with respect to it, is refused. ### D36.2. A method of its own in the plan: `element_newton` *Developer, 2026-11-19.* As `fourier_newton` beside `fourier_iterative`: the plan of a nonlinear equation on a shape names `element_newton`, with `degree`, `spacing`, `tolerance` and `max_steps`. A plan with `spectral_elements` is refused for a nonlinear equation, and the other way round. ### D36.3. The planner carries the solution from degree to degree *Developer, 2026-11-19.* The planner solves on one candidate after another (decision D33.7). For a nonlinear equation each candidate would cost a whole run of Newton's method. On one mesh, the solution at a degree is therefore carried to the points of the next, element by element, and Newton's method starts there. A new mesh starts from the start of the problem. ### D36.4. Small changes outside the lane *Developer, 2026-11-19.* In `analysis.rs`, the refusal of a starting value for a linear problem no longer names the domains on which nonlinear equations are solved, and the test for the magnitude of a complex unknown is shared.