Non-Linear BVP

A boundary value problem is nonlinear iff its differential equation cannot be written as

y′′=p(x)y′+q(x)y+r(x)y'' = p(x)y' + q(x)y + r(x)

for functions pp, qq, and rr.

Nonlinear Shooting Method

Choose the initial slope t=y′(a)t=y'(a) so that the IVP solution satisfies y(b)=βy(b)=\beta. For a trial value tt, solve

y′′=f(x,y,y′),y(a)=α, y′(a)=ty'' = f(x,y,y'), \quad y(a) = \alpha,\ y'(a) = t

Define z(x,t)=∂y(x,t)∂tz(x,t) = \dfrac{\partial y(x,t)}{\partial t}. Solve the sensitivity IVP with the original IVP:

z′′=fy(x,y,y′)z+fy′(x,y,y′)z′,z(a)=0, z′(a)=1z'' = f_y(x,y,y')z + f_{y'}(x,y,y')z', \quad z(a) = 0,\ z'(a) = 1

Use Newton’s method on F(t)=y(b,t)−βF(t)=y(b,t)-\beta:

tk=tk−1−y(b,tk−1)−βz(b,tk−1)t_k = t_{k-1} - \frac{y(b,t_{k-1}) - \beta}{z(b,t_{k-1})}
  • Choose an initial guess t0t_0.
  • Solve both IVPs with order 4 Runge-Kutta.
  • Update tt until ∣F(t)∣|F(t)| is sufficiently small.

Nonlinear Finite-Difference Method

Replace derivatives with centered differences. Solve the resulting nonlinear system with Newton’s method.

A unique solution exists iff

  • ff, fyf_y, and fy′f_{y'} are continuous for x∈[a,b]x \in [a,b] and y,y′∈(−∞,∞)y, y' \in (-\infty, \infty)
  • fy(x,y,y′)≥δf_y(x,y,y') \geq \delta for some δ>0\delta > 0
  • A constant kk exists with k=max⁡(∣fy(x,y,y′)∣, ∣fy′(x,y,y′)∣)k = \max\big(|f_y(x,y,y')|,\ |f_{y'}(x,y,y')|\big)

For mesh points x0,…,xN+1x_0, \ldots, x_{N+1}, let y(xi)≈wiy(x_i) \approx w_i. Centered differences give

w0=α,wN+1=β,−wi+1−2wi+wi−1h2+f(xi,wi,wi+1−wi−12h)=0w_0 = \alpha, \quad w_{N+1} = \beta, \quad -\frac{w_{i+1}-2w_i+w_{i-1}}{h^2} + f\left(x_i,w_i,\frac{w_{i+1}-w_{i-1}}{2h}\right) = 0

for i=1,…,Ni = 1, \ldots, N, with truncation error O(h2)O(h^2).

The resulting NN equations are

2w1−w2+h2f(x1,w1,w2−α2h)−α=0−wi−1+2wi−wi+1+h2f(xi,wi,wi+1−wi−12h)=0,i=2,…,N−1−wN−1+2wN+h2f(xN,wN,β−wN−12h)−β=02w_1-w_2+h^2f\left(x_1,w_1,\frac{w_2-\alpha}{2h}\right)-\alpha=0 \\[8pt] -w_{i-1}+2w_i-w_{i+1}+h^2f\left(x_i,w_i,\frac{w_{i+1}-w_{i-1}}{2h}\right)=0, \quad i=2,\ldots,N-1 \\[8pt] -w_{N-1}+2w_N+h^2f\left(x_N,w_N,\frac{\beta-w_{N-1}}{2h}\right)-\beta=0

Solve with Newton’s method. A unique solution exists whenever h<2Lh < \dfrac{2}{L}.

Worked Examples

Example 1

Use the nonlinear shooting method to solve

y′′=(y′)2,0≤x≤1,y(0)=0,y(1)=1y''=(y')^2, \quad 0 \leq x \leq 1, \quad y(0)=0, \quad y(1)=1

Start with t0=y′(0)=0.5t_0=y'(0)=0.5. Use order 4 Runge-Kutta on the mesh x=0,0.25,0.5,0.75,1x=0,0.25,0.5,0.75,1. Stop when the endpoint residual ∣y(1,tk)−1∣|y(1,t_k)-1| is less than 10−510^{-5}.

Solution Reveal Hide

For a trial initial slope tt, set

v=y′,z=∂y∂t,s=z′v=y', \qquad z=\frac{\partial y}{\partial t}, \qquad s=z'

The IVP system for yy and its sensitivity zz is

y′=v,v′=v2,z′=s,s′=2vsy'=v, \qquad v'=v^2, \qquad z'=s, \qquad s'=2vs

with y(0)=0y(0)=0, v(0)=tv(0)=t, z(0)=0z(0)=0, and s(0)=1s(0)=1. Use order 4 Runge-Kutta with h=0.25h=0.25 to solve both IVPs numerically.

For each trial slope, define the endpoint residual F(t)=y(1,t)−1F(t)=y(1,t)-1. The Newton update is

tk+1=tk−F(tk)z(1,tk)t_{k+1}=t_k-\frac{F(t_k)}{z(1,t_k)}

The first RK4 integration gives

y(1,t0)≈0.6930885,F(t0)≈−0.3069115,z(1,t0)≈1.9990825y(1,t_0)\approx0.6930885, \qquad F(t_0)\approx-0.3069115, \qquad z(1,t_0)\approx1.9990825

Thus,

t1=0.5−−0.30691151.9990825≈0.6535262t_1=0.5-\frac{-0.3069115}{1.9990825}\approx0.6535262

Repeating the integrations and Newton updates gives:

kktkt_kF(tk)F(t_k)z(1,tk)z(1,t_k)tk+1t_{k+1}
000.50000000.5000000−0.3069115-0.30691151.99908251.99908250.65352620.6535262
110.65352620.65352620.05932410.05932412.87650032.87650030.63290250.6329025
220.63290250.63290250.00167460.00167462.71707482.71707480.63228620.6322862
330.63228620.63228621.4×10−61.4\times10^{-6}2.71257682.71257680.63228570.6322857
440.63228570.63228579.5×10−139.5\times10^{-13}2.71257312.7125731—

At t4t_4, ∣F(t4)∣≈9.5×10−13<10−5|F(t_4)|\approx9.5\times10^{-13}<10^{-5}. Hence,

y′(0)≈0.6322857y'(0)\approx0.6322857

Example 2

Use the nonlinear shooting method to solve

y′′=y2,0≤x≤1,y(0)=0,y(1)=1y''=y^2, \quad 0 \leq x \leq 1, \quad y(0)=0, \quad y(1)=1

Start with t0=y′(0)=0.5t_0=y'(0)=0.5. Use order 4 Runge-Kutta with step size h=0.25h=0.25. Stop when ∣y(1,tk)−1∣|y(1,t_k)-1| is less than 10−510^{-5}.

Solution Reveal Hide

For a trial initial slope tt, set v=y′v=y', z=∂y/∂tz=\partial y/\partial t, and s=z′s=z'. The IVP system is

y′=v,v′=y2,z′=s,s′=2yzy'=v, \qquad v'=y^2, \qquad z'=s, \qquad s'=2yz

with y(0)=0y(0)=0, v(0)=tv(0)=t, z(0)=0z(0)=0, and s(0)=1s(0)=1. Define F(t)=y(1,t)−1F(t)=y(1,t)-1. The Newton update is

tk+1=tk−F(tk)z(1,tk)t_{k+1}=t_k-\frac{F(t_k)}{z(1,t_k)}

The RK4 integrations and Newton updates are:

kktkt_kF(tk)F(t_k)z(1,tk)z(1,t_k)tk+1t_{k+1}
000.50000000.5000000−0.4786646-0.47866461.08636571.08636570.94061100.9406110
110.94061100.94061100.01774260.01774261.16775941.16775940.92541730.9254173
220.92541730.92541730.00002200.00002201.16486611.16486610.92539840.9253984
330.92539840.9253984<10−5<10^{-5}1.16486251.1648625—

At t3t_3, ∣F(t3)∣<10−5|F(t_3)|<10^{-5}. Therefore,

y′(0)=t3≈0.9253984y'(0)=t_3\approx0.9253984

Wolfram Mathematica notebook

The summary notebook defines every function used in this module, with documentation and no examples, as a starting point for your own problems.

Written by November 6, 2026 3 min read
Was this helpful?