Backward Euler
The backward Euler method is one of the most common methods used to solve ODEs. It is an implicit method of order one but its strenght lies in its A-stability property.
Given a system of ODEs of the form: dydt=f(t,y)y(t0)=y0 ,
If we define u to be the exact solution then we have that: dudt=f(t,u)u(tk)=yk
From these results it can be derived that the local truncation error (LTE) is ek+1=yk+1−u(tk+1)=o(Δt2) .
Inexact Newton
Now we have to solve the non-linear system built up with the backward Euler method. We want to use an inexact Newton solver. The classical Newton method is written as: given a non-linear functions system F(x) = 0 with a given initial condition, solve the linearized system: F′(xk)sk+F(xk)=0xk+1=xk+sk .
In many cases, especially when we don't have an explicit expression for the Jacobian or it can't be inverted, we can use an inexact Newton method: ||F′(xk)sk+F(xk)||≤ηk||F(xk)|| ,
There are two possible choices for the forcing term:
- first choice ηk=||F(xk)−F(xk−1)−F′(xk−1)sk−1||||F(xk−1)|| ;
- second choice ηk=γ(||F(xk)||||F(xk−1)||)α .
Choosing the forcing term with one of the two previous possibilities, rather than imposing a fixed tolerance, it is possible to avoid the phenomenon of oversolving. Another advantage is that if we use the GMRES as the linear solver it's not necessary to know the Jacobian nor to datermine it, because we can approximate the term F′(xk)sk
The signature of inexact_newton is the same of fsolve:
[x,fval,exitflag,output,jacobian]=inexact_newton(fun,x0,options)
Questo commento è stato eliminato dall'autore.
RispondiElimina