Академический Документы
Профессиональный Документы
Культура Документы
Engineering Analysis
Fall 2005
Error Analysis
1. Use zero through third order Taylor series expansions to predict f (3) for
f ( x) = 25 x 3 6 x 2 + 7 x 88
using a base point of x = 2. Compute the percent relative error and the number of significant digits
for each approximation.
2. Use zero through fourth order Taylor series expansions to predict f (3) for
f ( x) = e x
using a base point of x = 1. Compute the percent relative error and the number of significant digits
for each approximation.
t=7
g = 9 .8
m = 68.1 0.5
c = 12.5 2
4. Let x = 37.5678 and y = 37.5318. If our computer can only store 4 digits, what is the relative error for
x and y when we represent the numbers using our computer. Compute z = (x - y) + 0.01946. What is
the relative error of z. How many digits of significance does z have.
5. What is the rate of convergence for f(n). f(n) converges to 0 but at what rate O(?). Recall
n converges to with rate n if n n . k for some constant k
(n 2). ( n 4)
f( n )
3
n
Homework Assignment #2
EEL 3420 Engineering Analysis
3 2
f( x) x 3.5. x 21.0. x 67.5.
Use a bracket method first to find an initial approximation then use Newton's method to further
improve your estimate to 2 digits of accuracy.
1000
f( x ) 0 0
1000
10 0 10
x
1
f ( x) = 5.
x5
4. Using a computer language of your choice implement Newton's method to find the roots of arbitrary
polynomials to 4 significant digits. The function will have as its inputs the coefficients of the input
function and its degree, the coefficients of the derivative function and an initial guess of the root. In
'
each iteration, the function is to compute the values of f ( p k ) and f ( p k ) using Horner's method
as discussed in class. Recall that Newton's method uses
f ( pk )
p k +1 = p k
f ' ( pk )
p( x) = a 0 x n + a1 x n 1 + L + a n
Ans = A[0];
For (x = 0; x < N; x++)
Ans = Ans *c + A[x];
Homework Assignment #3
EEL 3420 Engineering Analysis
Matrices
1. Given
1 3 2 1
A= and B =
2 0 1 2
show that
( A + B)( A B) A 2 B 2
2 1 2 1 3 0 2 0 0
.A A . .A
3 2 3 2 5 0 1 0 0
3 1 1 2 3 1
1 3 1 1 4 3
1 1 3 1 2 0
4. Prove that
AB = A B
for any 2 square matrices. Assume the matrices are 2x2. Note this is true for all square matrices of size
nxn.
1 2 3
A 1 3 5
1 5 12
6. Find the left multiplicative inverse, if it exist, of
1 1
3 4
0 0
Show that the right inverse does not exist.
2x + z
x+ y
2y z
9. Find the characteristic equation, the eigenvalues, and a set of eigenvectors for the given 4 matrices.
3 0 2
5 3 1 2 2 0
, , , 0 1 2
2 4 4 3 0 0
2 2 2
2 4
A
1 1
Homework Assignment #4
EEL 3420 Engineering Analysis
Systems of Equations
x1 + x 2 x3 = 3
2 x1 x 2 3 x3 = 0
x1 2 x 2 + x3 = 5
2. Write a MATLAB program to solve the following linear systems using all three Gaussian algorithms
and the Gauss-Jordan algorithm.
3. Use the Gaussian-Jordan method, by hand, to find the inverse of the following matrix.
10 3 6
1 8 2
2 4 9
4. Modify the MATLAB Gaussian-Jordan program that you implemented so that it can be used to find
the inverse of the matrix in the previous problem.
5. Find the fixed points for the following system of nonlinear equations. You may use MATLAB as a tool
for the matrix manipulation.
x = g1 ( x, y, z ) = 9 x 2 + 36 y 2 + 4 z 2 36
y = g 2 ( x, y, z ) = x 2 2 y 2 20 z
z = g 3 ( x, y, z ) = 16 x x 3 2 y 2 16 z 2
Homework Assignment #5
EEL 3420 Engineering Analysis
Curve fitting
1. Given the following 3 sets of data, for each set, use regression to find a polynomial
that best fits the data. For each set determine what percentage of the variation can be
explained for. Try 1st order, 2nd order until you get a good fit. Hint: put the data
into two matrices so that you can easily manipulate them using MATLAB and
generate
n n
2
xi xi
i= 1 i= 1
10
7.524391 x x
f( x) e e
x f( x)
f( x ) 5
0 2
1 3.086
2 7.524
2 0
0 1 2
0 x 2
3. Write a program to generate 10 evenly spaced points from 0 to 2 using f(x) above and
find a 9th order interpolating polynomial using these 10 points. Hint: Newton's
algorithm produces the b's. Use this polynomial to estimate the value at x = 1.5 and
find the error.
355 10 1
237.1 9 1
145.4 8 1
76.9 7 1
28.6 6 1
2.5 5 1
19.4 4 1
25.1 3 1
22.6 2 1
14.9 1 1
Y 5 X 0 O 1
4.1 1 1
Z augment( O , X ) 9.4 2 1
7.9 3 1
1
T .ZT .Y
A Z .Z 3.4 4 1
n rows( Y )
27.5 5 1 n = 21
19.667
A= 67.4 6 1 m cols( Z )
22.9 m =2
126.1 7 1
L( x ) A0 A1 .x i 0 , 1 .. n 1
206.6 8 1
k 0 , 1 .. n 1 311.9 9 1 j 0 , 1 .. m 1
445 10 1 2
sr Yi Aj .Zi , j
i j
First Order
600
5
sr = 1.593 10 Yi
400 i
ybar
n
2
Yk
200 st Yi ybar
L( x ) i
0 5
st = 5.631 10
200 st sr
rsquare
st
400
10 5 0 5 10
X ,x
k
rsquare = 0.717
2 0 1 2
X2i Xi
0 1 -10 100
Z augment( O , X ) 1 1 -9 81
2 1 -8 64
Z augment( Z , X2 )
3 1 -7 49
1 4 1 -6 36
T .ZT .Y
A Z .Z
5 1 -5 25
5 6 1 -4 16
Z=
A = 22.9 7 1 -3 9
n rows( Y )
0.4 8 1 -2 4 n = 21
9 1 -1 1 m cols( Z )
A1 .x A2 .x
2
L( x ) A0 10 1 0 0 m =3
11 1 1 1 i 0 , 1 .. n 1
12 1 2 4
j 0 , 1 .. m 1
13 1 3 9
2
14 1 4 16 sr Yi Aj .Zi , j
i 0 , 1 .. 20 i j
Second Order
5
600 sr = 1.557 10 Yi
i
ybar
400 n
2
st Yi ybar
200
Yi i
L( x ) 5
0
st = 5.631 10
st sr
200 rsquare
st
400
10 5 0 5 10
rsquare = 0.723
X ,x
i
3
0 1 2 3
X3i Xi
3
0 1 -10 100 -1 10
Z augment( O , X ) 1 1 -9 81 -729
Z augment( Z , X2 ) 2 1 -8 64 -512
3 1 -7 49 -343
Z augment( Z , X3 )
4 1 -6 36 -216
5 1 -5 25 -125
1
T .ZT .Y
A Z .Z Z= 6 1 -4 16 -64
5 7 1 -3 9 -27
n rows( Y )
8 1 -2 4 -8 n = 21
10
A= 9 1 -1 1 -1 m cols( Z )
0.4 m =4
10 1 0 0 0
0.5
11 1 1 1 1 i 0 , 1 .. n 1
L( x ) A0 A1 .x A2 .x
2
A3 .x
3 12 1 2 4 8 j 0 , 1 .. m 1
13 1 3 9 27
2
14 1 4 16 64 sr Yi Aj .Zi , j
i 0 , 1 .. 20 i j
Third Order
600 sr = 0 Yi
i
ybar
400 n
2
st Yi ybar
200
Yi i
L( x ) 5
0
st = 5.631 10
st sr
200 rsquare
st
400
10 5 0 5 10
rsquare = 1
X ,x
i
7.524
p( x ) (x 1 ) .( x 2) x .( x 2 ) .3.086 x .( x 1).
2 x x
f( x ) e e
1.676 .x
2
.59 .x 2. 0 2
y 1 F 3.086
i 0 , 1 .. 2 2 7.524
Second Order
10
p( x ) 6
f( x )
Fi
4
0
0 0.5 1 1.5 2
x, x, y
i
f( 1.5 ) p ( 1.5 )
Er
f( 1.5 ) Er = 0.039
Homework Assignment #6
EEL 3420 Engineering Analysis
1. The following function corresponds to the normal distribution. There does not exist a
closed form expression of the integral for this function so one must use numerical
integration to find the probabilities. Use Simpson's 1/3 and 3/8 rule to integrate f(x)
from 0 to 3. Partition the integrating interval into 10 evenly spaced segments and use
the multiple application formula. You may use a computer if you like. Show all work
or show the program listing.
0 1
2
(x )
1 2 .
2 Note
f( x) .e
2. .
2 3
f( x) d x = 0.499
0
0.4
f( x )
0.2
0
0
x
xe
2x
2. Use Romberg integration to evaluate dx to an accuracy of 0.1%. Present your
0
3. For the function y = sin x compute the first derivative at x =
using the forward
3
difference approximation of O(h 2 ) and the centered difference approximations of
O(h 4 ) and using a value of h = .
12
4. The following data was collected for the distance traveled versus time for a rocket.
T 0 1 2 3 4 5
Y 0 2.1 7.8 18.2 31.9 50.3
Use numerical differentiation to estimate the rockets speed and acceleration at time T = 3.