47.5 KB · commit a9602da
| title | ECE 2213 · 2018 Exam Style Answers |
|---|
RUET · ECE Dept · B.Sc. Engineering 2nd Year Even Semester Examination, 2018 Full Marks: 96 · Time: 03 Hours
A numerical technique obtains the answer of a mathematical problem as a finite sequence of arithmetic operations. Its importance in engineering rests on four points.
1. Problems with no closed form. Most engineering problems have no elementary solution. The integral ∫e−x2dx, the potential in a transistor region, and the motion of three bodies under mutual gravity all require numerical treatment, and all three arise in practice. Where an exact formula exists at all, it is often so long that evaluation is slower and less accurate than a numerical scheme.
2. Only arithmetic executes on a machine. A numerical technique converts a problem into additions, multiplications, comparisons and divisions, which is exactly what a computer or a microprocessor performs. This is what turns an analytic method into something that runs on hardware, and it is the reason numerical techniques accompany every physical engineering discipline.
3. Experimental and tabulated data must be used. Measured data arrive as discrete samples. Any quantity derived from them, whether a derivative, an integral, a regression line or a filter output, is obtained numerically. An engineer working from a data sheet is doing numerical analysis whether or not the word appears.
4. Design and optimisation are iterative. Matching, cut-off placement, bias-point selection and root finding are all performed by repeated improvement of an estimate. Numerical techniques supply the estimate rule, the stopping test and the error estimate that make iteration trustworthy.
The consequence is that a numerical technique is judged not only on whether it converges, but on its cost, its stability, and how its error grows with the number of operations. All three are what the analysis below develops.
Algorithmic error is the error introduced by the computation itself, as opposed to that already present in the data. It has three sources.
1. Truncation error. Every numerical method approximates an infinite process by a finite one: an infinite series is cut after n terms, an interval is cut into n panels, a differential equation is stepped with finite h. The discarded remainder is the truncation error, and it is the error that decreases as the approximation is refined.
2. Round-off error. A computer holds only a finite number of digits. Every arithmetic operation rounds its result to that precision, and the rounding introduced at one step propagates into every later step. Round-off error grows with the number of operations, and is the reason a method may become less accurate when refined too far.
3. Propagation of error. The two above do not simply add. A method is unstable if an error introduced early is amplified in later steps, and well-conditioned if it is damped. The amplification factor is a property of the algorithm, not of the arithmetic precision.
The two errors oppose each other. For a method with step size h, truncation error falls as a power of h while round-off error grows with 1/h (or worse, if the algorithm is unstable). The total error therefore has a minimum at some optimal h, below which further refinement makes the answer worse. This is the central practical fact of numerical computation, and it is why the choice of h, the stopping test and the stability of the recurrence are all parts of the method rather than details of implementation.
The series and its remainder. For 0≤x≤1,
ex=1+x+2!x2+3!x3+⋯+n!xn+⋯
After k terms the remainder is, by Taylor's theorem with Lagrange form,
Rk=k!eξxk,0<ξ<x
Since 0≤x≤1 and eξ≤e, the largest possible remainder is attained at x=1 and
∣Rk∣≤k!e=k!2.718282
"Correct to five decimal places" requires the error to be below 0.5×10−5.
Test k. Taking the successive values:
| k | Tail bound k!1kk+1 | Verdict |
|---|---|---|
| 8 | 403201(89)=2.786×10−5 | too large |
| 9 | 3628801(910)=3.062×10−6 | below 5×10−6 |
Hence the remainder tail is bounded by R9≤3.062×10−6<0.5×10−5, which certifies 9 terms.
Direct check at the worst point x=1. Summing the first nine terms:
S9=1+1+2!1+3!1+4!1+5!1+6!1+7!1+8!1
S9=2+0.5+0.166667+0.041667+0.008333+0.001389+0.000198+0.0000248
S9=2.71827877
and e=2.71828183, so the actual error is
∣e−S9∣=3.06×10−6<0.5×10−5
With eight terms S8=2.71825397, giving ∣e−S8∣=2.79×10−5, which is too large. Nine terms are therefore sufficient, and eight are not.
9 terms
Bisection solves f(x)=0 on an interval [a,b] in which f changes sign, by repeatedly halving the interval and retaining the half that still contains the sign change.
Algorithm.
Convergence. After n bisections the interval has width 2nb−a, and the error in the midpoint is at most 2n+1b−a. Halving the interval therefore halves the error, and the number of iterations needed for error below ε is
n=⌈log2εb−a⌉
Merits and demerits. The method is guaranteed to converge whenever the initial interval brackets a root and f is continuous, and the error is known in advance. It requires only one evaluation of f per step. Its drawbacks are that convergence is slow compared with Newton or regula falsi, that the number of iterations is fixed by the tolerance rather than by the shape of f, and that a bracketing interval must be found first.
Setup. Let x0 and x1 be two points with f(x0)f(x1)<0, so that a root lies between them. Write f0=f(x0) and f1=f(x1).
The idea. Replace f on [x0,x1] by the straight line through (x0,f0) and (x1,f1), and take the intercept of that line with the x-axis as the next approximation.
Derivation. The equation of the chord is
f1−f0y−f0=x1−x0x−x0
The chord meets the x-axis at y=0. Writing the next approximation as x2 and setting y=0:
f1−f0−f0=x1−x0x2−x0
x2−x0=f1−f0−f0(x1−x0)
x2=x0−f1−f0f0(x1−x0)
Equivalent forms. Expanding the numerator:
x2=f1−f0x0f1−x1f0
which shows that x2 is a weighted average of x0 and x1, the weights being the opposing function values. A third form places the unknown on one side:
x2=f1−f0x0f1−x1f0=f1−f0f1x0−f0x1
Continuing. Once x2 is computed, f(x2) is evaluated and either x0 or x1 is replaced by x2, retaining the sub-interval in which the sign change occurs. The same formula is then applied again.
Note on convergence. The method always converges whenever the initial pair brackets the root, since the sign change is preserved. Convergence is linear, and is faster than bisection, because the chord is a better model of f than the midpoint. A drawback is that one end of the bracket may stall, in which case the interval shrinks very slowly; this is the weakness the Illinois modification is designed to repair.
The function and its derivative. Write
f(x)=xsinx+cosx
f′(x)=dxd(xsinx)+dxd(cosx)=(sinx+xcosx)−sinx=xcosx
The sinx terms cancel, which leaves the simple form f′(x)=xcosx.
Sign check for the starting value. Evaluating f at a few points:
| x | f(x)=xsinx+cosx |
|---|---|
| 2.0 | 2(0.90930)+(−0.41615)=1.40245 |
| 2.5 | 2.5(0.59847)+(−0.80114)=0.69504 |
| 3.0 | 3(0.14112)+(−0.98999)=−0.56663 |
The sign changes between 2.5 and 3.0, so a root lies in that interval. Take x0=3.
Newton–Raphson iteration. With
xn+1=xn−xncosxnxnsinxn+cosxn
| n | xn | f(xn) | f′(xn)=xncosxn | xn+1 |
|---|---|---|---|---|
| 0 | 3.0000000 | −0.56663 | −2.96998 | 2.8092132 |
| 1 | 2.8092132 | −0.02864 | −2.65546 | 2.7984273 |
| 2 | 2.7984273 | −1.087×10−4 | −2.63526 | 2.7983860 |
The correction at the last step is 4.1×10−5, already below 10−4, so the value is accepted.
x=2.7984
Physical reading. The equation xsinx+cosx=0 rearranges to x=−cotx, so the root is the first positive point at which the line y=x meets the curve y=−cotx. There is one such point near 2.80, which is the value found.
Use. Lagrange's formula estimates an intermediate value f(x) at a point x within the range of a tabulated set (xi,fi), without requiring the tabulated abscissae to be equally spaced.
The formula. For n+1 points,
f(x)≈i=0∑nfij=0j=i∏nxi−xjx−xj
Why it is used.
Limitations. Adding a new point requires recomputing every coefficient, unlike Newton's divided-difference form where earlier work is retained. The formula is also inefficient for repeated evaluation at many points, where a single polynomial written out once is preferable.
| t (sec) | 0 | 10 | 15 | 20 | 22.5 | 30 |
|---|---|---|---|---|---|---|
| v(t) (m/s) | 0 | 227.04 | 362.78 | 517.35 | 602.97 | 901.67 |
A first-order polynomial is linear interpolation, so the two tabulated points bracketing t=16 are required. They are (15,362.78) and (20,517.35).
The linear polynomial. Through (t0,v0)=(15,362.78) and (t1,v1)=(20,517.35):
v(t)=v0+t1−t0t−t0(v1−v0)
v(t)=362.78+5t−15(517.35−362.78)=362.78+5t−15(154.57)
Evaluate at t=16.
v(16)=362.78+516−15(154.57)=362.78+5154.57
v(16)=362.78+30.914=393.694
v(16)=393.694 m/s
| x | 1 | 2 | 3 | | :---: | :---: | :---: | | f(x) | 0 | 1 | 8 |
Lagrange's formula. With three points,
f(x)=(x0−x1)(x0−x2)(x−x1)(x−x2)f0+(x1−x0)(x1−x2)(x−x0)(x−x2)f1+(x2−x0)(x2−x1)(x−x0)(x−x1)f2
At x=2.5:
L0=(1−2)(1−3)(2.5−2)(2.5−3)=(−1)(−2)(0.5)(−0.5)=2−0.25=−0.125
L1=(2−1)(2−3)(2.5−1)(2.5−3)=(1)(−1)(1.5)(−0.5)=−1−0.75=0.75
L2=(3−1)(3−2)(2.5−1)(2.5−2)=(2)(1)(1.5)(0.5)=20.75=0.375
f(2.5)=0(−0.125)+1(0.75)+8(0.375)=0.75+3.0=3.75
f(2.5)=3.75
Both terms describe a modification of the Gauss-Seidel iteration in which a relaxation parameter ω is introduced.
Relaxed Gauss-Seidel. The ordinary Gauss-Seidel update is replaced by
xi(k+1)=(1−ω)xi(k)+ωx^i(k)
where x^i(k) is the value obtained from the ordinary Gauss-Seidel recursion applied to iteration k.
Under-relaxation, 0<ω<1. Each new iterate is a weighted blend of the old value and the new one, so the sequence moves toward the solution by a fraction of the full step. This damps oscillation and is used when the ordinary iteration diverges or oscillates, because it reduces the effective step and restores convergence at the cost of more iterations.
Over-relaxation, 1<ω<2. Each new iterate overshoots the ordinary Gauss-Seidel value, so the sequence moves toward the solution faster than the plain iteration. The method is then called Successive Over-Relaxation (SOR), and the choice of optimal ω reduces the iteration count substantially.
The two regimes separated by ω=1. At ω=1 the formula reduces to ordinary Gauss-Seidel. Above 1 the iteration is accelerated; below 1 it is stabilised. The purpose in both cases is the same, which is to control the rate at which error is carried from one iteration to the next.
The circuit. A planar four-mesh DC network in a 2×2 arrangement. Mesh 1 (top-left) contains a 10 Ω top branch, a 20 Ω right branch shared with mesh 2, a 25 Ω bottom branch shared with mesh 4, and a connecting wire on the left. Mesh 2 (top-right) contains a 10 A current source in its top branch directed leftward, the shared 20 Ω on its left, a 25 Ω bottom branch shared with mesh 3, and a wire on the right. Mesh 3 (bottom-right) contains the shared 25 Ω on top, a 4 Ω left branch shared with mesh 4, an 8 Ω right branch, and a wire on the bottom. Mesh 4 (bottom-left) contains the shared 25 Ω on top, the shared 4 Ω on the right, a 100 V source on the left directed upward, and a wire on the bottom.

The current-source constraint. The 10 A source occupies the top branch of mesh 2 alone, so the current in that branch is fixed. Taking the mesh currents clockwise, the branch carries I2 and the source opposes it:
I2=−10 A
Mesh 1. Traversing clockwise, the drops are 10I1 across the top branch, 20(I1−I2) across the shared 20 Ω, and 25(I1−I4) across the shared 25 Ω:
10I1+20(I1−I2)+25(I1−I4)=0⟹55I1−25I4=20I2=−200
Mesh 3. Traversing clockwise, 8I3 across the right branch, 25(I3−I2) across the shared 25 Ω, and 4(I3−I4) across the shared 4 Ω:
8I3+25(I3−I2)+4(I3−I4)=0⟹37I3−4I4=25I2=−250
Mesh 4. Traversing clockwise, 25(I4−I1) and 4(I4−I3) across the two shared branches, and the 100 V source entered against the traversal:
25(I4−I1)+4(I4−I3)=100⟹−25I1−4I3+29I4=100
Gauss-Seidel recursions. Solve each equation for its diagonal unknown:
I1(k+1)=55−200+25I4(k)
I3(k+1)=37−250+4I4(k)
I4(k+1)=29100+25I1(k+1)+4I3(k+1)
Note the ordering: I1 and I3 are computed from the old I4, then I4 is computed from the two just-obtained values. Start from I1=I3=I4=0.
| Iteration | I1 | I3 | I4 |
|---|---|---|---|
| 1 | −3.636364 | −6.756757 | −0.618487 |
| 2 | −3.917494 | −6.823620 | −0.870063 |
| 3 | −4.031847 | −6.850818 | −0.972395 |
| 4 | −4.078361 | −6.861880 | −1.014019 |
| 5 | −4.097281 | −6.866380 | −1.030950 |
| 6 | −4.104977 | −6.868211 | −1.037837 |
| 7 | −4.108108 | −6.868955 | −1.040638 |
| 8 | −4.109381 | −6.869258 | −1.041778 |
The solution. The iteration converges, and eliminating gives the same values:
I1=−350114390=−4.1103 A,I3=−350124050=−6.8695 A,I4=−35013650=−1.0426 A
I1=−4.1103 A,I2=−10 A,I3=−6.8695 A,I4=−1.0426 A
| v (V) | 2 | 3 | 4 | 5 | 7 | 10 |
|---|---|---|---|---|---|---|
| i (A) | 5.2 | 7.8 | 10.7 | 13 | 19.3 | 27.5 |
Fit the line i=a+bv by least squares. With n=6:
∑v=31,∑i=83.5,∑v2=203,∑vi=551.7
The normal-equation solution.
b=n∑v2−(∑v)2n∑vi−∑v∑i=6(203)−3126(551.7)−(31)(83.5)=1218−9613310.2−2588.5=257721.7
b=2.8082 A/V
a=iˉ−bvˉ=683.5−2.8082(631)=13.9167−14.5089=−0.5922 A
The regression line.
i=−0.5922+2.8082v
The current at 3.5 V.
i(3.5)=−0.5922+2.8082(3.5)=−0.5922+9.8287=9.2364
i(3.5 V)=9.2364 A
Plotting the fit. The six measured points (v,i) and the fitted line i=−0.5922+2.8082v:

The measured values and residuals against the line are:
| v | measured i | fitted i | residual |
|---|---|---|---|
| 2 | 5.2 | 5.0241 | +0.1759 |
| 3 | 7.8 | 7.8323 | −0.0323 |
| 4 | 10.7 | 10.6405 | +0.0595 |
| 5 | 13 | 13.4486 | −0.4486 |
| 7 | 19.3 | 19.0650 | +0.2350 |
| 10 | 27.5 | 27.4895 | +0.0105 |
The residuals are small compared with the values themselves, the largest in magnitude being 0.4486 against 13, so the line describes the data well. A straight line is a reasonable model for a wire at constant temperature.
Newton's forward formula. For a tabular spacing h, the forward difference interpolation polynomial through n+1 points is
y=y0+pΔy0+2!p(p−1)Δ2y0+3!p(p−1)(p−2)Δ3y0+4!p(p−1)(p−2)(p−3)Δ4y0+⋯
with
p=hx−x0
First derivative. Differentiating term by term, dxd=h1dpd:
dxdy=h1[Δy0+2!2p−1Δ2y0+3!3p2−6p+2Δ3y0+4!4p3−18p2+22p−6Δ4y0+⋯]
Second derivative. Differentiating a second time:
dx2d2y=h21[Δ2y0+3!6p−6Δ3y0+4!12p2−36p+22Δ4y0+⋯]
which simplifies to
dx2d2y=h21[Δ2y0+(p−1)Δ3y0+(2p2−23p+1211)Δ4y0+⋯]
Validity. The formula reproduces dx2d2y exactly for any polynomial of degree four or lower, because every term from Δ5y0 onward then vanishes. For a table of noisy experimental data the higher differences are not zero, and they are also the noisiest entries in the difference table, so the terms beyond the data's smoothness are not worth retaining.
Terms retained. A polynomial of degree n through n+1 points has exactly n+1 coefficients, so for n=1 only the Δy0 term exists, for n=2 the terms up to Δ2y0 exist, and so on. Since y′′ requires differences of order two and above, the formula needs at least three points for a quadratic fit, four for a cubic, and so on. The next term, omitted above, is
(6p3−p2+47p−65)Δ5y0
| x | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 |
|---|---|---|---|---|---|
| y | 0.9320 | 0.9636 | 0.9855 | 0.9975 | 0.9996 |
The differences. With h=0.1:
| 0.9320 | 0.9636 | 0.9855 | 0.9975 | 0.9996 | |
|---|---|---|---|---|---|
| Δ | 0.0316 | 0.0219 | 0.0120 | 0.0021 | |
| Δ2 | −0.0097 | −0.0099 | −0.0099 | ||
| Δ3 | −0.0002 | 0.0000 | |||
| Δ4 | 0.0002 |
The first differences are all positive but falling, and the last of them, 0.0021, is small, so the maximum lies just inside the end of the table, close to but before x=1.6. The backward difference form is the natural one to use from there, since the maximum is at the far end of the table.
The backward derivative. At x=x4=1.6, with q=(x−x4)/h,
dxdy=h1[∇y4+22q+1∇2y4+63q2+6q+2∇3y4+244q3+18q2+22q+6∇4y4]
The backward differences at x4 are
∇y4=0.0021,∇2y4=−0.0099,∇3y4=0.0000,∇4y4=0.0002
Set dxdy=0. Since ∇3y4=0 and ∇4y4 is small, the stationary point is set by the first two terms:
0.0021+22q+1(−0.0099)=0
0.0021=(q+0.5)(0.0099)
q+0.5=0.00990.0021=0.212121
q=−0.287879
x=x4+hq=1.6+0.1(−0.287879)=1.5712
Evaluate y there. Using the backward Newton polynomial with all five points,
y=y4+q∇y4+2q(q+1)∇2y4+6q(q+1)(q+2)∇3y4+24q(q+1)(q+2)(q+3)∇4y4
At q=−0.287879:
y=0.9996+(−0.287879)(0.0021)+2(−0.287879)(0.712121)(−0.0099)+0+24(−0.287879)(0.712121)(1.712121)(2.712121)(0.0002)
y=0.9996−0.0006045+0.0010148−0.0000079=1.0000023
x=1.57 (correct to two decimal places),ymax=1.0000
(i) Eight-segment Simpson's 31 rule. With n=8, h=830−8=2.75, the nodes are t=8, 10.75, 13.5, 16.25, 19, 21.75, 24.5, 27.25, 30.
Evaluating f(t)=2000ln[140000−2100t140000]−9.8t:
| i | ti | f(ti) | weight |
|---|---|---|---|
| 0 | 8.00000 | 177.2667430 | 1 |
| 1 | 10.75000 | 246.3351814 | 4 |
| 2 | 13.50000 | 320.2468886 | 2 |
| 3 | 16.25000 | 399.5165393 | 4 |
| 4 | 19.00000 | 484.7454726 | 2 |
| 5 | 21.75000 | 576.6423135 | 4 |
| 6 | 24.50000 | 676.0501168 | 2 |
| 7 | 27.25000 | 783.9826784 | 4 |
| 8 | 30.00000 | 901.6740015 | 1 |
x≈3h[f0+f8+4(f1+f3+f5+f7)+2(f2+f4+f6)]
=32.75[177.2667430+901.6740015+4(246.3351814+399.5165393+576.6423135+783.9826784)+2(320.2468886+484.7454726+676.0501168)]
The weighted sums are
4(2006.4767126)=8025.9068504,2(1481.0424780)=2962.0849560
x≈32.75(177.2667430+901.6740015+8025.9068504+2962.0849560)=32.75(12066.9325509)
x≈11061.3548 m
(ii) The true error. The exact value of the integral is
xexact=∫830(2000ln[140000−2100t140000]−9.8t)dt=11061.3355 m
Hence the true error is
Et=xexact−x≈11061.3355−11061.3548=−0.0193 m
Et≈−0.0193 m
(iii) The absolute relative error.
∣εt∣=true valuetrue error×100%=11061.3355−0.0193×100%
∣εt∣≈0.00017%
The error bound. The composite trapezoidal rule over [a,b] with n subintervals has error
∣E∣=12(b−a)h2f′′(ξ)≤12(b−a)h2max∣f′′∣
Here a=0, b=1, and
f(x)=1+x2
f′(x)=1+x2x,f′′(x)=(1+x2)3/21
On [0,1] the maximum of ∣f′′∣ is at x=0, where f′′(0)=1. So
∣E∣≤12h2(1)=12h2
Solve for h then n.
12h2<0.01⟹h2<0.12⟹h<0.3464
n=hb−a>0.34641=2.8868
Hence the smallest integer satisfying the bound is
n=3
Direct check. Evaluating the trapezoidal rule:
| n | h | Approximation | Error |
|---|---|---|---|
| 2 | 0.50 | 1.1625704 | 0.014777 |
| 3 | 0.3333 | 1.1543499 | 0.006556 |
At n=2 the error exceeds 0.01, and at n=3 it falls below, confirming n=3.
The method. With h=0.1 and f(x,y)=1−y, the predictor is
y^1=yn+hf(xn,yn)
and the corrector takes the average of the two slopes:
yn+1=yn+2h[f(xn,yn)+f(xn+1,y^1)]
Step 1. x0=0, y0=0, h=0.1.
f(x0,y0)=1−0=1
y^1=0+0.1(1)=0.1
f(x1,y^1)=1−0.1=0.9
y1=0+20.1(1+0.9)=0.05(1.9)=0.095
Step 2. x1=0.1, y1=0.095.
f(x1,y1)=1−0.095=0.905
y^2=0.095+0.1(0.905)=0.1855
f(x2,y^2)=1−0.1855=0.8145
y2=0.095+20.1(0.905+0.8145)=0.095+0.05(1.7195)=0.180975
Step 3. x2=0.2, y2=0.180975.
f(x2,y2)=1−0.180975=0.819025
y^3=0.180975+0.1(0.819025)=0.2628775
f(x3,y^3)=1−0.2628775=0.7371225
y3=0.180975+20.1(0.819025+0.7371225)=0.180975+0.05(1.5561475)=0.2587824
The tabulated solutions.
| x | y |
|---|---|
| 0.1 | 0.0950000 |
| 0.2 | 0.1809750 |
| 0.3 | 0.2587824 |
y(0.1)=0.095,y(0.2)=0.181,y(0.3)=0.259
Rewrite the equation.
dxdy=10x2−y2,y(0)=1
Hence f(x,y)=10x2−y2.
Fourth-order Runge-Kutta. With h=0.1:
k1=f(xn,yn)
k2=f(xn+2h,yn+2hk1)
k3=f(xn+2h,yn+2hk2)
k4=f(xn+h,yn+hk3)
yn+1=yn+6h(k1+2k2+2k3+k4)
Step 1. x0=0, y0=1, so h/2=0.05.
k1=1002−12=−0.1
k2=10(0.05)2−(1+20.1(−0.1))2=100.0025−(0.995)2=100.0025−0.990025=−0.0987525
k3=10(0.05)2−(1+20.1(−0.0987525))2=100.0025−(0.99506238)2=100.0025−0.99014913=−0.09876491
k4=10(0.1)2−(1+0.1(−0.09876491))2=100.01−(0.99012351)2=100.01−0.98034456=−0.09703446
y1=1+60.1(−0.1+2(−0.0987525)+2(−0.09876491)+(−0.09703446))
y1=1+0.0166667(−0.59206928)=0.9901322
Steps 2 to 4. The same procedure applied successively:
| Step | xn | yn | k1 | k2 | k3 | k4 | yn+1 |
|---|---|---|---|---|---|---|---|
| 1 | 0.0 | 1.0000000 | −0.1000000 | −0.0987525 | −0.0987649 | −0.0970345 | 0.9901322 |
| 2 | 0.1 | 0.9901322 | −0.0970362 | −0.0948277 | −0.0948495 | −0.0921669 | 0.9806562 |
| 3 | 0.2 | 0.9806562 | −0.0921687 | −0.0890169 | −0.0890477 | −0.0854301 | 0.9717608 |
| 4 | 0.3 | 0.9717608 | −0.0854319 | −0.0813535 | −0.0813930 | −0.0768566 | 0.9636311 |
Every k1 in the table is f(xn,yn)=(xn2−yn2)/10 at the xn, yn printed beside it, so the y column and the k column are two readings of the same run and must agree at each row.
y(0.4)=0.9636
Full tabulation.
| x | y |
|---|---|
| 0.1 | 0.9901322 |
| 0.2 | 0.9806562 |
| 0.3 | 0.9717608 |
| 0.4 | 0.9636311 |
The mesh. A 3×3 grid over a square region with uniform spacing h, four interior nodes 1 to 4, and Dirichlet boundaries: top 100 V, bottom 0 V, left 75 V, right 50 V.

The stencil. The Laplace finite-difference equation at an interior node is
ui,j=41(ui+1,j+ui−1,j+ui,j+1+ui,j−1)
Leibmann's method is Gauss-Seidel applied to this system: each node is updated from the most recent values of its neighbours as soon as they are available.
The four node equations. Reading the neighbours of each interior node from the figure:
V1=4100+V2+75+V3=4175+V2+V3
V2=4100+50+V1+V4=4150+V1+V4
V3=475+V4+V1+0=475+V1+V4
V4=4V3+50+V2+0=450+V2+V3
As a 4×4 system:
4−1−10−140−1−104−10−1−14V1V2V3V4=1751507550
Leibmann iteration. Starting from V1=V2=V3=V4=0:
| Sweep | V1 | V2 | V3 | V4 |
|---|---|---|---|---|
| 1 | 43.750000 | 48.437500 | 29.687500 | 32.031250 |
| 2 | 63.281250 | 61.328125 | 42.578125 | 38.476563 |
| 3 | 69.726563 | 64.550781 | 45.800781 | 40.087891 |
| 4 | 71.337891 | 65.356445 | 46.606445 | 40.490723 |
| 5 | 71.740723 | 65.557861 | 46.807861 | 40.591431 |
| 6 | 71.841431 | 65.608215 | 46.858215 | 40.616608 |
The solution. The iteration converges, and solving the 4×4 system directly gives
V1=8575=71.875,V2=8525=65.625
V3=8375=46.875,V4=8325=40.625
V1=71.875 V,V2=65.625 V,V3=46.875 V,V4=40.625 V
Convert to a first-order system. Rearranging,
dt2d2y=y+0.5t
Introduce v=dtdy. Then
dtdy=v,dtdv=y+0.5t
with y(0)=2 and v(0)=0.
Euler's method applied to both equations.
yn+1=yn+hvn
vn+1=vn+h(yn+0.5tn)
Step 1. t0=0, y0=2, v0=0.
y1=2+0.1(0)=2.0
v1=0+0.1(2+0)=0.2
Step 2. t1=0.1, y1=2.0, v1=0.2.
y2=2.0+0.1(0.2)=2.02
v2=0.2+0.1(2.0+0.05)=0.2+0.205=0.405
Step 3. t2=0.2, y2=2.02, v2=0.405.
y3=2.02+0.1(0.405)=2.0605
v3=0.405+0.1(2.02+0.1)=0.405+0.212=0.617
Step 4. t3=0.3, y3=2.0605, v3=0.617.
y4=2.0605+0.1(0.617)=2.1222
v4=0.617+0.1(2.0605+0.15)=0.617+0.22105=0.83805
The results.
| t | y | v=y′ |
|---|---|---|
| 0.0 | 2.0000 | 0.0000 |
| 0.1 | 2.0000 | 0.20000 |
| 0.2 | 2.0200 | 0.40500 |
| 0.3 | 2.0605 | 0.61700 |
| 0.4 | 2.1222 | 0.83805 |
y(0.4)=2.1222