RUET · ECE Dept · B.Sc. Engineering 2nd Year Even Semester Examination, 2020
This file explains the same questions as
the 2020 answer script, written to be read
rather than copied. Every step is named, the reason a formula is chosen is
stated, and the traps that catch people are called out.
SECTION A
Question 1
(a) Why are numerical methods for? What are the sources of errors in numerical methods? Discuss them.
[Marks: 06]
Why we need them. Most engineering problems have no closed-form answer.
No analytic solution exists. A coupled circuit, a heat exchanger, a
transmission line, a semiconductor device. The governing equation is known and
the answer is not.
The scale kills hand algebra. A discretised PDE gives thousands of
unknowns. A million from a fine mesh. No symbolic route exists.
Data arrive irregular. Measurements are unevenly spaced and noisy.
Interpolation and least squares take them as they come.
Experiments are expensive. A simulation can be rerun at any parameter
value, for free, long before the hardware is built.
Design needs iteration. An optimiser calls the solver hundreds of times
while it searches.
No closed form exists, the data are irregular, and design needs many repeated solves
Sources of error. Two families, both of which must be tracked.
Error
What it is
Where it comes from
How to fight it
Truncation
The method is not exact
Replacing a derivative by a finite difference, or cutting an infinite series
Use a higher-order formula, or a smaller h
Round off
Digits are lost
Floating point is finite, and each operation adds a small error
Use higher precision, or reformulate to cancel less
Truncation error in detail. For a central difference,
2hf(x+h)−f(x−h)=f′(x)+6h2f′′′(x)+⋯
Hence the error is O(h2): halving h reduces it by a factor of 4. For the
trapezoid rule it is O(h2) too. For Euler's method it is only O(h), so halving
h halves the error. The order of accuracy fixes the error for a given step size.
Round off error in detail. A number with p significant digits carries a
relative uncertainty near 10−p. Every addition roughly doubles the absolute
error of the operands, and every multiplication squares the relative error. With
n sequential steps the errors accumulate, giving a growth like nϵ for
additions.
(b) How are errors represented? Write down their expressions. Obtain their values to approximate a current as 9.05 Amp instead of its true value 10 Amp. Justify, which representation is better.
[Marks: 06]
Definitions. Let vt be the true value and va the approximate value.
Absolute error. The size of the mistake, in the units of the quantity.
Ea=va−vtor∣Ea∣=∣va−vt∣
It is the only error directly measurable, and it carries the same units as the
answer.
Relative error. The mistake as a fraction of the true value. It is
dimensionless, so it can be compared across quantities of different size.
The sign says the approximation is low, which absolute error alone cannot
give a quantity that can be reasoned about directly.
Representation
Value
Units
Absolute error
0.95
Amp
Relative error
0.095
none
Percentage relative error
9.5%
none
∣Ea∣=0.95 Amp,Er=−0.095,percentage=−9.5%
Which is better, and why.Relative error is the better representation, for
three reasons.
It is scale-free. A 0.95 Amp error is trivial on a 10 kA line and
fatal on a 10 mA sensor. The relative error says 9.5% in both cases, so it
ranks the two directly.
It survives unit changes. Measure the same current in milliamps and the
absolute error becomes 950 mA, which looks ten times worse. The relative
error is still 0.095. The relative error is invariant.
It is what stopping criteria use. A solver halts when the relative step
falls below a tolerance, so that the test means the same thing at any
magnitude.
Where absolute error wins: when the quantity is itself an error, a tolerance, or
a dimensional quantity where a fraction makes no sense, such as a length or a
time. Reporting "the beam is off by 2 mm" beats "off by 0.4%".
Question 2
(a) Define roots of an equation. List the comparisons among bisection, secant, false position and Newton-Raphson methods.
[Marks: 06]
Root of an equation. A root of f(x)=0 is a value x∗ with f(x∗)=0.
The graph of f crosses or touches the x-axis at x∗.
A root is simple if f′(x∗)=0, and multiple (or repeated) if
f′(x∗)=0. The distinction matters because the methods below all assume a
simple root; a repeated root makes their convergence much slower.
A root is explicit if it can be written in closed form, and implicit if it
can only be found numerically. 2 is explicit. The root of
x5−x−1=0 is implicit.
The four methods compared.
Bisection
False position
Secant
Newton-Raphson
Type
Bracketing
Bracketing
Open
Open
Needs f′
No
No
No
Yes
Needs a sign change
Yes
Yes
No
No
Information used
Endpoints only
Endpoints, keeps one fixed
Last two points
Value and slope at one point
New point from
Midpoint
Chord crossing
Chord through last two
Tangent at last point
Convergence order
1 (linear)
1, often faster
1.618 (golden ratio)
2 (quadratic)
Starts from
a0
a0
x0,x1
x0 only
Guaranteed
Yes, from any valid bracket
Yes
No
No
Function calls per step
1
1
1
2 (value and derivative)
Weakness
Slow, and halves the interval
Stalls on one side for strong convexity
Can diverge, can lose the bracket
Sensitive to the start
Bracketing methods are safe and slow; open methods are fast and unguaranteed
How they relate. They form a ladder from safest to fastest.
Bisection is the safety net. It only needs a sign change, and it can never
fail. That guarantee is why it survives in production codes.
False position uses the same bracket but wastes it, because it keeps only
one endpoint and lets the other run away. Faster than bisection, but it stalls
on strongly convex functions, as 2021 Q.2(b) shows on x2.2=69.
Secant throws the bracket away and fits a line through the last two
points. The order 1.618 is better than the labels "linear" suggest.
Newton throws away the history except one point and uses the slope. It
converges quadratically, so it is the method of choice when f′ is available
and the start is good.
The practical rule. Keep a bracket. Try Newton. If a step leaves the bracket,
take a bisection step instead. This hybrid keeps Newton's speed and bisection's
guarantee, and it is what real root finders do.
(b) An electrical power equation is given as follows: 3I2−4I−4=0. Calculate 3 iterations of the Newton-Raphson method to obtain the value of current.
[Marks: 06]
Step 1. Set up.
f(I)=3I2−4I−4,f′(I)=6I−4
Step 2. Choose a starting value. The paper prints none, so pick one and say
so. A current is a positive quantity, and
f(1)=3−4−4=−5<0,f(3)=27−12−4=11>0
Hence a root lies in (1,3). Take the left end, I0=1.
Step 3. The iteration.
In+1=In−f′(In)f(In)=In−6In−43In2−4In−4
Step 4. Three iterations.
At I0=1: f(1)=−5 and f′(1)=2.
I1=1−2−5=1+2.5=3.500000
At I1=3.5: f(3.5)=3(12.25)−14−4=36.75−18=18.75 and
f′(3.5)=21−4=17.
I2=3.5−1718.75=3.5−1.102941=2.397059
At I2=2.397059: f=3(5.745893)−9.588236−4=17.237679−13.588236=3.649443
and f′=14.382354−4=10.382354.
I3=2.0456 Amp after three iterations, and the true root is I=2 Amp
Step 5. Check the exact root. The quadratic formula settles it:
I=64±16+48=64±8
which gives I=2 and I=−32. Only I=2 is a physical current,
and I3=2.045555 is closing on it.
Question 3
(a) What is the main difference between interpolation and extrapolation? Where are they used?
[Marks: 03]
The difference.
Interpolation
Extrapolation
Target x
Inside the data range, xmin≤x≤xmax
Outside it
What the curve is doing
Bridging a known span
Continuing past the last data point
Reliability
High, the data surround the target
Low, the polynomial is unsupported there
Typical error
Small
Grows rapidly with distance
What it assumes
The function is smooth in the region
The function stays smooth outside the region, which nothing guarantees
Interpolation fills a gap the data surround; extrapolation guesses past the edge
The reason extrapolation is risky. A polynomial of degree n through n+1
points matches the data exactly and says nothing at all beyond the last node. The
error term is
f(x)−Pn(x)=(n+1)!f(n+1)(ξ)i=0∏n(x−xi)
and outside the range that product grows while the points give no control
over f(n+1). A curve that is flat over the sampled region can turn over
completely just beyond it.
Where interpolation is used. Reading a value off a mathematical function at
an inconvenient argument. Values defined by interpolation in a standard, such as
a density table or a steam table. Reproducing a signal between samples, for
example a sine wave reconstructed from discrete samples.
Where extrapolation is used. Forecasting beyond the last observation, such as
a population projection or a demand forecast. Continuing a trajectory in time from
sampled position data, as in Q.3(b) below. Filling a small gap just past the edge
of a measured range. Using a Taylor series about a known point.
The shared caution: interpolation needs the data to bracket the target, and
extrapolation needs the underlying function to stay well behaved past the edge.
Only the first is under control.
(b) The population of a town in the decennial census was as given below. Estimate the population for the year (i) 1895 and (ii) 1925.
[Marks: 04]
Year x
1891
1901
1911
1921
1931
Population y (thousands)
46
66
81
93
101
Step 1. Both targets lie inside the data range [1891,1931].
The target 1895 lies in the first subinterval [1891,1901], four years after the initial node x0=1891. Because it is near the beginning of the table, Newton's forward difference formula is the canonical choice (with p=101895−1891=+0.4, so ∣p∣<1).
The target 1925 lies in the last subinterval [1921,1931], six years before the terminal node xn=1931. Because it is near the end of the table, Newton's backward difference formula is the canonical choice (with p=101925−1931=−0.6, so ∣p∣<1).
Both problems are genuine interpolations (not extrapolations). We construct the difference table and apply each formula with its optimal base node.
Step 2. Difference table. Here h=10 years.
x
1891
1901
1911
1921
1931
y
46
66
81
93
101
Δy
20
15
12
8
Δ2y
−5
−3
−4
Δ3y
2
−1
Δ4y
−3
From the table:
Forward differences from x0=1891:y0=46,Δy0=20,Δ2y0=−5,Δ3y0=2,Δ4y0=−3
Backward differences from xn=1931:yn=101,∇yn=8,∇2yn=−4,∇3yn=−1,∇4yn=−3
Step 3. The formulas.
Newton's Forward Interpolation Formula (p=hx−x0):
y(x)=y0+pΔy0+2!p(p−1)Δ2y0+3!p(p−1)(p−2)Δ3y0+4!p(p−1)(p−2)(p−3)Δ4y0
Newton's Backward Interpolation Formula (p=hx−xn):
y(x)=yn+p∇yn+2!p(p+1)∇2yn+3!p(p+1)(p+2)∇3yn+4!p(p+1)(p+2)(p+3)∇4yn
Step 4. Part (i), the year 1895 (Newton's Forward Interpolation).
For x=1895, choose x0=1891 (beginning of table):
p=101895−1891=+0.4
Using forward differences from x0=1891:
Term
Working
Value
Running
y0
46
46.000000
pΔy0
(0.4)(20)
+8.0
54.000000
2p(p−1)Δ2y0
2(0.4)(−0.6)(−5)=(−0.12)(−5)
+0.6
54.600000
6p(p−1)(p−2)Δ3y0
6(0.4)(−0.6)(−1.6)(2)=(0.064)(2)
+0.128
54.728000
24p(p−1)(p−2)(p−3)Δ4y0
24(0.4)(−0.6)(−1.6)(−2.6)(−3)=(−0.0416)(−3)
+0.1248
54.852800
y(1895)=54.8528 thousand≈54853
(Note on alternative route: Applying Newton's backward difference formula from xn=1931 with p=101895−1931=−3.6 gives 101+(−3.6)(8)+2(−3.6)(−2.6)(−4)+6(−3.6)(−2.6)(−1.6)(−1)+24(−3.6)(−2.6)(−1.6)(−0.6)(−3)=101−28.8−18.72+2.496−1.1232=54.8528, identically matching the forward result).
Step 5. Part (ii), the year 1925 (Newton's Backward Interpolation).
For x=1925, choose xn=1931 (end of table):
p=101925−1931=−0.6
Using backward differences from xn=1931:
Term
Working
Value
Running
yn
101
101.000000
p∇yn
(−0.6)(8)
−4.8
96.200000
2p(p+1)∇2yn
2(−0.6)(0.4)(−4)=(−0.12)(−4)
+0.48
96.680000
6p(p+1)(p+2)∇3yn
6(−0.6)(0.4)(1.4)(−1)=(−0.056)(−1)
+0.056
96.736000
24p(p+1)(p+2)(p+3)∇4yn
24(−0.6)(0.4)(1.4)(2.4)(−3)=(−0.0336)(−3)
+0.1008
96.836800
y(1925)=96.8368 thousand≈96837
(c) Define curve fitting. Also determine the constants a and b by the method of least squares such that y=aebx fits the following data.
[Marks: 05]
Curve fitting. Finding the constants of a chosen function form so that it
comes as close as possible to a set of data points. Unlike interpolation, the
curve is not required to pass through the points. It is the right tool when
the data carry measurement error, or when more points are given than a polynomial
of the wanted degree needs.
Step 1. Linearise. The model y=aebx is nonlinear in the unknowns
eb and a. Taking natural logarithms makes it linear:
lny=lna+bx
Let Y=lny, A=lna and B=b. Then Y=A+Bx, which is a straight
line, and the method of least squares applies to the logarithms.
Every residual is below 7×10−5 in log space, so the straight line in
lny against x is an excellent description of the data.
Question 4
(a) What are the direct methods to solve linear system of equations? Describe any one of them.
[Marks: 06]
The system. To solve
Ax=b,A=[aij]∈Rn×n
Direct methods produce the exact solution in a fixed number of steps, decided
in advance by n. They do not iterate toward the answer, which is what
distinguishes them from iterative methods.
The two families.
Elimination methods. Reduce the augmented system to upper triangular form
by elementary row operations, then back-substitute. Examples: Gaussian
elimination, Gauss-Jordan elimination, and LU factorisation.
Matrix factorisation methods. Write A as a product of simpler matrices
and solve the pieces in sequence. Examples: Crout, Cholesky
(symmetric positive definite only), QR.
Everything else is a variant of one of these two ideas.
Described: Gaussian elimination with partial pivoting.
Write the augmented matrix [A∣b]. For column k, find the row
p≥k with the largest ∣apk∣, and swap rows k and p. Then
eliminate the entries below the pivot:
for i=k+1,…,n:mik=akkaik,rowi←rowi−mikrowk
This makes every entry below the diagonal of column k zero. Repeat for
k=1,2,…,n−1. The result is upper triangular:
a110⋮0a12a220⋯⋯⋱⋯a1na2n⋮annx=c
Now back-substitute from the bottom:
xn=anncn,xi=aii1(ci−j=i+1∑naijxj)
Worked micro-example. Solve 2x+y=5 and x−y=1.
[211−1∣∣51]
Pivot in column 1 is 2; the row 2 entry is 1, so no swap is needed.
m21=21, and row 2 becomes
[0,−1−21∣1−25]=[0,−23∣−23].
Back-substitute: y=−3/2−3/2=1, then 2x=5−1=4 so x=2.
x=2,y=1
Check: 2(2)+1=5 and 2−1=1. Both hold.
Eliminate to upper triangular form, pivot to stay safe, then back-substitute
Why pivoting is not optional. The step divides by the pivot. A zero pivot
stops the method dead. A tiny pivot is worse, because the multiplier
mik=akkaik becomes huge, and subtracting large nearly equal
numbers destroys most of the significant digits. The method still runs and returns
a wrong answer, with no warning. Partial pivoting costs one comparison per
candidate and no extra arithmetic, and it is the standard safeguard.
Method
Work
Storage
Notes
Gaussian elimination
32n3
n2
Triangular solve is O(n2)
Gauss-Jordan
n3
n2
Gives the inverse directly
LU factorisation
32n3
n2
Reuse the factors for many right sides
Cholesky
31n3
21n2
Half the work, but needs A symmetric positive definite
Direct against iterative. Direct methods cost O(n3) and are unbeatable for
small and dense systems. But n3 becomes hopeless: at n=104 it is 1012
operations, and the matrix alone needs 8×107 entries. Large sparse
systems, which is what discretised PDEs produce, are handled by iterative methods
that touch only the non-zero entries. The Gauss-Seidel method in Q.4(b) is the
other side of that trade.
(b) Solve I1, I2 and I3 using Gauss-Seidal method.
[Marks: 06]
Figure 2020 Q4(b): three-mesh DC circuit with an independent voltage source and an independent current source (Source: Page 1, Q4(b))
Step 1. Deal with the current source first. Mesh 3 is bounded on the right by
an ideal 10 A current source and on the left by the 100Ω resistor
shared with mesh 2. A current source fixes the branch current, so the clockwise
mesh current is
I3=10 A
This is the step that trips people up. A current source in a branch forces I3
to equal it, full stop, and it drops out of the system entirely.
Step 2. Mesh 1, KVL. Going clockwise around the left loop: rise 400 V
through the source, drop across the 20Ω, then across the shared
40Ω which carries I1−I2 because I2 returns through it.
−400+20I1+40(I1−I2)=0
60I1−40I2=400
Step 3. Mesh 2, KVL. The 40Ω carries I2−I1, the 10Ω
carries I2 alone, and the 100Ω carries I2−I3.
40(I2−I1)+10I2+100(I2−I3)=0
−40I1+150I2=100I3=1000
Step 4. The system to iterate. Three equations, but I3 is already known, so
two unknowns remain:
{60I1−40I2=400−40I1+150I2=1000
Solve each for its own variable, newest value first:
⎩⎨⎧I1=6040I2+400I2=1501000+40I1
Step 5. Gauss-Seidel. Use the value just computed, never the previous
iteration's. Start from I1(0)=I2(0)=0.
k
I1
I2
0
0.000000
0.000000
1
6.666667
8.444444
2
12.296296
9.945679
3
13.297119
10.212565
4
13.475043
10.260012
5
13.506674
10.268447
6
13.512298
10.269946
7
13.513297
10.270213
8
13.513475
10.270260
9
13.513507
10.270268
10
13.513512
10.270270
Iteration 1: I1(1)=6040(0)+400=6.666667, then
I2(1)=1501000+40(6.666667)=1501000+266.6667=8.444444.
Step 6. Answer.
I1=13.5135 A,I2=10.2703 A,I3=10.0000 A
Question 5
(a) Deduce the Newton's forward difference interpolating polynomial.
[Marks: 06]
Set up. For n+1 equally spaced points with common difference h, write
x=x0+ph so that p=hx−x0. The forward difference operator is
Δy0=y1−y0.
Step 2. Express the derivatives through differences. For a polynomial sampled at
spacing h, the k-th derivative at x0 satisfies
y(k)(x0)=hkΔky0
because each forward difference lowers the degree of the underlying polynomial by
one and contributes a factor of h.
Step 3. Substitute. The factors of h cancel term by term:
y(x)=y0+pΔy0+2!p2Δ2y0+3!p3Δ3y0+⋯
Step 4. Replace the rising powers by falling products. This is the step that
produces the standard form. The identity needed is
pk=j=0∑ks(k,j)p(p−1)(p−2)⋯(p−j+1)
where s(k,j) is a Stirling number of the second kind, and the empty product for
j=0 equals 1. Equivalently, shifting the index,
pk=∑j=0k−1s(k,j+1)p(p−1)⋯(p−j). Spot check at k=2:
1⋅p+1⋅p(p−1)=p2.
More directly, Newton's interpolation polynomial for a node set is
Validity. Accurate for 0≤p≤n, that is inside the table. Near the far
end use backward differences instead, and outside the table the result is an
extrapolation with the risks listed in Q.3(a). Part (b) applies this to unequally
spaced data, where divided differences are used instead.
(b) Using Newton's divided difference interpolating polynomial estimate the value of signal s(t) at t=2.25 sec for the following tabulated values.
[Marks: 06]
t
0.5
0.2
1.4
2.2
3.0
s(t)
−10.25
−3.768
5.976
28.972
79.0
Step 1. Build the divided difference table. Each entry divides by the
x-difference of the two nodes it spans.
Both are Newton-Cotes rules: they fit a polynomial through the data at
equally spaced nodes and integrate that polynomial exactly over the panel. They
differ in how many nodes each panel uses and therefore in which interval counts
each admits.
Simpson's 1/3
Simpson's 3/8
Subintervals per panel
2
3
Nodes per panel
3
4
Weights
1,4,1
1,3,3,1
Prefactor
3h
83h
Panel interval count
Must be even
Must be a multiple of 3
Total intervals n
Even
Multiple of 3
Order of accuracy
4
4
Leading error term
−90h5f(4)
−803h5f(4)
Error constant
901=0.0111
803=0.0375
Both are fourth order, so both need a function with f(4) continuous over
the range. Neither is fourth order on a function with a discontinuous fourth
derivative, and neither is safe near a vertical asymptote or a jump.
Both are fourth order; 1/3 is more accurate at equal h but needs an even interval count
The accuracy difference. With the same h, Simpson's 3/8 has a leading
error constant 1/903/80=3.375 times larger than 1/3. So for equal
h, 1/3 is more accurate, and 1/3 is the default choice.
The one place 3/8 wins. When the total interval count is odd, 1/3 is
inapplicable while 3/8 can still be used, provided the count is a multiple of
3. Five intervals is the standard case: 1/3 is stuck, 3/8 takes three of
them and something else takes two. That exact situation is in Q.6(b) below.
Standard mixed strategy for an odd n not divisible by 3, for example
n=5: apply 3/8 to the last three intervals and 1/3 to the remaining two,
or apply 1/3 to the largest even block and the trapezoid rule to the leftover
one interval. Both appear in Q.6(b).
(b) A circuit is giving following output voltage equation: v0=−RC1∫0tvi(t)dt where R=10 kΩ,C=1μF. Use Simpson's 1/3rd rule to find v0 at t=1.25.
[Marks: 05]
t
0
0.25
0.50
0.75
1.00
1.25
vi(t)
1
0.9793
0.9195
0.8261
0.7081
0.6201
Step 1. The constant.
RC=(10×103)(1×10−6)=10−2 s=0.01 s,RC1=100 s−1
Step 2. The integral. Take h=0.25 s. The largest even block is
t=0 to t=1.00, four intervals, and the leftover interval
t=1.00 to 1.25 goes to the trapezoid rule.
Simpson's 1/3 on 0 to 1.00, with weights 1,4,2,4,1:
Step 3. The output voltage. The leading minus sign comes from the inverting
amplifier that realises the equation, and it must be carried through.
v0=−RC1I=−100(1.06341667)=−106.341667
v0(1.25)=−106.34 V
(c) The following table gives the angular displacements θ (radian) at different time intervals of time t (sec). Calculate the angular velocity at the instant t=0.06 sec.
[Marks: 04]
t
0
0.02
0.04
0.06
0.08
0.10
0.12
θ
0.052
0.105
0.168
0.242
0.327
0.408
0.489
Step 1. Angular velocity is the derivative.ω=dtdθ, so
this is numerical differentiation of a table with h=0.02 s.
Step 2. t=0.06 is an interior node. Data exist on both sides, at 0.04
and 0.08, so the three-point central formula applies and is both the most
accurate of the three-point formulas and the natural one here.
(a) Derive modified Euler's method. What is the major limitation of Euler's method?
[Marks: 04]
Euler's method, for reference. For dxdy=f(x,y) with
y(x0)=y0 and step h,
yn+1=yn+hf(xn,yn)
It takes the slope at the left endpoint of the interval and assumes it holds
across the whole interval. The local truncation error is O(h2) and the global
error is O(h), so the method is first order.
Step 1. The idea of the modification. Euler's weakness is that it uses only
one slope per step and that slope is at the wrong end. Average two slopes, one at
each end of the interval, and the error drops by a whole order.
Step 2. Compute the slope at the left end. Predict with plain Euler:
yp=yn+hf(xn,yn)
Step 3. Compute the slope at the right end, using that predicted value:
The major limitation is that the method is only first order, so the global
error is O(h): halving h only halves the error.
(b) Solve, by Euler's method, the equation dxdy=x+y,y(0)=0. Choose h=0.2 and compute y(0.4) and y(0.6).
[Marks: 04]
Step 1. The method. With f(x,y)=x+y and h=0.2,
yn+1=yn+0.2(xn+yn),xn+1=xn+0.2
Start at x0=0, y0=0.
Step 2. Three steps.
Step
xn
yn
Slope xn+yn
yn+1=yn+0.2×slope
1
0.0
0.000000
0.0+0.0=0.0
0.0+0.2(0)=0.000000
2
0.2
0.000000
0.2+0.0=0.2
0.0+0.2(0.2)=0.040000
3
0.4
0.040000
0.4+0.04=0.44
0.04+0.2(0.44)=0.128000
Step 1 in full: the slope at x=0 is 0+0=0, so y1=0+0.2(0)=0.
The curve leaves the origin horizontally, which is correct since y′=x+y is
zero at the origin.
y(0.4)=0.0400,y(0.6)=0.1280(h=0.2)
(c) Given, dxdy=y−x, where y(0)=2, find y(0.1) and y(0.2) by using Runge-Kutta second order formula.
[Marks: 04]
Step 1. The method. For dxdy=f(x,y) with y(x0)=y0 and step
h, the second-order Runge-Kutta method is
Here f(x,y)=y−x and the paper gives no step size. Two steps are needed to
reach 0.2, so take h=0.1, which also matches the requested output points.
Start at x0=0, y0=2.
each interior value being the average of its four neighbours plus a source term.
The general iterative scheme. Write the system as Au=b and
split A=D−(L+U), where D is the diagonal and L+U the rest. Then
u(k+1)=D−1[b+(L+U)u(k)]=Gu(k)+c
and iterate until the change falls below a tolerance. Three variants differ only
in which values G uses:
Method
Uses
Convergence for elliptic problems
Jacobi
the whole previous iterate
Slow; needs many sweeps
Gauss-Seidel
the newest values available
Faster; usually the default
SOR
newest values plus a relaxation factor ω
Fastest; the standard choice for large grids
Convergence. Gauss-Seidel converges when the matrix is strictly diagonally
dominant, and the five-point Laplacian stencil is diagonally dominant by
construction: the centre entry is 4 and the off-diagonal sum is 1+1+1+1=4,
with strict dominance wherever a boundary node removes a neighbour. That is why
Liebmann's method, which is Gauss-Seidel on this stencil, always converges for
the problem in Q.8(b).
(b) Solve the equation ∂x2∂2E(x,y)+∂y2∂2E(x,y)=0 in the domain of the following figure by Liebmann method. Consider, Δx=Δy.
[Marks: 06]
The figure gives a 3×3 square grid with E=1 along the top edge and
E=0 along the bottom, left and right edges.
Step 1. The Liebmann update. The five-point formula for Laplace's equation
with equal spacing is
Ei,j=41(Ei−1,j+Ei+1,j+Ei,j−1+Ei,j+1)
Each interior node takes the average of its four neighbours. The moment a
node's new value is computed, it replaces the old one, which is what makes the
method Liebmann rather than Jacobi.
Step 2. Write the four update equations, reading the boundary values off the
figure.
E1=41(0+E2+0+E4)=4E2+E4
E2=41(E1+0+0+E3)=4E1+E3
E3=41(E4+0+E2+1)=4E4+E2+1
E4=41(0+E3+E1+1)=4E3+E1+1
Step 3. Iterate. Start from E1=E2=E3=E4=0 and sweep
E1,E2,E3,E4 in that order, using the newest value available.
k
E1
E2
E3
E4
0
0.000000
0.000000
0.000000
0.000000
1
0.000000
0.000000
0.250000
0.312500
2
0.078125
0.082031
0.348633
0.356689
3
0.109680
0.114578
0.367817
0.369374
4
0.120988
0.122201
0.372894
0.373471
5
0.123918
0.124203
0.374418
0.374584
6
0.124697
0.124779
0.374841
0.374884
7
0.124916
0.124939
0.374956
0.374968
8
0.124977
0.124983
0.374988
0.374991
9
0.124994
0.124995
0.374997
0.374998
10
0.124998
0.124999
0.374999
0.374999
Iteration 1 in full: E1=0 since it depends only on the zero boundary and on
other unknowns still at 0. E2=0 likewise. E3=40+0+0+1=0.25,
then E4=40+0.25+0+1=0.3125.
Step 4. Answer.
E1=0.125,E2=0.125,E3=0.375,E4=0.375
Convergence to four decimal places is reached at iteration 8, and by iteration
10 every value is correct to six decimals.