54.3 KB · commit a9602da
| title | ECE 2213 · 2017 Exam Style Answers |
|---|
RUET · ECE Dept · B.Sc. Engineering 2nd Year Even Semester Examination, 2017 Full Marks: 96 · Time: 03 Hours
A numerical method is a procedure that solves a mathematical problem by a finite sequence of arithmetic operations, producing an approximate value in place of an exact closed form.
Why they are needed. The need arises from four facts, each of which removes the possibility of an exact analytic solution.
A numerical method therefore has to be judged on more than whether it gives an answer. Its convergence, its cost, its stability, and the way its error grows with the number of operations are all part of the method itself, and the analysis below develops each of them.
Accuracy is the closeness of a computed or measured value to the true value. Quantitatively it is 1−∣relative error∣, or, as a percentage, 100(1−∣relative error∣). Accuracy is an absolute measure: it does not depend on how far apart repeated readings are.
Example. A voltmeter reads 9.8 V across a true 10 V supply. The relative error is −0.02, so the accuracy is 98%.
Precision is the closeness of repeated measurements of the same quantity to one another. It quantifies the spread of the readings, and is expressed as 100(1−∣relative spread∣) or through the variance of the readings. Precision is a relative measure: it says nothing about whether the cluster of readings is near the true value.
Example. Five readings of the same supply give 9.8,9.9,9.8,9.9,9.8. The spread is 0.1 in 9.8, about 1%, so the readings are 99% precise. They are still only 98% accurate, because the whole cluster sits low.
Truncation error is the error caused by cutting short an infinite process. Every method that replaces an infinite series by a finite one, an integral by a finite sum, or a differential equation by a finite number of steps introduces a truncation error equal to the discarded remainder.
Example. sinx approximated by x−x3/6 truncates after the cubic term; the error is x5/120 and it falls as the number of retained terms grows.
Round-off error is the error caused by the finite precision of the machine. Every operation rounds its result to the number of digits available, and the rounding introduced at each step propagates through the later ones.
Example. On a machine holding six significant digits, 1/3 is stored as 0.333333. Adding it three times gives 0.999999, not 1, and the 10−6 shortfall is round-off error.
Approach A: the alternating series directly, with x=5.
| Terms k | Sum Sk=∑n=0k−1n!(−5)n | Error ∣Sk−6.737947×10−3∣ |
|---|---|---|
| 1 | 1 | 9.933×10−1 |
| 2 | −4 | 4.007 |
| 3 | 8.5 | 8.493 |
| 4 | −12.3333 | 1.234×101 |
| 5 | 13.7083 | 1.370×101 |
| 8 | −6.1329 | 6.140 |
| 10 | −1.8271 | 1.834 |
| 12 | −3.5921×10−1 | 3.659×10−1 |
| 14 | −4.5555×10−2 | 5.229×10−2 |
| 15 | 2.4457×10−2 | 1.772×10−2 |
The partial sums grow to 13.7 before they even begin to fall. At x=5 the largest term is 5!55=26.0417, which is over three thousand times the final answer. Every partial sum is dominated by that term, and no amount of further addition repairs it on a finite-precision machine: the cancellation destroys more digits than the machine holds.
Approach B: the reciprocal of the positive series, with x=5.
| Terms k | Sum Tk=∑n=0k−1n!5n | Tk1 | Error |
|---|---|---|---|
| 1 | 1 | 1 | 9.933×10−1 |
| 2 | 6 | 1.6667×10−1 | 1.599×10−1 |
| 3 | 18.5000 | 5.4054×10−2 | 4.732×10−2 |
| 5 | 65.3750 | 1.5296×10−2 | 8.558×10−3 |
| 8 | 128.6190 | 7.7749×10−3 | 1.037×10−3 |
| 10 | 143.6895 | 6.9595×10−3 | 2.215×10−4 |
| 12 | 147.6038 | 6.7749×10−3 | 3.694×10−5 |
| 14 | 148.3096 | 6.7427×10−3 | 4.706×10−6 |
| 15 | 148.3796 | 6.7395×10−3 | 1.525×10−6 |
All terms are positive, so no cancellation occurs, and the sum rises monotonically towards e5=148.4132. The reciprocal approaches the true value from above, reaching four significant figures at the sixteenth term.
The comparison.
| Approach A | Approach B | |
|---|---|---|
| Sign pattern | alternating | all positive |
| Largest term | 26.0417 at n=5 | 26.0417 at n=5 |
| Relative size of that term | ≈3866× the result | ≈3866× the result |
| Cancellation | catastrophic | none |
| Behaviour | diverges then converges, pathologically | monotone |
| Terms for 4 significant figures | 23 | 16 |
Approach A is unusable at x=5; Approach B reaches 6.7395×10−3 in 15 terms
The method. Newton–Raphson iterates
xn+1=xn−f′(xn)f(xn)
Limitations. Four distinct failure modes exist.
How each is solved.
The formula. With x0,x1 bracketing the root, the next approximation is the x-axis intercept of the chord through (x0,f0) and (x1,f1):
x2=f1−f0x0f1−x1f0
Algorithm.
Note. The bracket is retained at every step, so the method is guaranteed to converge. Convergence is linear and can be slow when one end of the bracket stalls against a nearly straight region of f; this is the defect that the Illinois modification addresses.
Note. The constant term is faintly printed in the original. It is read here as −3, giving f(x)=x3−3x2−x−3, and the alternative reading −1 is discussed at the end.
Sign check. f(0)=−3, f(1)=−6, f(2)=8−12−2−3=−9, and f(4)=64−48−4−3=9. The sign changes between 2 and 4, so a positive root lies in that interval. Take x0=2 and x1=3, for which f(2)=−9 and f(3)=27−27−3−3=−6.
The secant iteration.
xn+1=xn−f(xn)−f(xn−1)f(xn)(xn−xn−1)
Iteration 1.
x2=3−(−6)−(−9)(−6)(3−2)=3−3−6=3+2=5.0000
Iteration 2. f(5)=125−75−5−3=42.
x3=5−42−(−6)42(5−3)=5−4884=5−1.7500=3.2500
Iteration 3. f(3.25)=3.253−3(3.25)2−3.25−3=34.328125−31.6875−6.25=−3.609375.
x4=3.25−(−3.609375)−42(−3.609375)(3.25−5)=3.25−−45.6093756.316406=3.25+0.138489=3.388489
Iteration 4. f(3.388489)=38.906148−34.445573−6.388489=−1.927914.
x5=3.388489−(−1.927914)−(−3.609375)(−1.927914)(3.388489−3.25)=3.388489+1.6814610.266995=3.547276
The four iterations.
| Iteration | xn | f(xn) |
|---|---|---|
| 1 | 5.000000 | 42.000000 |
| 2 | 3.250000 | −3.609375 |
| 3 | 3.388489 | −1.927914 |
| 4 | 3.547276 | 0.339189 |
x≈3.547 after four iterations
Approach 1: Direct arithmetic sum. Adding the given numbers directly:
0.1532+15.45+0.000354+305.4+8.12+143.3=472.423554
472.423554
Approach 2: Standard textbook procedure for approximate numbers (S.S. Sastry, Ex. 1.7). In numerical analysis, the statement "where in each of which all the given digits are correct" indicates that each number is an approximate value rounded to its specified decimal places, with an absolute error not exceeding half a unit in the last decimal digit (Δxi≤0.5×10−m).
Following the standard textbook procedure for adding numbers of different accuracies:
Logarithmic differentiation. With u=5xy2z−3, taking natural logarithms,
lnu=ln5+lnx+2lny−3lnz
and differentiating,
udu=xdx+2ydy−3zdz
Evaluate at x=y=z=1. At that point,
udu=dx+2dy−3dz
With dx=dy=dz=0.001:
uduworst=0.001+2(0.001)+3(0.001)=6(0.001)=0.006
udu≤6×10−3=0.6%
Independent errors. If the three errors are independent random quantities, they add in quadrature rather than arithmetically:
udurms=0.0011+4+9=0.00114=3.742×10−3
and under the independence assumption the relative error is 0.374%. The factor 5 contributes nothing, being exact.
The method. Bisection requires an interval [a,b] with f(a)f(b)<0, in which the intermediate value theorem guarantees a root. The interval is halved repeatedly, and the half that still contains the sign change is retained.
Algorithm.
The relative accuracy test, in detail. The approximate relative error after step k is
∣ea∣k=ckck−ck−1×100%
The test is applied at every step after the first, and it measures the change between successive midpoints rather than the distance between the current midpoint and the true root. Because the interval halves each time, ∣ea∣ roughly halves each time too, so it is a reliable monitor: when it falls below εr the remaining uncertainty is at most the current interval width, and the computed relative error is a valid statement of how far the answer may be from the true root.
Worked example. For f(x)=x3−x−2 on [1,2]:
| Iteration | a | b | c=(a+b)/2 | f(c) | b−a |
|---|---|---|---|---|---|
| 1 | 1 | 2 | 1.500000 | −0.1250 | 1 |
| 2 | 1.5 | 2 | 1.750000 | 1.6094 | 0.5 |
| 3 | 1.5 | 1.75 | 1.625000 | 0.6660 | 0.25 |
| 4 | 1.5 | 1.625 | 1.562500 | 0.2522 | 0.125 |
| 5 | 1.5 | 1.5625 | 1.531250 | 0.0591 | 0.0625 |
| 6 | 1.5 | 1.53125 | 1.515625 | −0.0341 | 0.03125 |
The true root is x=1.5214, and after six halvings the interval width is 0.03125, so the half-width 0.015625 bounds the error and the approximate relative error is under 1.1%. The method is guaranteed to converge whenever the initial bracket is valid, and the number of iterations needed for a given tolerance is known in advance:
n=⌈log2εb−a⌉
Pivots. In Gauss elimination, the pivot is the element used to eliminate the entries below it: at step k the entry akk, in the k-th row and k-th column of the transformed matrix, is the pivot. The multipliers are
mik=akkaik
and the pivot enters the denominator of every multiplier at that step. A small pivot therefore produces large multipliers, which amplify rounding error, and this is the problem pivoting is designed to prevent.
Partial pivoting. At each step, search the k-th column below and including the diagonal, rows k to n, for the entry of largest absolute value, and exchange it into position (k,k). Only row exchanges are used, so the order of the unknowns is unchanged. This is sufficient to keep ∣mik∣≤1 for all i>k, which controls the magnitude of what is subtracted.
Complete pivoting. At each step, search the entire remaining sub-matrix, rows k to n and columns k to n, for the entry of largest absolute value, and bring it to position (k,k) by a row exchange and a column exchange. The column exchange reorders the unknowns, so the order in which the solution vector is finally written must be restored. The extra search costs about n2 comparisons per step, so complete pivoting is reserved for systems that are nearly singular or where stability is critical.
When the difference matters. For a matrix that is diagonally dominant or well-scaled, partial and complete pivoting give the same result. They differ when a small pivot appears in a column whose largest entries lie elsewhere, or when the matrix is nearly singular. Complete pivoting is always at least as stable, but the gain is usually small and the cost is not.
The idea. A square matrix A can be written as the product of a unit lower triangular matrix L (ones on the diagonal) and an upper triangular matrix U:
A=LU
Solving Ax=b then becomes two triangular substitutions, which are cheap and stable:
LUx=b⟹Ly=b⟹Ux=y
The construction. Gauss elimination produces U as the reduced matrix and records the multipliers as L. For a 3×3 system:
Step 1. Eliminate below the first column using row 1. The multipliers are
l21=a11a21,l31=a11a31
Form R2←R2−l21R1 and R3←R3−l31R1. These operations correspond to multiplying A on the left by
L1=1−l21−l31010001
Step 2. Eliminate below the second column of the result. With
l32=a22(1)a32(1)=a22−l21a12a32−l31a12
form R3←R3−l32R2(1), corresponding to
L2=10001−l32001
The result. L2L1A=U, so
A=LU,L=L1−1L2−1=1l21l3101l32001
The multipliers become the sub-diagonal entries of L directly, because the product of the inverse elementary matrices is the lower triangular matrix with those multipliers below the diagonal. This is the Doolittle form. A variant that puts U's diagonal into L is the Crout form.
Solving. Forward-substitute Ly=b:
y1=b1,y2=b2−l21y1,y3=b3−l31y1−l32y2
then back-substitute Ux=y:
x3=u33y3,x2=u22y2−u23x3,x1=u11y1−u12x2−u13x3
Why it is useful. The factorisation is computed once, at roughly 3n3 operations, and any number of right-hand sides can then be solved at a cost of only n2 each. For n right-hand sides this replaces n full eliminations by one, and the separation into forward and back substitution makes the numerical behaviour easy to analyse.
Check for diagonal dominance. In the given printed order:
The system in the printed order is not diagonally dominant, which would cause Gauss-Seidel to diverge.
Rearrange the equations. To achieve convergence, we rearrange the rows so that the largest coefficient in magnitude in each row lies on the main diagonal:
The rearranged system is:
6x1−x2−x36x1+9x2+x3−3x1+x2+12x3=3=40=50The coefficient matrix is now:
A=66−3−191−1112
Every row satisfies strict diagonal dominance (∣aii∣>∑j=i∣aij∣), guaranteeing convergence of the Gauss-Seidel method.
Iterative formulas. Expressing each diagonal variable:
x^1(k+1)=63+x2(k)+x3(k)
x^2(k+1)=940−6x1(k+1)−x3(k)
x^3(k+1)=1250+3x1(k+1)−x2(k+1)
Applying relaxation with λ=0.95:
xi(k+1)=(1−λ)xi(k)+λx^i(k+1)=0.05xi(k)+0.95x^i(k+1)
Starting from initial guess x(0)=(0,0,0):
Iteration 1.
Iteration 2.
Iteration 3.
Summary of iterations.
| Iteration | x1 | x2 | x3 |
|---|---|---|---|
| 0 | 0.000000 | 0.000000 | 0.000000 |
| 1 | 0.475000 | 3.921389 | 3.760703 |
| 2 | 1.715081 | 2.935111 | 4.321337 |
| 3 | 1.709692 | 2.830032 | 4.356408 |
x1≈1.7097,x2≈2.8300,x3≈4.3564
Interpolation is the estimation of a value of a function at a point within the range covered by a set of known values. The estimated value is obtained from the known values alone, and the interpolation curve passes exactly through them. For a table covering [x0,xn], a target x with x0<x<xn is interpolated.
Extrapolation is the estimation of a value at a point outside the range of the known data, so x>xn or x<x0. The same formulas are used, but the result carries a further risk: the interpolating curve may not represent the function outside the interval over which it was fitted. Extrapolation is therefore less reliable than interpolation, and it is avoided unless the target is only slightly beyond the data.
Curve fitting is the construction of an equation y=f(x) that describes the trend of a set of data points, without requiring that the curve pass through any of them. Where interpolation reproduces the data exactly, curve fitting accepts that the data carry error and seeks the best single relation.
The distinction between the three. All three estimate values from data. They differ in the position of the target relative to the data, and in whether the curve is required to pass through the data or only to describe it. Interpolation is inside the data and exact through it; extrapolation is outside it; curve fitting is inside it but need not pass through it.
| x | 2 | 4 | 6 | 8 | 10 |
|---|---|---|---|---|---|
| y | 4.077 | 11.084 | 30.128 | 81.897 | 222.62 |
Linearise the model. Taking logarithms of y=aebx,
lny=lna+bx
and the data become a straight line Y=A+bx with Y=lny and A=lna. Then a=eA.
Transformed data.
| x | y | Y=lny |
|---|---|---|
| 2 | 4.077 | 1.405361 |
| 4 | 11.084 | 2.405503 |
| 6 | 30.128 | 3.405455 |
| 8 | 81.897 | 4.405462 |
| 10 | 222.62 | 5.405466 |
Least squares on the transformed line. With n=5,
∑x=30,∑Y=17.027248,∑xY=122.163825,∑x2=220
b=n∑x2−(∑x)2n∑xY−∑x∑Y=5(220)−9005(122.163825)−(30)(17.027248)=200610.819124−510.817430
b=200100.001694=0.50001
lna=Yˉ−bxˉ=517.027248−0.50001(530)=3.405450−3.000052=0.405398
a=e0.405398=1.4999
The tabulated logarithms are evenly spaced by almost exactly 1.000000, which is the signature of a pure exponential, and this can be read directly.
The ratio route. 222.62/81.897=2.7183=e to five figures. Similarly 81.897/30.128=2.7183, 30.128/11.084=2.7182 and 11.084/4.077=2.7187. Each time x increases by 2, y is multiplied by e to within the rounding of the published y values, so
y=aebx⟹y(x)y(x+2)=e2b=e⟹2b=1⟹b=0.5
a=y(x)e−bx=4.077e−1=1.4998
The fitted constants. The two routes agree to four significant figures: least squares gives b=0.50001 and a=1.4999, while the ratio route gives b=0.5 and a=1.4998. Taking the values the data were generated from,
a=1.50,b=0.5
The fit.
| x | y given | y fitted =1.5e0.5x |
|---|---|---|
| 2 | 4.077 | 4.077 |
| 4 | 11.084 | 11.083 |
| 6 | 30.128 | 30.128 |
| 8 | 81.897 | 81.897 |
| 10 | 222.620 | 222.620 |
| Year | 1921 | 1931 | 1941 | 1951 | 1961 |
|---|---|---|---|---|---|
| Population (thousands) | 46 | 66 | 81 | 93 | 101 |
Newton's forward difference formula. The tabulation interval is h=10. Taking x0=1921, the target 1955 corresponds to
p=101955−1921=1034=3.4
The differences.
| 46 | 66 | 81 | 93 | 101 | |
|---|---|---|---|---|---|
| Δ | 20 | 15 | 12 | 8 | |
| Δ2 | −5 | −3 | −4 | ||
| Δ3 | 2 | −1 | |||
| Δ4 | −3 |
Apply the formula.
y=y0+pΔy0+2p(p−1)Δ2y0+6p(p−1)(p−2)Δ3y0+24p(p−1)(p−2)(p−3)Δ4y0
y=46+3.4(20)+2(3.4)(2.4)(−5)+6(3.4)(2.4)(1.4)(2)+24(3.4)(2.4)(1.4)(0.4)(−3)
Term by term:
y0=46
pΔy0=3.4×20=68
2p(p−1)Δ2y0=2(3.4)(2.4)(−5)=4.08×(−5)=−20.4
6p(p−1)(p−2)Δ3y0=6(3.4)(2.4)(1.4)(2)=611.424×2=1.904×2=3.808
24p(p−1)(p−2)(p−3)Δ4y0=24(3.4)(2.4)(1.4)(0.4)(−3)=244.5696×(−3)=0.1904×(−3)=−0.5712
Collecting the five terms:
y=46+68−20.4+3.808−0.5712=96.8368
Population in 1955≈96.8368≈96.84 thousand

Take four data points, three of which lie near the line and one of which is a spuriously displaced measurement.
Criterion 1: minimum sum of errors, ∑ei=0. The positive and negative errors cancel, so this condition is satisfied by infinitely many curves, including curves that pass through none of the data. A line far above three points and far below a fourth can give ∑ei=0 while fitting nothing.
Criterion 2: minimum sum of absolute errors, ∑∣ei∣. The cancellation is removed, so the criterion is a genuine measure of badness. However the function ∑∣ei∣ is piecewise linear in the curve's parameters, and its minimum often lies at a point where the slope is not defined, so no simple normal equations result. The condition is satisfied by several distinct curves whenever they share the same total absolute deviation, and it is numerically awkward.
Criterion 3: minimum error. A single error, mini∣ei∣, considers one point only. Minimising it drives one residual to zero while the others are ignored entirely.
The criterion that is best suited. The least-squares criterion, minimising the sum of squared errors
S=∑ei2
is best. Its three properties make it the standard:
S=i=1∑n(yi−f(xi))2 is the criterion to minimise
| x | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| y | 0.5 | 2.5 | 2.0 | 4.0 | 3.5 | 6.0 | 5.5 |
Fit y=a+bx. With n=7:
∑x=28,∑y=24,∑xy=119.5,∑x2=140
The ∑xy term is the one that requires care, being the only one that is not a straight sum of a column. Its seven products are
1(0.5)=0.5,2(2.5)=5,3(2)=6,4(4)=16,5(3.5)=17.5,6(6)=36,7(5.5)=38.5
which add to 119.5.
The normal equations. With a∑x+b∑x2=∑xy and na+b∑x=∑y:
28a+140b=119.5
7a+28b=24
Multiply the second by 4, giving 28a+112b=96, and subtract it from the first:
28b=119.5−96=23.5⟹b=2823.5=5647=0.839286
Substituting back into the second:
7a=24−28(0.839286)=24−23.5=0.5⟹a=70.5=141=0.071429
The fitted line.
y=0.0714+0.8393x
The residuals.
| x | y | 0.0714+0.8393x | e=y−y^ |
|---|---|---|---|
| 1 | 0.5 | 0.9107 | −0.4107 |
| 2 | 2.5 | 1.7500 | +0.7500 |
| 3 | 2.0 | 2.5893 | −0.5893 |
| 4 | 4.0 | 3.4286 | +0.5714 |
| 5 | 3.5 | 4.2679 | −0.7679 |
| 6 | 6.0 | 5.1071 | +0.8929 |
| 7 | 5.5 | 5.9464 | −0.4464 |
The residuals sum to zero, as the normal equations guarantee, and the sum of squared residuals is 2.9911.
The correlation coefficient is r=0.9318, so r2=0.8683, meaning about 87% of the variation in y is accounted for by the line. The residuals alternate in sign and are largest toward the middle of the range, which is the signature of genuine curvature in the data rather than of an arithmetic slip.
Set-up. Let y=f(x) be tabulated at equally spaced nodes with interval h, and write p=hx−x0. Newton's forward interpolation formula 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+⋯
First derivative. Since dx=hdp, differentiation with respect to x is (1/h) times differentiation with respect to p:
dxdy=h1[Δy0+2!2p−1Δ2y0+3!3p2−6p+2Δ3y0+4!4p3−18p2+22p−6Δ4y0+⋯]
The coefficient of Δky0 is the derivative of the product p(p−1)⋯(p−k+1) divided by k!. For k=2 that product is p2−p, whose derivative is 2p−1; for k=3 the product is p3−3p2+2p, whose derivative is 3p2−6p+2; and so on.
Second derivative. Differentiating a second time:
dx2d2y=h21[Δ2y0+(p−1)Δ3y0+(2p2−23p+1211)Δ4y0+⋯]
Each coefficient is the second derivative of the corresponding product, divided by k!:
dp2d2(p2−p)=2
dp2d2(p3−3p2+2p)=6p−6
dp2d2(p4−6p3+11p2−6p)=12p2−36p+22
and dividing by 3! and 4! respectively gives (p−1) and (2p2−23p+1211).
Stopping rule. A polynomial of degree n fitted through n+1 points has exactly n+1 coefficients. The differences of order greater than n vanish identically, so the series above terminates after the term in Δny0. Since y′′ requires differences of order two and above, at least three points are needed for the formula to carry any information, and a cubic fit through four points carries terms up to Δ3y0.
The backward counterpart. Writing backward differences at the last node xn and putting q=hx−xn,
dx2d2y=h21[∇2yn+(q+1)∇3yn+(2q2+23q+1211)∇4yn+⋯]
which is the form used when the tabulation runs in the decreasing direction.
Jacobi iteration form. Each equation is solved for its own unknown, using only the values from the previous sweep:
x(k+1)=620−y(k)−z(k)
y(k+1)=46−x(k)+z(k)
z(k+1)=57−x(k)+y(k)
Convergence check. The diagonal entries are 6, 4, 5 and the off-diagonal sums are 2, 2, 2. Every row is strictly diagonally dominant, and the Jacobi iteration converges.
Iteration, starting from x=y=z=0:
| Sweep | x | y | z |
|---|---|---|---|
| 1 | 3.333333 | 1.500000 | 1.400000 |
| 2 | 2.850000 | 1.016667 | 1.033333 |
| 3 | 2.991667 | 1.045833 | 1.033333 |
| 4 | 2.986806 | 1.010417 | 1.010833 |
| 5 | 2.996458 | 1.006007 | 1.004722 |
| 6 | 2.998212 | 1.002066 | 1.001910 |
| 7 | 2.999337 | 1.000924 | 1.000771 |
| 8 | 2.999717 | 1.000358 | 1.000317 |
The exact solution is obtained by eliminating, for instance x from the second and third equations using the first:
x=620−y−z
Substituting into equations 2 and 3 and clearing fractions gives 23y−7z=16 and −7y+29z=22, whence y=1, z=1 and then x=3.
x=3,y=1,z=1
The characteristic polynomial. Form A−λI:
A−λI=5−λ010−2−λ0105−λ
Taking the determinant along the second row, which has only one non-zero entry:
det(A−λI)=(−2−λ)[(5−λ)2−1]
=(−2−λ)(25−10λ+λ2−1)=(−2−λ)(λ2−10λ+24)
=(−2−λ)(λ−4)(λ−6)
The eigenvalues. Setting the determinant to zero:
λ=−2,λ=4,λ=6
λ=−2, 4, 6
The eigenvectors. For each eigenvalue, solve (A−λI)v=0.
For λ=−2. The matrix becomes 701000107, and the first and third rows give 7x+z=0, so z=−7x with y free. Taking y free and x=0 gives the simplest solution:
v−2=010
(Any multiple of this is also an eigenvector.)
For λ=4. The matrix becomes 1010−60101, and the first row gives x+z=0, so z=−x, with the second row forcing y=0:
v4=−101
For λ=6. The matrix becomes −1010−8010−1, and the first row gives −x+z=0, so z=x, with y=0 again:
v6=101
Normalised eigenvectors, for completeness:
v^−2=010,v^4=−1/201/2,v^6=1/201/2
Orthogonality. The matrix is symmetric, so its eigenvectors for distinct eigenvalues are orthogonal:
v−2Tv4=0,v−2Tv6=0,v4Tv6=−1+1=0
Modified Euler (Heun's method). With h=0.02 and f(x,y)=x2+y, the predictor is
y^1=y0+hf(x0,y0)
and the corrector averages the two slopes:
y1=y0+2h[f(x0,y0)+f(x1,y^1)]
Step. x0=0, y0=1, so f(x0,y0)=02+1=1.
Predictor.
y^1=1+0.02(1)=1.02
Corrector. At x1=0.02 and y^1=1.02,
f(x1,y^1)=(0.02)2+1.02=0.0004+1.02=1.0204
y1=1+20.02(1+1.0204)=1+0.01(2.0204)=1+0.020204
y(0.02)=1.020204
Set-up. With h=0.1 and f(x,y)=y2+x2y2−x2:
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.
k1=1+01−0=1
k2=(1.05)2+(0.05)2(1.05)2−(0.05)2=1.1025+0.00251.1025−0.0025=1.10501.1000=0.9954751
k3=(1.04977376)2+(0.05)2(1.04977376)2−(0.05)2=1.10202495+0.00251.10202495−0.0025=1.104524951.09952495=0.99547317
k4=(1.09954732)2+(0.1)2(1.09954732)2−(0.1)2=1.20900431+0.011.20900431−0.01=1.219004311.19900431=0.98359317
y1=1+60.1(1+2(0.9954751)+2(0.9954732)+0.9835932)=1+60.1(5.9654897)=1.0994248
Step 2. x1=0.1, y1=1.0994248. Applying the same four formulas gives
k1=0.9835895,k2=0.9664628,k3=0.9664135,k4=0.9455995
y2=1.0994248+60.1(0.9835895+2(0.9664628)+2(0.9664135)+0.9455995)
y2=1.0994248+60.1(5.7949416)=1.0994248+0.0965824=1.1960072
Step 3. x2=0.2, y2=1.1960072.
k1=0.9455943,k2=0.9222764,k3=0.9221361,k4=0.8971142
y3=1.1960072+60.1(0.9455943+2(0.9222764)+2(0.9221361)+0.8971142)
y3=1.1960072+60.1(5.5315335)=1.1960072+0.0921922=1.2881994
Step 4. x3=0.3, y3=1.2881994.
k1=0.8971110,k2=0.8710211,k3=0.8707846,k4=0.8440082
y4=1.2881994+60.1(0.8971110+2(0.8710211)+2(0.8707846)+0.8440082)
y4=1.2881994+60.1(5.2247306)=1.2881994+0.0870788=1.3752783
The results.
| x | y |
|---|---|
| 0.0 | 1.0000000 |
| 0.1 | 1.0994248 |
| 0.2 | 1.1960072 |
| 0.3 | 1.2881994 |
| 0.4 | 1.3752783 |
y(0.2)=1.1960,y(0.4)=1.3753
Numerical methods are indispensable wherever a problem is too large, too nonlinear or too data-rich to be solved in closed form. The following fields all depend on them centrally.
The common feature is that each field's central problem is either a large linear system, a differential equation, or an integral over measured data, and each of those is exactly what numerical methods exist to solve.