Answer:
319 = +.32 10^3
+ 284 = +.28 10^3
-------------------
+.60 10^3 = 600
319 = +.32 10^3
- 284 = +.28 10^3
-------------------
+.04 10^3 = +.40 10^2 = 40
+--------+
| /15 |
+--------+
Answer:
Error propagation is the accumulation of roundoff error during calculations. For example: deflation in root finding of univariate polynomials. Let a be a root of the polynomial f(x). To find other roots, we continue with g(x) = f(x)/(x-a). Since we have only an approximation for the root and not the exact root, the coefficients of g(x) are approximate. As we continue the deflations, the approximations for the roots will be less and less accurate.
+--------+
| /10 |
+--------+
Answer:
+------+----------+----------+----------+----------+-----------+-----------+ | step | a | b | x1 | x2 | f(x1) | f(x2) | +======+==========+==========+==========+==========+===========+===========+ | 0 | 0.000E+0 | 1.000E+0 | 3.820E-1 | 6.180E-1 | -1.000E+0 | -1.472E+0 | | 1 | 3.820E-1 | 1.000E+0 | 6.180E-1 | 7.639E-1 | -1.472E+0 | -1.708E+0 | | 2 | 6.180E-1 | 1.000E+0 | 7.639E-1 | 8.541E-1 | -1.708E+0 | -1.833E+0 | +------+----------+----------+----------+----------+-----------+-----------+
+--------+
| /15 |
+--------+
Answer:
Denote by x the exact and by xx the approximate solution. Let AA be the floating-point representation of the given matrix A. Then the relative error on the solution is bounded as follows:
|| x - xx || || A - AA ||
------------ <= cond(A) ------------
||x|| ||A||
<= 10^9 10^(-16) = 10^(-7)
So we can trust seven decimal places in the answer.
+--------+
| /10 |
+--------+
Answer:
We prefer shooting because the method of finite differences would lead to a large nonlinear system.
+--------+
| /10 |
+--------+
[ -1.000 4.000 -1.000 ]
A = [ 1.000 2.000 4.000 ]
[ 3.000 -3.000 4.000 ]
Calculate with four decimal places, using rounding: write the answer of every step rounded to four decimal places, and use the rounded number in the calculations of the next step.
Answer:
[ -1.000 4.000 -1.000 ] 1
A = [ 1.000 2.000 4.000 ] 2
[ 3.000 -3.000 4.000 ] 3
[ 3.000 -3.000 4.000 ] 3
------> [ 1.000 2.000 4.000 ] 2
[ -1.000 4.000 -1.000 ] 1
R2 = R2 - 1/3*R1 [ 3.000 -3.000 4.000 ] 3
------------------> [ 0.3333 3.000 2.667 ] 2
R3 = R3 + 1/3*R1 [ -0.3333 1.000 0.3333 ] 1
R3 = R3 - 1*R2 [ 3.000 -3.000 4.000 ] 3
------------------> [ 0.3333 3.000 2.667 ] 2
[ -0.3333 1.000 -2.334 ] 1
[ 1.000 0.000 0.000 ]
L = [ 0.3333 1.000 0.000 ]
[ -0.3333 1.000 1.000 ]
[ 3.000 -3.000 4.000 ] [ 0 0 1 ]
U = [ 0.000 3.000 2.667 ] P = [ 0 1 0 ]
[ 0.000 0.000 -2.334 ] [ 1 0 0 ]
+--------+
| /25 |
+--------+
Answer:
0 -6
-5+6
----- = 1
1-0 2-1
1 -5 ----- = 1
-2+6 2-1 1-1
----- = 2 ----- = 0
2-0 3-1 3-2
2 -2 ----- = 1
3+6 3-1
----- = 3
3-0
3 3
p(x) = -6 + 1*(x-0) + 1*(x-0)*(x-1) + 0*(x-0)*(x-1)*(x-2)
+--------+
| /15 |
+--------+
1 3 3 5 5 7 35 9 ( 10 )
arcsin(x) = x + --- x + --- x + --- x + ---- x + O( x )
6 40 112 1152 ( )
Use this Maclaurin expansion to construct a
Padé approximation
for arcsin(x) as a quotient of two quadrics.
Answer:
a0 + a1*x + a2*x^2
R = ------------------
1 + b1*x + b2*x^2
(1+b1*x+b2*x^2)*(x+x^3/6+3*x^5/40) - a0 - a1*x - a2*x^2
0 - a0 = 0 a0 = 0
1 - a1 = 0 a1 = 1 x
b1 - a2 = 0 a2 = 0 R = -----------
1/6 + b2 = 0 b2 = -1/6 1 - x^2/6
1/6*b1 = 0 b1 = 0
+--------+
| /15 |
+--------+
*=======*==============*
| x | f(x) |
*=======*==============*
| 0.000 | 0.0000000000 |
| 0.125 | 0.1256551366 |
| 0.250 | 0.2553419212 |
| 0.375 | 0.3936265759 |
| 0.500 | 0.5463024898 |
| 0.625 | 0.7214844410 |
| 0.750 | 0.9315964599 |
| 0.875 | 1.197421629 |
| 1.000 | 1.557407725 |
*=======*==============*
Answer:
1.557407725 - 0.0000000000
h=0.5 : --------------------------- = 1.557407725
1 \
(a)
0.9315964599 - 0.2553419212 /
h=0.25 : --------------------------- = 1.352509077
0.5 \
(b)
0.7214844410 - 0.3936265759 /
h=0.125 : --------------------------- = 1.311431460
0.25
1.557407725*(1/4) - 1.352509077
(a) = ------------------------------- = 1.284209528
(1/4) - 1 \
(c)
1.352509077*(1/4) - 1.311431460 /
(b) = ------------------------------- = 1.297738690
(1/4) - 1
1.284209528*(1/16) - 1.297738690
(c) = -------------------------------- = 1.298640634
(1/16) - 1
O(h^6) with h = 0.125, h^6 = 3.8 E-6
So we have about five decimal places right.
+--------+
| /25 |
+--------+
Answer:
x(n+1) x(n+1)
/ /
| |
| dy = | f(x,y(x))dx = c1 f(n-2) + c2 f(n-1) + c3 f(n)
| |
/ /
x(n) x(n)
Without loss of generality, we let x(n) = 0 and x(n+1) = h,
and require that all quadrics be integrated correctly:
h
/
f=1 : | 1 dx = h = c1 + c2 + c3
/
0
h
/ h^2
f=x : | x dx = ----- = c1*(-2h) + c2*(-h) + c3*0
/ 2
0
h
2 / 2 h^3 2 2 2
f=x : | x dx = ----- = c1*(-2h) + c2*(-h) + c3*0
/ 3
0
The solution to this system is
c1 = 2*h/12, c2 = -16*h/12, c3 = 23*h/12.
+--------+
| /15 |
+--------+
Answer: Since our predictor-corrector method requires four points in each step, we first need three steps with a Runge-Kutta method which uses the same number of function evaluations in each step.
x0 x1 x2 x3 x4 x5 x6 x7
[------|------|-----|-----|-----|-----|-----|
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
method: RK RK RK P-C P-C P-C P-C
#evals: 4 + 4 + 4 + 1 + 1 + 1 + 1 = 16
+--------+
| /15 |
+--------+
Give the linear system one has to solve in the method of finite differences with h = 0.2. Be considerate for the mixed boundary conditions.
Answer:
y'(i) = (y(i+1) - 2*y(i) + y(i-1))/h^2, i = 0,1,..,5 = (1-0)/0.2
x(i) = 0 + i*h, h = 0.2
y(i+1) - (2-h^2)*y(i) + y(i-1) = 3*x(i)^2*h^2
boundary conditions:
1) y(0) = 1
2) y'(1) = (y(1+h) - y(1-h))/(2*h) = (y(6) - y(4))/(2*h)
y'(1) = 0 => y(6) = y(4)
So the linear system we have to solve is
[ -2+h^2 1 0 0 0 ][y(1)] [ 3 0.2^2 h^2 - 1 ]
[ 1 -2+h^2 1 0 0 ][y(2)] [ 3 0.4^2 h^2 ]
[ 0 1 -2+h^2 1 0 ][y(3)] = [ 3 0.6^2 h^2 ]
[ 0 0 1 -2+h^2 1 ][y(4)] [ 3 0.8^2 h^2 ]
[ 0 0 0 2 -2+h^2 ][y(5)] [ 3 h^2 ]
+--------+
| /15 |
+--------+
With our first guess y'(0) = 1 we find 0.735758 at x=1. Our second guess y'(0) = 3 yields 1.47152 at x=1. What is your next guess for y'(0) in the shooting method?
Answer:
p(1) = 0.735758
p(3) = 1.47152
z-1 z-3
p(z) = ----- 1.47152 + ----- 0.735758
3-1 1-3
= 0.367881 z + 0.367877
find z so that p(z) = 5
5 - 0.367877
z = -------------- = 12.5914
0.367881
+--------+
| /15 |
+--------+