Linear Algebra, Notebook Problem 1 Example Solution The purpose

Linear Algebra, Notebook Problem 1 Example Solution
The purpose of this notebook problem is to explore the problem of fitting a given
set of data with a polynomial of a given degree. The data comes from pg. 27, number
34 of the Dennis Lay Linear Algebra text.
In a wind tunnel experiment, the force on a projectile due to air resistance was
measured at different velocities:
Velocity (times 100 ft/sec) [v] 0
Force (times 100 lb) [F ]
0
2
2.90
4
14.8
6
39.6
8
74.3
10
119
We are asked to find a fifth degree polynomial
F (v) = a0 + a1 v 1 + a2 v 2 + a3 v 3 + a4 v 4 + a5 v 5
(1)
which fits the above data. Substituting the data into eq. (1) leads to the augmented
matrix [A|b] where A is a Vandermonde matrix of the form


1 0
0
0
0
0


 1 2
4
8
16
32 




64
256
1024 
 1 4 16
,
A=
(2)
 1 6 36 216 1296

7776




 1 8 64 512 4096 32768 


1 10 100 1000 10000 100000
and b is the column vector






b=





0


2.9 


14.8 
.
39.6 


74.3 

119
Using Maple to find the reduced–row–echelon (rref ) form of [A|b] yields


1 0.0 0.0 0.0 0.0 0.0
0.0


 0 1
0
0
0
0
1.712500020 




1
0
0
0
−1.194791686 
 0 0

rref ([A|b]) = 
 0 0
0
1
0
0
0.6614583390 




 0 0

0
0
1
0
−0.07005208399


0 0
0
0
0
1 0.002604166693
(3)
(4)
It is clear that the solution to system of equations defined by [A|b] is unique and is
given specifically by the column vector
ā = [0.0, 1.712500020, −1.194791686, 0.6614583390, −0.07005208399, 0.002604166693]T .
(5)
1
Substituting the values ai from eq. (5) into eq. (1) yield the solution polynomial that
fits the above data. This claim is supported by Figure 1 shown in the attached Maple
code.
A follow up question asked if a polynomial of degree three can be found that fits
all of the above data. To answer this question we set up the new augmented matrix
[M |b] where M is a new Vandermonde matrix given by


1 0
0


 1 2
4 




1
4
16


,

(6)
M =

 1 6 36 


 1 8 64 


1 10 100
and b is the same vector from eq. (3). The rref form of [M |b] is given by


1 0.0 0.0 0.0


 0 1
0
0 




1
0 
 0 0
,
rref ([M |b]) = 
 0 0

0
1




 0 0

0
0


0 0
0
0
(7)
with the fourth row [. . . 0|1] implying that the system of equations defined by [M |b]
has no solution. Therefore, it is not possible to fit a third degree polynomial through
all of the given data.
! End of Solution. Begin some quick comments !
Below are some of the key features that I want to see in any future Notebook problem
solutions:
1. A statement of the problem. Your solution should be completely self–contained.
That is, I or any other student, should be able to pick up your solution and
know what it’s point/purpose is.
2. Complete sentences. That is how one communicates in writing, even Mathematics writing.
3. Most math stuff is put on a blank line and centered. This helps when it comes
to reading and organization. These lines are numbered for easy reference.
4. Logical flow of ideas from problem statement to problem solution. The reader
should not have to guess about anything. We are reading your answer to learn,
not to scratch our heads.
2
O with(linalg): with(plots):
O A:=vandermonde([0,2,4,6,8,10]);
b:=matrix(6,1,[0,2.9,14.8,39.6,74.3,119]);
augment(A,b);
R:=rref(augment(A,b));
SolutionVector:=col(R,7);
1 0
0
A :=
0
0
0
1
2
4
8
16
32
1
4
16
64
256
1024
1
6
36
216
1296
7776
1
8
64
512
4096
32768
1 10 100 1000 10000 100000
0
2.9
b :=
14.8
39.6
74.3
119
1 0
0
0
0
0
0
1 2
4
8
16
32
2.9
1 4
16
64
256
1024
14.8
1 6
36
216
1296
7776
39.6
1 8
64
512
4096
32768 74.3
1 10 100 1000 10000 100000 119
R :=
1 0. 0. 0. 0. 0.
0.
0 1 0 0 0 0
1.712500020
0 0 1 0 0 0
K1.194791686
0 0 0 1 0 0
0.6614583390
0 0 0 0 1 0 K0.07005208399
0 0 0 0 0 1
0.002604166693
SolutionVector :=
0. 1.712500020 K1.194791686 0.6614583390 K0.07005208399 0.002604166693
O plot1:=pointplot([[0,0],[2,2.9],[4,14.8],[6,39.6],[8,74.3],[10,
119]],symbolsize=25,symbol=solidbox,color=red):
plot2:=plot(SolutionVector[1]+SolutionVector[2]*x+SolutionVector
[3]*x^2+SolutionVector[4]*x^3+SolutionVector[5]*x^4+
SolutionVector[6]*x^5,x=-1..10,color=black,thickness=2,caption=
(1)
O
"Figure 1: Polynomial of Degree Five Fits Data"):%:
display({plot1,plot2});
100
80
60
40
20
0
2
4
6
8
x
Figure 1: Polynomial of Degree Five Fits Data
O with(LinearAlgebra):
O M:=VandermondeMatrix([0,2,4,6,8,10],6,3);
augment(M,b);
rref(augment(M,b));
M :=
1
0
0
1
2
4
1
4
16
1
6
36
1
8
64
1 10 100
10
1 0
0
0
1 2
4
2.9
1 4
16 14.8
1 6
36 39.6
1 8
64 74.3
1 10 100 119
1 0. 0. 0.
0 1 0 0
0 0 1 0
0 0 0 1
0 0 0 0
0 0 0 0
O
(2)