RUET · ECE Dept · B.Sc. Engineering 2nd Year Even Semester Examination, 2019
This file explains the same questions as
the 2019 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) Define numerical method. How does it become popular? Why do ECE engineers require numerical methods?
[Marks: 04]
Definition. A numerical method is a finite arithmetic procedure for
solving a problem that has no usable closed form. It replaces the problem by a
sequence of additions, subtractions, multiplications, divisions and comparisons
that can be carried out to a stated precision.
Numerical method=a finite arithmetic procedure for a problem without a usable closed form
How it became popular.
Most engineering problems have no closed-form solution at all. The integral
∫e−x2dx, the motion of three bodies under gravity, and the
boundary-value problem of a transistor region have no elementary antiderivative
or formula, yet all three must be evaluated in practice.
Only arithmetic can be executed by a machine. A numerical method converts a
problem into additions, multiplications and comparisons, which is exactly what
a computer performs.
The growth of computing power made long arithmetic chains cheap. Methods that
required thousands of operations, and were therefore once unusable, became
routine.
Tabulated results and hand computation gave way to direct evaluation at the
point of interest, with the error under the engineer's control.
Why ECE engineers require them.
Circuit quantities are often implicit. The diode equation
I=Is(eV/VT−1) and the power balance P=VI−∑I2R give V and
I through equations that cannot be solved for the current in closed form.
Field problems reduce to difference equations. The potential distribution in
a semiconductor region or a screening geometry is a Laplace or Poisson problem
that is solved on a mesh, not in symbols.
Signal quantities are sampled. Any quantity derived from a discrete set of
measurements, whether by differentiation, integration or a filter, is obtained
numerically.
Optimisation is iterative. Impedance matching, cut-off frequency placement and
bias-point selection are all found by repeated improvement of an estimate.
(b) What are the errors involved in numerical methods? How do they enter into the process? Give example.
[Marks: 04]
The errors are inherent error, absolute error, and relative error.
Inherent error. The error already present in the physical statement, before
any computation. It subdivides into:
Data error, from measurement. A resistance read off a meter as 4.7Ω
carries the meter's own error, whatever is done afterwards.
Conversion error, from the problem statement. When a continuous law is
written as a formula, finite precision in the law's constants is carried in.
Modelling error, from the assumptions made. The formula I=V/R ignores
temperature and tolerance; the neglected terms are the modelling error.
Inherent error is not produced by the arithmetic and cannot be reduced by carrying
more digits.
Absolute error. The difference between the approximate value A and the true
value T:
Eabs=A−T,∣Eabs∣=∣A−T∣
Relative error. The absolute error measured against the true value:
Erel=TEabs,Epct=100TEabs
How they enter the process. The steps of any computation are:
Formulate the physical problem, where modelling error enters.
Gather the data, where data error enters.
Choose a method and carry out the arithmetic, where round-off error
enters at every step.
Apply truncation when an infinite process is cut short, where
truncation error enters.
Report the result, where the errors of steps 1, 2, 4 and the propagated
round-off of step 3 appear together.
Example. Take R=220Ω and V=10V, so
I=10/220=0.0454545A. Reading the current as 0.045A on a
three-digit display gives
Eabs=0.045−0.0454545=−0.0004545A
Erel=0.0454545−0.0004545=−0.01=−1%
(c) What are the error representations? Two PT-voltmeter arrangements give 999V and 9999V instead of 1kV and 10kV. Obtain error by all possible error representations. Hence comment on error strength of the readings.
[Marks: 04]
The representations. Given a true value T and an approximate value A,
with e=A−T:
Absolute error:e=A−T, and its magnitude ∣e∣.
Relative error:Te, the error measured against the true value.
Percentage error:100Te.
Relative (or percentage) accuracy:TA, equivalently
1−Te, which measures how near A is to T.
Limiting error (error bound): a stated bound ∣e∣≤ε within
which the value is guaranteed to lie.
Arrangement 1: A=999V, T=1000V.
e=999−1000=−1V,∣e∣=1V
Erel=1000−1=−10−3=−0.1%
Erel, reading=999−1=−1.001×10−3=−0.1001%
Accuracy=1000999=0.999=99.9%
Arrangement 2: A=9999V, T=10000V.
e=9999−10000=−1V,∣e∣=1V
Erel=10000−1=−10−4=−0.01%
Erel, reading=9999−1=−1.0001×10−4=−0.010001%
Accuracy=100009999=0.9999=99.99%
Comment on the error strength. The absolute error is identical in the two
arrangements, 1V, so the absolute error separates them not at all.
Against the true value, the 9999V reading has a relative error of
0.01% while the 999V reading has 0.1%, a factor of ten difference.
The 9999V reading is therefore the stronger one.
∣e∣=1Vfor both, butErel=10−3against10−4
Question 2
(a) What is meant by iterative method? Write the names of iterative methods to solve nonlinear equations. Write the generalized steps to solve the nonlinear equations using iterative methods.
[Marks: 04]
An iterative method solves f(x)=0 by producing a sequence
x0,x1,x2,… from a starting estimate x0, each term obtained from the
preceding ones by a fixed rule, so that the sequence converges to the root
x=r. The answer is accepted when successive terms agree to the required
precision, rather than when a formula closes.
Methods for a nonlinear equation
Bisection (or false position, regula falsi)
Fixed-point iteration
Newton-Raphson
Secant
Bairstow (for polynomial roots)
Generalized steps
Rewrite the problem in the form f(x)=0.
Determine the interval of interest, and count the roots in it from a change of
sign of f.
Choose a starting estimate x0 and, where required, a second estimate.
Derive the iteration formula xk+1=g(xk).
Apply the formula repeatedly, recording each iterate.
Test for convergence by comparing successive iterates,
∣xk+1−xk∣<ε, with ε the tolerance.
If the sequence diverges or stalls, restart from a better estimate or from
another method, and note the failure.
Verify the accepted root by substitution back into f(x)=0.
(b) Compute current, I from the following power balance equation obtained from an electric circuit by using an iterative method: 5I2+50I=1000.
[Marks: 04]
Write the equation in the form f(I)=0:
f(I)=5I2+50I−1000=0,f′(I)=10I+50
Closed-form check on the answer. Dividing by 5,
I2+10I−200=0⟹I=2−10±100+800=2−10±30
the two roots are I=10 and I=−20. The current is positive, so I=10 is
the root of interest. This fixes the target against which the iterations below are
judged.
Iteration by Newton-Raphson. The formula is
Ik+1=Ik−10Ik+505Ik2+50Ik−1000
Take I0=5, and note f(5)=125+250−1000=−625<0 while
f(20)=2000+1000−1000>0, so the root lies above I0 and the iteration
moves the right way.
k
Ik
f(Ik)
f′(Ik)
Ik+1
0
5
−625
100
11.25
1
11.25
195.3125
162.5
10.0480769
2
10.0480769
7.2231
150.4808
10.0000768
3
10.0000768
0.0115
150.0008
10.0000000
The iterates settle on I=10. The last correction is 0.0000768, already below
10−4, so the value is accepted.
I=10A
(c) Write the steps of N-R method. Discuss its merits and demerits.
[Marks: 04]
Newton-Raphson for f(x)=0.
Write the equation as f(x)=0.
Compute the derivative f′(x).
Choose x0 close to the root, from a sign change or a physical estimate.
Apply xk+1=xk−f′(xk)f(xk).
Stop when ∣xk+1−xk∣<ε, or when ∣f(xk)∣<ε.
Verify by substituting the root back into f(x)=0.
Geometrically, xk+1 is the intercept on the x-axis of the tangent to
y=f(x) at xk, so the root is approached along successive tangents.
Merits
Fastest available. Second-order convergence near the root: the number of
correct digits roughly doubles per step, so three or four steps usually suffice
where bisection needs thirty.
One estimate is enough. Only x0 is needed, unlike the secant or
regula-falsi methods which require two.
Non-polynomial equations are handled. Transcendental equations, for instance
x=cosx or I=Is(eV/VT−1), are solved directly, with no need to
isolate x.
Extends to systems. The same tangent idea applies to n simultaneous
equations through the Jacobian, which makes it the standard method for a
nonlinear network.
Demerits
f′(x) must be available. An analytic derivative is needed. When it is
difficult or costly, the method loses its advantage.
Poor x0 can fail. If the tangent is nearly horizontal, f′(xk)≈0
and the next iterate is thrown far away. Starting far from the root can send the
sequence into divergence rather than toward it.
No bracket is maintained. Unlike bisection, the method gives no guaranteed
interval containing the root, so a failure may not be detected until late.
Repeated roots slow it down. At a root of multiplicity m>1 the
convergence order falls from 2 toward 1, and each step gains little.
Complex roots are awkward. The iterates can leave the real axis when f or
f′ takes complex values, so real-root isolation must be done beforehand.
Question 3
(a) Discuss Gauss Elimination method to solve linear simultaneous algebraic equations.
[Marks: 04]
Gauss elimination solves Ax=b by transforming the coefficient matrix into
upper triangular form using elementary row operations, then recovering the unknowns
by back substitution. The solution set is unchanged, since every operation is
reversible.
Forward elimination. Using R1, eliminate x1 from R2 through Rn
by forming Ri←Ri−a11ai1R1. Then use the modified
R2 to eliminate x2 from R3 through Rn, and continue. After pass k
the first k equations have k non-zero coefficients and the remaining have
zeros in the first k columns.
Triangular system. After n−1 passes the matrix is upper triangular:
Back substitution. From the last equation, xn=bn′/unn. Substitute
into the (n−1)-th, giving xn−1, and continue upward to x1.
Division by zero. If a pivot ukk is zero, the row is exchanged with one
below having a non-zero entry in that column.
Verification. Substitute the obtained vector back into the original system.
Operation count. Forward elimination needs roughly 3n3
multiplications and divisions; back substitution needs 2n2. Total cost
grows as n3, so the method is practical for moderate n and for a single
right-hand side.
Use in ECE. Nodal analysis of a network with more than two nodes produces a
set of simultaneous equations larger than is comfortable by hand. Gauss elimination
converts it to a triangular set whose values are read off successively, which is
the standard automated form of that solution.
(b) Discuss partial and complete pivoting in brief.
[Marks: 04]
Partial pivoting. At step k of the elimination, search column k of the
rows k through n for the entry of largest absolute value, and exchange it with
the entry in position (k,k) before forming the multipliers. The multiplier is
then
mik=akkaik,∣mik∣≤1
hence no multiplier exceeds one in magnitude, and the rounding introduced by the
multiplier is controlled. Partial pivoting searches one column only, and is
sufficient for the great majority of systems.
Complete pivoting. At step k, search the whole remaining sub-matrix, rows k
through n and columns k through n, for the entry of largest absolute value,
and bring it to position (k,k) by a row exchange and a column exchange.
Column exchanges reorder the unknowns, so the order in which the solution vector is
written must be restored afterwards. The extra search raises the cost by a factor of
about n2 per step, which is why complete pivoting is reserved for systems that
are nearly singular or where numerical stability is critical.
Partial pivoting
Complete pivoting
Search region
column k, rows k to n
sub-matrix, rows and columns k to n
Row exchange
yes
yes
Column exchange
no
yes, unknown order changes
Stability
adequate for most systems
best available
Cost
low
higher by a factor of about n2
When it matters. If the pivot akk is small relative to the entries below it,
the multiplier mik is large, and the row Ri−mikRk carries a value
dominated by rounding. Choosing the largest available pivot keeps the magnitude of
what is subtracted under control, and prevents a small physical quantity from
being lost against a large one.
(c) Obtain the nodal equations from the following circuit. Hence solve for the unknowns using Gauss-Seidel iterative method. Show two iterations only.
[Marks: 04]
Circuit. Two non-reference nodes, V1 and V2, with a common reference
ground. Node 1 connects to ground through 2Ω and to node 2 through
4Ω, with a 5A source entering node 1 through the top branch.
Node 2 connects to ground through 6Ω and to node 1 through 4Ω,
with a 5A source leaving toward node 1 and a 10A source
entering node 2.
KCL at node 1. Currents leaving: through 2Ω to ground, through
4Ω to node 2, and 5A back through the top branch.
2V1+4V1−V2−5=0
Multiplying by 4:
2V1+V1−V2−20=0⟹3V1−V2=20
KCL at node 2. Currents leaving: through 6Ω to ground, through
4Ω to node 1, and 5A through the top branch. The 10A
source enters, so it stands on the other side.
6V2+4V2−V1+5=10
Multiplying by 12:
2V2+3(V2−V1)+60=120⟹−3V1+5V2=60
Gauss-Seidel form. Solve each equation for the diagonal unknown, and use the
most recent value of the other as soon as it is available.
V1(k+1)=320+V2(k),V2(k+1)=560+3V1(k+1)
The coefficient matrix is diagonally dominant, since ∣3∣>∣−1∣ in the first row
and ∣5∣>∣−3∣ in the second, so the iteration converges. Start from
V1(0)=V2(0)=0.
The exact solution, for reference. Adding the two equations eliminates V1:
4V2=80⟹V2=20V,3V1=40⟹V1=13.333333V
V1=13.3333V,V2=20V
Question 4
(a) What is curve fitting? Why is it required for ECE engineers? Discuss least square technique condition.
[Marks: 04]
Curve fitting is the construction of an equation y=f(x) that represents the
trend of a set of data points (xi,yi). Where interpolation forces the curve
through every point, curve fitting accepts that the points carry error and seeks a
single relation that describes the whole set.
Why it is required for ECE engineers
Data are noisy. A voltage, a gain, a delay or a bit-error rate measured
repeatedly gives scattered values. Fitting an underlying law separates the trend
from the scatter and quantifies the scatter.
A compact model is wanted. A characteristic measured at ten points is
replaced by two or three constants, which is what a simulator and a hand
calculation both use.
Values must be predicted where no measurement exists, inside and immediately
outside the measured range.
Parameters must be extracted. Resistance, inductance, time constant,
cut-off frequency and beta are all obtained by fitting the measured response to
the known equation of the device.
Least squares. Let the trial curve be y=a0+a1x+⋯+amgm(x).
The residual at point i is ri=yi−f(xi). The coefficients are chosen to
minimise the sum of squared residuals,
S=i=1∑nri2=i=1∑n(yi−f(xi))2
The conditions are obtained by setting each partial derivative to zero:
∂a0∂S=0,∂a1∂S=0,…
which gives the normal equations. For the straight line y=a+bx:
∑y=na+b∑x,∑xy=a∑x+b∑x2
and in general the squares are needed because the minimum, not the root, is
sought: setting the derivatives to zero locates the stationary point of S, and
the second derivatives are positive there, so it is a minimum.
The least-squares condition, stated fully. Of all curves in the chosen family,
the least squares curve is the one for which the residuals satisfy
∑ri2 is a minimum, and
∑ri=0 (the positive and negative residuals cancel),
∑xiri=0 (the residuals are orthogonal to the regressor),
which follows directly from the two normal equations. The three conditions are the
algebraic signature of the fit: the line passes through the centroid
(xˉ,yˉ), and the residuals are uncorrelated with the fitted values.
(b) A robot arm with a rapid laser scanner is doing a quick quality check on holes drilled in a 15′′×10′′ rectangular plate. The centers of the holes in the plate describe the path the arm needs to take, and the hole centers are located on a Cartesian coordinate system (with the origin at the bottom left corner of the plate) given by the specifications in the table below. If the leaser is traversing from x=2 to x=4.25 to x=5.25 in a quadratic path, what is the value of the y at x=4.00 using a curve fitting technique.
[Marks: 06]
x (in.)
2
4.25
5.25
y (in.)
7.2
7.1
6.0
The three tabulated points through which the quadratic path passes are
Three points determine one quadratic, so the curve-fitting technique is exact
interpolation by a second-degree Lagrange polynomial. The rest of the table,
(7.81,5.0),(9.20,3.5),(10.60,5.0), is not part of the specified path.
These are the normal equations. Solving the 2×2 system:
na+b∑xi=∑yia∑xi+b∑xi2=∑xiyi
Eliminating a from the first, a=yˉ−bxˉ, and substituting into the
second:
∑xiyi=(yˉ−bxˉ)∑xi+b∑xi2
Dividing through and collecting terms in b:
b=n∑xi2−(∑xi)2n∑xiyi−∑xi∑yi,a=yˉ−bxˉ
y=(yˉ−bxˉ)+bxwithb=n∑x2−(∑x)2n∑xy−∑x∑y
SECTION B
Question 5
(a) Define interpolation and extrapolation. List two general techniques of curve fitting.
[Marks: 03]
Interpolation is the estimation of an intermediate value of a function from a
set of known values, at a point within the range covered by the known data.
Extrapolation is the estimation of a value at a point outside that range.
Interpolation is bounded by the data; extrapolation extends beyond it.
The two are distinguished by the position of the target relative to the tabulated
interval. For a table covering [x0,xn], a target x with x0<x<xn is
interpolated; a target with x>xn or x<x0 is extrapolated. Extrapolation
carries the further risk that the fitted relation may not hold outside the range
where it was fitted at all.
Two general techniques of curve fitting
Least squares fitting. A curve y=a+bx+⋯ is fitted by choosing
its coefficients to minimise ∑ri2, the sum of squared residuals. The
curve does not pass through the points, but captures the trend, so it is
appropriate for noisy data.
Exact interpolation fitting. A curve is made to pass through every tabulated
point, using the family of methods built from divided differences and Lagrange
polynomials. It reproduces the data exactly and is appropriate where the data
are error-free.
Other techniques include the geometric mean, moving average and orthogonal
polynomial fits; the two above are the general ones.
(b) To verify Ohm's law, an experiment was performed and the results obtained are in the following table. Use linear interpolation to determine the current for 12V of supply. Explain why the result differs from actual value.
[Marks: 05]
V (volt)
5
10
15
20
25
I (amps)
1
2.1
3
4.2
5
The target V=12 lies between V0=10 and V1=15, so the bracketing data
are (10,2.1) and (15,3).
Linear interpolation. The chord through the two points is
Why this differs from the true value. The actual value follows Ohm's law,
V=IR, with the resistance from the data. The 5V, 15V and
25V readings give R=V/I=5Ω exactly, whereas the 10V
and 20V readings give R≈4.76Ω. The true current at
12V is therefore
Itrue=512=2.4A
against the interpolated 2.46A, a difference of 0.06A.
The cause is the data, not the method. Linear interpolation follows the chord
joining the two bracketing points, and that chord is not the Ohm's-law line: the
10V reading carries a measurement error of +0.1A against the
2.0A the law predicts, so the chord from (10,2.1) to (15,3) has
slope 0.9/5=0.18A/V instead of the true 0.2A/V. The
interpolated value inherits that slope over the whole interval from 10 to
15V. The effect would be less at a point nearer an accurate reading, and
it would vanish if both bracketing readings were error-free.
(c) Using Newton's general interpolation formula find f(x) as a polynomial in x for the following table. Also, determine f(3.5) using the polynomial.
[Marks: 04]
x
−1
0
3
6
7
f(x)
3
−6
39
822
1611
Divided differences. Each entry is
f[xi,…,xi+k]=xi+k−xif[xi+1,…,xi+k]−f[xi,…,xi+k−1].
Expand to a polynomial in x. Working outward from the last term:
(x+1)x(x−3)(x−6)=x4−8x3+9x2+18x
5(x+1)x(x−3)=5(x3−2x2−3x)=5x3−10x2−15x
6(x+1)x=6x2+6x,−9(x+1)=−9x−9
Collecting all terms:
f(x)=x4−3x3+5x2−6
f(x)=x4−3x3+5x2−6
Apply it to f(3.5). Substituting into the expanded form:
f(3.5)=150.0625−128.625+61.25−6=76.6875
f(3.5)=76.6875
Question 6
(a) What is the basis of numerical differentiation? Write at least four difference equations to obtain numerical differentiation.
[Marks: 04]
The basis. A function known only at discrete points is replaced by a polynomial
that passes through those points, and the derivative of that polynomial is used for
the derivative of the function. Starting from the Taylor series
f(x+h)=f(x)+hf′(x)+2h2f′′(x)+6h3f′′′(x)+⋯
combinations of the series at neighbouring points cancel the terms that are not
wanted. Since the first omitted term is proportional to a power of h, the result
is an approximation with an error O(h) or O(h2).
Four difference equations. With h the tabular spacing and fn=f(xn):
Central difference (five-point).f′(xn)=12hfn−2−8fn−1+8fn+1−fn+2,error O(h4)
The central formulas are preferred where data exist on both sides, since their error
is O(h2) and above rather than O(h), and their error constants are smaller by
the same factor.
(b) A 1 Henry inductance gets current through it at different times as follows. Obtain the voltage across it at t=0.27 sec using numerical differentiation.
[Marks: 05]
t (sec)
0.25
0.26
0.27
0.28
0.29
I (amp)
0.2474
0.2571
0.2667
0.2764
0.2860
The tabular spacing is h=0.01. The target t=0.27 has two points on each
side, so the five-point central formula is available and is the most accurate.
Five-point central difference.
f′(xn)=12hfn−2−8fn−1+8fn+1−fn+2
With fn−2=0.2474, fn−1=0.2571, fn+1=0.2764, fn+2=0.2860:
(c) Discuss trapezoidal rule of numerical integration.
[Marks: 03]
The trapezoidal rule approximates ∫abf(x)dx by replacing the curve
with a straight line joining the endpoints of each subinterval, so the area under
the curve becomes the area of a set of trapezoids.
Derivation. Over one interval [x0,x0+h], the straight line through
(x0,f0) and (x1,f1) has slope hf1−f0, and its integral is
∫x0x1f(x)dx≈2h(f0+f1)
Composite rule. Over [a,b] with n subintervals of width
h=nb−a, summing the one-interval result gives
∫abf(x)dx≈2h[f0+2f1+2f2+⋯+2fn−1+fn]
∫abf(x)dx≈2h[f(a)+f(b)+2i=1∑n−1fi]
Error. The error over one interval is −12h3f′′(ξ), so the
composite error is
E=−12(b−a)h2f′′(ξ),O(h2)
Properties.
Order of accuracy.O(h2): halving h reduces the error by a factor of
four.
The rule is exact for a straight line, and over-shoots for a curve that is
concave up, since the chord lies above the curve.
It is the basis of the trapezoidal rule for sampled data, where the area of a
measured record is obtained with no requirement that the samples be equally
spaced in value.
Its ease of use makes it the obvious first estimate, but Simpson's rules are
preferred when smoothness and accuracy are required.
Question 7
(a) Derive Simpson's one-third rule and hence show that the rule is exact up to degree three.
[Marks: 04]
Derivation. Take three equally spaced nodes
x0,x1=x0+h,x2=x0+2h
and replace f by the quadratic P2(x) through the three values f0,f1,f2. The integral of P2 is the approximation.
Exactness to degree three. By construction the rule is exact for every
quadratic, since P2=f. For a cubic, apply the rule to f(x)=x3 on
[−h,h], which by symmetry is equivalent to any interval:
∫−hhx3dx=[4x4]−hh=0
3h[(−h)3+4(0)3+(h)3]=3h(−h3+h3)=0
The two agree.
Failure at degree four. For f(x)=x4 on [−h,h]:
∫−hhx4dx=52h5,3h(h4+0+h4)=32h5
and 32=52, so the rule is not exact for quartics.
\boxed{\int_{x_0}^{x_2} f\,dx \approx \frac{h}{3}(f_0 + 4f_1 + f_2)\ \text{exact for all polynomials of degree}\ \le 3}}
(b) Evaluate, ∫12(x2+1)dx using Simpson's 3/8 rule.
[Marks: 04]
Simpson's 3/8 rule applies over three subintervals, using four nodes. Over
[1,2], take n=3, so
h=32−1=31,x=1,34,35,2
The ordinates:
f(1)=1+1=2
f(34)=916+1=925≈2.777778
f(35)=925+1=934≈3.777778
f(2)=4+1=5
∫12(x2+1)dx≈83h[f0+3f1+3f2+f3]
=83⋅31[2+3(925)+3(934)+5]
=81[2+325+334+5]=81[7+359]=81⋅380=310
∫12(x2+1)dx=310=3.3333
(c) Discuss Euler's method to solve ordinary differential equations.
[Marks: 04]
Purpose. Given y′=f(x,y) and y(x0)=y0, the value of y is wanted
at x0+nh for a step size h.
Derivation. Taylor expand about xn:
yn+1=yn+hyn′+2h2yn′′+⋯
Euler's method keeps the first two terms and discards the rest:
yn+1=yn+hf(xn,yn)
Geometrically, yn+1 is the value at xn+h of the tangent to the solution
curve at (xn,yn), so the solution is followed along successive short tangent
segments.
Procedure. Set xn+1=xn+h. Starting from (x0,y0), compute
y1=y0+hf(x0,y0), then y2=y1+hf(x1,y1), and continue.
Error. The local truncation error is O(h2) per step, from the discarded
2h2y′′ term; over n steps these accumulate into a global error
O(h). Halving h therefore halves the global error, which is the defining
property of a first-order method.
yn+1=yn+hf(xn,yn),global error O(h)
Merits and demerits.
Simple. One evaluation of f per step, and no derivative of f is needed.
Stable only for a sufficiently small h on a stiff equation, because the
method follows the tangent rather than the curve.
Inexact. The global error falls only linearly in h, so high accuracy
requires many steps.
It is the foundation of the higher methods. Heun, the mid-point method, and
the Runge-Kutta family all correct Euler's 2h2y′′ term.
Question 8
(a) Given, dxdy=x2+y2 where y=0 when x=0. Find y(0.4) assuming h=0.2.
[Marks: 06]
Step 1.x0=0, y0=0.
f(x0,y0)=x02+y02=0+0=0
y1=y0+hf(x0,y0)=0+0.2(0)=0
Hence x1=0.2 and y1=0.
Step 2.x1=0.2, y1=0.
f(x1,y1)=(0.2)2+02=0.04
y2=y1+hf(x1,y1)=0+0.2(0.04)=0.008
Hence x2=0.4 and y2=0.008.
Step
xn
yn
f(xn,yn)=xn2+yn2
yn+1=yn+0.2f
0
0
0
0
0
1
0.2
0
0.04
0.008
y(0.4)≈0.008
(b) Solve the Laplace's equation for the square region shown in the following figure, the boundary values being indicated in the figure.
[Marks: 06]
The mesh. A uniform 3×3 mesh over the square, with four interior nodes
u1,u2,u3,u4 and the boundary values shown.
The standard Laplace finite-difference stencil. For a square mesh with uniform
spacing h, ∇2u=0 gives
The four nodal equations. Reading the neighbours of each interior node from the
figure, and taking the boundary values in the order left, right, top, bottom: