from pylab import *
from scipy.integrate import odeint
from scipy.linalg import solve, norm
The material of this Chapter is from Kincaid & Cheney, 2002 .
Let f : X → Y f : X \to Y f : X → Y and consider the problem: find x ∈ X x \in X x ∈ X such that f ( x ) = 0 f(x) = 0 f ( x ) = 0 . This problem may be difficult to solve. For Newton method, we need a good initial guess, which we may not know.
Suppose we can easily solve the problem: find x ∈ X x \in X x ∈ X such that g ( x ) = 0 g(x) = 0 g ( x ) = 0 . Define
h ( t , x ) = t f ( x ) + ( 1 − t ) g ( x ) h(t,x) = t f(x) + (1-t) g(x) h ( t , x ) = t f ( x ) + ( 1 − t ) g ( x ) Note that
h ( 0 , x ) = g ( x ) , h ( 1 , x ) = f ( x ) h(0,x) = g(x), \qquad h(1,x) = f(x) h ( 0 , x ) = g ( x ) , h ( 1 , x ) = f ( x ) Partition the interval [ 0 , 1 ] [0,1] [ 0 , 1 ] into
0 = t 0 < t 1 < t 2 < … < t m = 1 0 = t_0 < t_1 < t_2 < \ldots < t_m = 1 0 = t 0 < t 1 < t 2 < … < t m = 1 We can easily solve the problem h ( t 0 , x ) = 0 h(t_0,x)=0 h ( t 0 , x ) = 0 , let x 0 x_0 x 0 be the solution. Now to solve the problem h ( t 1 , x ) = 0 h(t_1,x)=0 h ( t 1 , x ) = 0 , say using Newton method, we can use x 0 x_0 x 0 as the initial guess. This process can be continued until we solve the problem h ( t m , x ) = 0 h(t_m,x)=0 h ( t m , x ) = 0 using the initial guess x m − 1 x_{m-1} x m − 1 .
Let f : X → Y f : X \to Y f : X → Y and g : X → Y g : X \to Y g : X → Y . Then f f f and g g g are said to be homotopic if there exists a continuous map h : [ 0 , 1 ] × X → Y h : [0,1] \times X \to Y h : [ 0 , 1 ] × X → Y such that
h ( 0 , x ) = g ( x ) , h ( 1 , x ) = f ( x ) h(0,x) = g(x), \qquad h(1,x) = f(x) h ( 0 , x ) = g ( x ) , h ( 1 , x ) = f ( x ) (h h h is called a homotopy that connects the two functions f f f and g g g .)
1 An ODE ¶ The solution of h ( t , x ) = 0 h(t,x)=0 h ( t , x ) = 0 depends on the parameter t t t , so x ( t ) x(t) x ( t ) satisfies
h ( t , x ( t ) ) = 0 h(t, x(t)) = 0 h ( t , x ( t )) = 0 Differentiate wrt t t t
h t ( t , x ( t ) ) + h x ( t , x ( t ) ) x ′ ( t ) = 0 h_t (t, x(t)) + h_x(t,x(t)) x'(t) = 0 h t ( t , x ( t )) + h x ( t , x ( t )) x ′ ( t ) = 0 so that
x ′ ( t ) = − [ h x ( t , x ( t ) ) ] − 1 h t ( t , x ( t ) ) x'(t) = - [h_x(t,x(t))]^{-1} h_t(t,x(t)) x ′ ( t ) = − [ h x ( t , x ( t )) ] − 1 h t ( t , x ( t )) For this ODE to be valid, we need h h h to be differentiable wrt t t t and x x x and h x h_x h x must be non-singular. Suppose we know that x 0 x_0 x 0 solves h ( 0 , x ) = 0 h(0,x)=0 h ( 0 , x ) = 0 . We solve the ODE upto t = 1 t=1 t = 1 with initial condition x ( 0 ) = x 0 x(0) = x_0 x ( 0 ) = x 0 .
Let X = Y = R 2 X = Y = \re^2 X = Y = R 2 and x = ( ξ 1 , ξ 2 ) ∈ R 2 x = (\xi_1, \xi_2) \in \re^2 x = ( ξ 1 , ξ 2 ) ∈ R 2 . Consider
f ( x ) = [ ξ 1 2 − 3 ξ 2 2 + 3 ξ 1 ξ 2 + 6 ] f(x) = \begin{bmatrix}
\xi_1^2 - 3 \xi_2^2 + 3 \\
\xi_1 \xi_2 + 6 \end{bmatrix} f ( x ) = [ ξ 1 2 − 3 ξ 2 2 + 3 ξ 1 ξ 2 + 6 ] Let x 0 = ( 1 , 1 ) x_0 = (1,1) x 0 = ( 1 , 1 ) and define the homotopy
h ( t , x ) = t f ( x ) + ( 1 − t ) ( f ( x ) − f ( x 0 ) ) h(t,x) = t f(x) + (1-t)(f(x) - f(x_0)) h ( t , x ) = t f ( x ) + ( 1 − t ) ( f ( x ) − f ( x 0 )) Then
h x = f ′ ( x ) = [ ∂ f i ∂ ξ j ] i j = [ 2 ξ 1 − 6 ξ 2 ξ 2 ξ 1 ] , h t = f ( x 0 ) = [ 1 7 ] h_x = f'(x) = \left[ \df{f_i}{\xi_j} \right]_{ij} = \begin{bmatrix}
2\xi_1 & - 6 \xi_2 \\
\xi_2 & \xi_1 \end{bmatrix}, \qquad h_t = f(x_0) = \begin{bmatrix}
1 \\
7 \end{bmatrix} h x = f ′ ( x ) = [ ∂ ξ j ∂ f i ] ij = [ 2 ξ 1 ξ 2 − 6 ξ 2 ξ 1 ] , h t = f ( x 0 ) = [ 1 7 ] h x − 1 = 1 Δ [ ξ 1 6 ξ 2 − ξ 2 2 ξ 1 ] , Δ = 2 ξ 1 2 + 6 ξ 2 2 h_x^{-1} = \frac{1}{\Delta} \begin{bmatrix}
\xi_1 & 6 \xi_2 \\
-\xi_2 & 2\xi_1 \end{bmatrix}, \qquad \Delta = 2\xi_1^2 + 6 \xi_2^2 h x − 1 = Δ 1 [ ξ 1 − ξ 2 6 ξ 2 2 ξ 1 ] , Δ = 2 ξ 1 2 + 6 ξ 2 2 The ODE is given by
d d t [ ξ 1 ξ 2 ] = − h x − 1 h t = − 1 Δ [ ξ 1 + 42 ξ 2 − ξ 2 + 14 ξ 1 ] \dd{}{t}\begin{bmatrix}
\xi_1 \\ \xi_2 \end{bmatrix} = -h_x^{-1} h_t =
-\frac{1}{\Delta} \begin{bmatrix}
\xi_1 + 42 \xi_2 \\
-\xi_2 + 14 \xi_1 \end{bmatrix} d t d [ ξ 1 ξ 2 ] = − h x − 1 h t = − Δ 1 [ ξ 1 + 42 ξ 2 − ξ 2 + 14 ξ 1 ] Integrating the ODE from t = 0 t=0 t = 0 to t = 1 t=1 t = 1 using some numerical ODE solver, we get
x ( 1 ) ≈ [ − 2.961 1.978 ] x(1) \approx \begin{bmatrix}
-2.961 \\
1.978 \end{bmatrix} x ( 1 ) ≈ [ − 2.961 1.978 ] while the exact root is [ − 3 2 ] \begin{bmatrix} -3 \\ 2 \end{bmatrix} [ − 3 2 ] . Starting with the approximate solution of the ODE, perform a few steps of Newton-Raphson iterations to get a more accurate estimate of the root.
If f : R n → R n f : \re^n \to \re^n f : R n → R n is continuously differentiable and if ∥ [ f ′ ( x ) ] − 1 ∥ ≤ M \norm{[f'(x)]^{-1}} \le M ∥ [ f ′ ( x ) ] − 1 ∥ ≤ M on R n \re^n R n , then for any x 0 ∈ R n x_0 \in \re^n x 0 ∈ R n there is a curve { x ( t ) ∈ R n : 0 ≤ t ≤ 1 } \{ x(t) \in \re^n : 0 \le t \le 1 \} { x ( t ) ∈ R n : 0 ≤ t ≤ 1 } such that
h ( t , x ( t ) ) = f ( x ( t ) ) + ( t − 1 ) f ( x 0 ) = 0 , 0 ≤ t ≤ 1 h(t,x(t)) = f(x(t)) + (t-1) f(x_0) = 0, \qquad 0 \le t \le 1 h ( t , x ( t )) = f ( x ( t )) + ( t − 1 ) f ( x 0 ) = 0 , 0 ≤ t ≤ 1 The function t → x ( t ) t \to x(t) t → x ( t ) is continuously differentiable solution of the IVP
x ′ ( t ) = − [ f ′ ( x ( t ) ) ] − 1 f ( x 0 ) , x ( 0 ) = x 0 x'(t) = -[f'(x(t))]^{-1} f(x_0), \qquad x(0) = x_0 x ′ ( t ) = − [ f ′ ( x ( t )) ] − 1 f ( x 0 ) , x ( 0 ) = x 0 2 Relation to Newton method ¶ Consider the homotopy
h ( t , x ) = f ( x ) − e − t f ( x 0 ) h(t,x) = f(x) - \ee^{-t} f(x_0) h ( t , x ) = f ( x ) − e − t f ( x 0 ) so that
h ( 0 , x ) = f ( x ) − f ( x 0 ) , h ( ∞ , x ) = f ( x ) h(0,x) = f(x) - f(x_0), \qquad h(\infty,x) = f(x) h ( 0 , x ) = f ( x ) − f ( x 0 ) , h ( ∞ , x ) = f ( x ) The curve x ( t ) x(t) x ( t ) such that
h ( t , x ( t ) ) = 0 = f ( x ( t ) ) − e − t f ( x 0 ) h(t,x(t)) = 0 = f(x(t)) - \ee^{-t} f(x_0) h ( t , x ( t )) = 0 = f ( x ( t )) − e − t f ( x 0 ) satisfies the ODE
0 = f ′ ( x ( t ) ) x ′ ( t ) + e − t f ( x 0 ) = f ′ ( x ( t ) ) x ′ ( t ) + f ( x ( t ) ) 0 = f'(x(t)) x'(t) + \ee^{-t} f(x_0) = f'(x(t)) x'(t) + f(x(t)) 0 = f ′ ( x ( t )) x ′ ( t ) + e − t f ( x 0 ) = f ′ ( x ( t )) x ′ ( t ) + f ( x ( t )) so that
x ′ ( t ) = − [ f ′ ( x ( t ) ) ] − 1 f ( x ( t ) ) x'(t) = -[f'(x(t))]^{-1} f(x(t)) x ′ ( t ) = − [ f ′ ( x ( t )) ] − 1 f ( x ( t )) Applying forward Euler scheme with Δ t = 1 \Delta t = 1 Δ t = 1 we get
x n + 1 = x n − [ f ′ ( x n ) ] − 1 f ( x n ) x_{n+1} = x_n - [f'(x_n)]^{-1} f(x_n) x n + 1 = x n − [ f ′ ( x n ) ] − 1 f ( x n ) we get the Newton-Raphson method.
We find solution of f ( x ) = 0 f(x) = 0 f ( x ) = 0 by homotopy method applied to
h ( t , x ) = t f ( x ) + ( 1 − t ) ( f ( x ) − f ( x 0 ) ) h(t,x) = t f(x) + (1-t)(f(x) - f(x_0)) h ( t , x ) = t f ( x ) + ( 1 − t ) ( f ( x ) − f ( x 0 )) We solve the ODE
x ′ ( t ) = − [ h x ( t , x ) ] − 1 h t ( t , x ) , x ( 0 ) = x 0 x'(t) = -[h_x(t,x)]^{-1} h_t(t,x), \qquad x(0) = x_0 x ′ ( t ) = − [ h x ( t , x ) ] − 1 h t ( t , x ) , x ( 0 ) = x 0 Let x = ( ξ 1 , ξ 2 ) ∈ R 2 x = (\xi_1, \xi_2) \in R^2 x = ( ξ 1 , ξ 2 ) ∈ R 2 . Consider
f ( x ) = [ ξ 1 2 − 3 ξ 2 2 + 3 ξ 1 ξ 2 + 6 ] f(x) = \begin{bmatrix}
\xi_1^2 - 3 \xi_2^2 + 3 \\
\xi_1 \xi_2 + 6 \end{bmatrix} f ( x ) = [ ξ 1 2 − 3 ξ 2 2 + 3 ξ 1 ξ 2 + 6 ] Let x 0 = ( 1 , 1 ) x_0 = (1,1) x 0 = ( 1 , 1 ) . Then
h x = f ′ ( x ) = [ 2 ξ 1 − 6 ξ 2 ξ 2 ξ 1 ] , h t = f ( x 0 ) = [ 1 7 ] h_x = f'(x) = \begin{bmatrix}
2\xi_1 & - 6 \xi_2 \\
\xi_2 & \xi_1 \end{bmatrix}, \qquad h_t = f(x_0) = \begin{bmatrix}
1 \\
7 \end{bmatrix} h x = f ′ ( x ) = [ 2 ξ 1 ξ 2 − 6 ξ 2 ξ 1 ] , h t = f ( x 0 ) = [ 1 7 ] h x − 1 = 1 Δ [ ξ 1 6 ξ 2 − ξ 2 2 ξ 1 ] , Δ = 2 ξ 1 2 + 6 ξ 2 2 h_x^{-1} = \frac{1}{\Delta} \begin{bmatrix}
\xi_1 & 6 \xi_2 \\
-\xi_2 & 2\xi_1 \end{bmatrix}, \qquad \Delta = 2\xi_1^2 + 6 \xi_2^2 h x − 1 = Δ 1 [ ξ 1 − ξ 2 6 ξ 2 2 ξ 1 ] , Δ = 2 ξ 1 2 + 6 ξ 2 2 The ODE is given by
d d t [ ξ 1 ξ 2 ] = − h x − 1 h t = − 1 Δ [ ξ 1 + 42 ξ 2 − ξ 2 + 14 ξ 1 ] \frac{d}{dt}\begin{bmatrix}
\xi_1 \\ \xi_2 \end{bmatrix} = -h_x^{-1} h_t =
-\frac{1}{\Delta} \begin{bmatrix}
\xi_1 + 42 \xi_2 \\
-\xi_2 + 14 \xi_1 \end{bmatrix} d t d [ ξ 1 ξ 2 ] = − h x − 1 h t = − Δ 1 [ ξ 1 + 42 ξ 2 − ξ 2 + 14 ξ 1 ] This is the function whose roots are required.
def f(x):
y = zeros(2)
y[0] = x[0]**2 - 3*x[1]**2 + 3
y[1] = x[0]*x[1] + 6
return y
def df(x):
y = array([[2*x[0],-6*x[1]],
[x[1], x[0]]])
return y
This is the rhs of the ODE obtained from homotopy method.
def F(x,t):
y = zeros(2)
delta = 2*x[0]**2 + 6*x[1]**2
y[0] = -(x[0] + 42*x[1])/delta
y[1] = -(-x[1] + 14*x[0])/delta
return y
We solve the ode with a relaxed error tolerance.
x0 = array([1.0,1.0])
t = linspace(0,1,100)
x = odeint(F,x0,t,rtol=0.1)
# plot results
plot(t,x), xlabel('t'), ylabel('x(t)'), grid(True)
# Final solution
xf = array([x[-1,0],x[-1,1]])
print('x =',xf)
print('f(x) =',f(xf))
x = [-2.99046055 2.00603356]
f(x) = [-0.12965756 0.00103578]
Now we can improve the final solution by applying Newton-Raphson method.
N = 10
eps = 1.0e-13
print('%18.10e %18.10e %18.10e' % (xf[0], xf[1], norm(f(xf))))
for i in range(N):
J = df(xf)
dx = solve(J,-f(xf))
xf = xf + dx
print('%18.10e %18.10e %18.10e' % (xf[0], xf[1], norm(f(xf))))
if norm(dx) < eps*norm(xf):
break
-2.9904605534e+00 2.0060335560e+00 1.2966169984e-01
-2.9999822220e+00 1.9999926789e+00 6.0518131105e-05
-3.0000000000e+00 2.0000000000e+00 2.0260243223e-10
-3.0000000000e+00 2.0000000000e+00 0.0000000000e+00
-3.0000000000e+00 2.0000000000e+00 0.0000000000e+00
3 Linear programming ¶ Let c , x ∈ R n c,x \in \re^n c , x ∈ R n , A ∈ R m × n A \in \re^{m \times n} A ∈ R m × n , m < n m < n m < n and consider the constrained optimization problem
{ max x ∈ R n c ⊤ x subject to A x = b , x ≥ 0 \begin{cases}
\max\limits_{x \in \re^n} c^\top x \\
\textrm{subject to } A x = b, \qquad x \ge 0
\end{cases} { x ∈ R n max c ⊤ x subject to A x = b , x ≥ 0 Choose a starting point x 0 x^0 x 0 which satisfies the constraints, i.e.
x 0 ∈ F = { x ∈ R n : A x = b , x ≥ 0 } x^0 \in \mathcal{F} = \{ x \in \re^n : A x = b, \quad x \ge 0 \} x 0 ∈ F = { x ∈ R n : A x = b , x ≥ 0 } Our goal is to find x 1 x^1 x 1 such that c ⊤ x 1 > c ⊤ x 0 c^\top x^1 > c^\top x^0 c ⊤ x 1 > c ⊤ x 0 and x 1 ∈ F x^1 \in
\mathcal{F} x 1 ∈ F . Equivalently, find a curve x ( t ) x(t) x ( t ) such that
x ( 0 ) = x 0 x(0) = x^0 x ( 0 ) = x 0
x ( t ) ≥ 0 x(t) \ge 0 x ( t ) ≥ 0 ∀ t ≥ 0 \forall t \ge 0 ∀ t ≥ 0
A x ( t ) = b A x(t) = b A x ( t ) = b
c ⊤ x ( t ) c^\top x(t) c ⊤ x ( t ) is increasing function of t t t , t ≥ 0 t \ge 0 t ≥ 0
Let us try to find an equation satisfied by such a curve x ( t ) x(t) x ( t )
x ′ ( t ) = f ( x ) , x ( 0 ) = x 0 x'(t) = f(x), \qquad x(0) = x^0 x ′ ( t ) = f ( x ) , x ( 0 ) = x 0 To satisfy (2), choose f f f such that f i ( x ) → 0 f_i(x) \to 0 f i ( x ) → 0 as x i → 0 x_i \to 0 x i → 0 . One such choice is
D ( x ) = diag [ x 1 , x 2 , … , x n ] D(x) = \diag{[x_1, x_2, \ldots, x_n]} D ( x ) = diag [ x 1 , x 2 , … , x n ] f ( x ) = D ( x ) G ( x ) , x i ′ = x i G i ( x ) f(x) = D(x) G(x), \qquad x_i' = x_i G_i(x) f ( x ) = D ( x ) G ( x ) , x i ′ = x i G i ( x ) To satisfy (3) we must have A x ′ ( t ) = 0 A x'(t) = 0 A x ′ ( t ) = 0 or A D ( x ) G ( x ) = 0 A D(x) G(x) = 0 A D ( x ) G ( x ) = 0 . Choose
G ( x ) = P ( x ) H ( x ) G(x) = P(x) H(x) G ( x ) = P ( x ) H ( x ) where P : R n → P : \re^n \to P : R n → null space of A D ( x ) AD(x) A D ( x ) . So we can take
P ( x ) = orthogonal projection of x into the null space of A D ( x ) P(x) = \textrm{orthogonal projection of $x$ into the null space of $AD(x)$} P ( x ) = orthogonal projection of x into the null space of A D ( x ) The null space of A D ( x ) AD(x) A D ( x ) is a subspace of R n \re^n R n . By Projection Theorem in Hilbert spaces, we have
∀ v ∈ R n , P v ∈ null space of A D ( x ) \forall v \in \re^n, \qquad Pv \in \textrm{null space of } AD(x) ∀ v ∈ R n , P v ∈ null space of A D ( x ) iff ( v − P v , w ) = 0 ∀ w ∈ null space of A D ( x ) \textrm{ iff } \ip{v-Pv,w} = 0 \quad \forall w \in \textrm{null space of } AD(x) iff ( v − P v , w ) = 0 ∀ w ∈ null space of A D ( x ) In particular
( v − P v , P v ) = 0 , ∀ v ∈ R n \ip{v - Pv, Pv} = 0, \qquad \forall v \in \re^n ( v − P v , P v ) = 0 , ∀ v ∈ R n Such a P P P is given by
P = I − ( A D ) ⊤ [ ( A D ) ( A D ) ⊤ ] − 1 ( A D ) P = I - (AD)^\top [ (AD)(AD)^\top]^{-1} (AD) P = I − ( A D ) ⊤ [( A D ) ( A D ) ⊤ ] − 1 ( A D ) The existence of P P P requires that ( A D ) ( A D ) ⊤ = ( m × n ) ( n × m ) = ( m × m ) (AD)(AD)^\top = (m\times n)(n\times m) = (m \times m) ( A D ) ( A D ) ⊤ = ( m × n ) ( n × m ) = ( m × m ) is invertible, and hence rank A D = m AD = m A D = m . This is true if each
x i > 0 x_i > 0 x i > 0 and rank A = m A=m A = m .
Now (4) will be satisfied by the solution of the ODE if
0 ≤ d d t c ⊤ x ( t ) = c ⊤ f ( x ) = c ⊤ D P ( x ) H ( x ) = ( D c ) ⊤ P ( x ) H ( x ) \begin{aligned}
0 \le& \dd{}{t} c^\top x(t) \\
=& c^\top f(x) \\
=& c^\top D P(x) H(x) \\
=& (Dc)^\top P(x) H(x)
\end{aligned} 0 ≤ = = = d t d c ⊤ x ( t ) c ⊤ f ( x ) c ⊤ D P ( x ) H ( x ) ( Dc ) ⊤ P ( x ) H ( x ) Let us choose H ( x ) = D ( x ) c H(x) = D(x) c H ( x ) = D ( x ) c , then
( D c ) ⊤ P ( D c ) = v ⊤ P v , v = D c = ( v , P v ) = ( v − P v + P v , P v ) = ( v − P v , P v ) + ( P v , P v ) = ( P v , P v ) ≥ 0 \begin{aligned}
(Dc)^\top P (Dc)
=& v^\top P v, \qquad v = Dc \\
=& \ip{v, Pv} \\
=& \ip{v-Pv+Pv,Pv} \\
=& \ip{v-Pv,Pv} + \ip{Pv,Pv} \\
=& \ip{Pv,Pv} \\
\ge& 0
\end{aligned} ( Dc ) ⊤ P ( Dc ) = = = = = ≥ v ⊤ P v , v = Dc ( v , P v ) ( v − P v + P v , P v ) ( v − P v , P v ) + ( P v , P v ) ( P v , P v ) 0 We have constructed an ODE model whose solution has all the required properties. How do we compute P v Pv P v ? Using the definition of P P P requires computing an inverse matrix which can be expensive if the sizes involved are large. Instead, define B = A D B=AD B = A D and given v ∈ R n v \in \re^n v ∈ R n , compute P v Pv P v by the following steps.
Solve for z z z
B B ⊤ z = B v
B B^\top z = Bv B B ⊤ z = B v P v = v − B ⊤ z Pv = v - B^\top z P v = v − B ⊤ z
Now we are in a position to solve the ODE
x ′ ( t ) = D ( x ) P ( x ) D ( x ) c , x ( 0 ) = x 0 ∈ F x'(t) = D(x) P(x) D(x) c, \qquad x(0) = x^0 \in \mathcal{F} x ′ ( t ) = D ( x ) P ( x ) D ( x ) c , x ( 0 ) = x 0 ∈ F The simplest approach is the Euler method which finds x k + 1 ≈ x ( t k + Δ t k ) x^{k+1} \approx x(t_k+\Delta t_k) x k + 1 ≈ x ( t k + Δ t k ) from
x k + 1 − x k Δ t k = f ( x k ) , k = 0 , 1 , 2 , … \frac{x^{k+1} - x^k}{\Delta t_k} = f(x^k), \qquad k=0,1,2,\ldots Δ t k x k + 1 − x k = f ( x k ) , k = 0 , 1 , 2 , … x k + 1 = x k + Δ t k f ( x k ) x^{k+1} = x^k + \Delta t_k f(x^k) x k + 1 = x k + Δ t k f ( x k ) It is easy to verify that A x k + 1 = b Ax^{k+1}=b A x k + 1 = b since A f ( x k ) = 0 Af(x^k) = 0 A f ( x k ) = 0 . It remains to ensure that x k + 1 > 0 x^{k+1} > 0 x k + 1 > 0 which may not be automatically satisfied by the Euler method. We can satisfy this condition by choosing Δ t k \Delta t_k Δ t k small enough,
x i k + 1 = x i k + Δ t k f i ( x k ) ≥ 0 x_i^{k+1} = x_i^k + \Delta t_k f_i(x^k) \ge 0 x i k + 1 = x i k + Δ t k f i ( x k ) ≥ 0 e.g.,
Δ t k = 9 10 min i [ − x i k f i ( x k ) ] \Delta t_k = \frac{9}{10} \min_{i} \left[ \frac{-x_i^k}{f_i(x^k)} \right] Δ t k = 10 9 i min [ f i ( x k ) − x i k ] The factor 9 / 10 9/10 9/10 ensures the strict inequality x k + 1 > 0 x^{k+1} > 0 x k + 1 > 0 .