[Linear Least Squares] A simple linear least-squares-fit routine is at the end o
ID: 3845492 • Letter: #
Question
[Linear Least Squares] A simple linear least-squares-fit routine is at the end of this project description. The program can be modified to include seemingly non-linear power equations and exponential equations as described in class on 3/20/12. Make sure you understand how the Matlab code uses matrices to produce the “least- squares-fit”. Verify the Matlab code is working by finding the coefficients for the exponential growth of bacteria per unit volume present in a culture after x hours (2-pts.);
The tabulated data is given below.
Hours (x)
0
1
2
3
4
5
6
Number (y)
32
47
65
92
132
190
275
Hours (x)
0
1
2
3
4
5
6
Number (y)
32
47
65
92
132
190
275
u aeExplanation / Answer
We can get the value of coeficients by solving the equation , substitution (x,y) pair one at a time.
Equation: y = ae-bx
1) x=0 , y = 32
=> 32 = ae-b*0
=> 32 = ae0
=> 32 = a
2) x = 1 , y = 47
=> y = ae-bx
=> 47 = 32 * (2.71) -b*1
=> 47 = 32 * (2.71) -b
=> 47/32 = (2.71) -b
=> 1.46875 = (2.71) -b
taking log both sides;
.=> log(1.46875) = -b log (2.71)
=> log2.71(1.46875) = -b
=> -b = 0.3855882695021
=> b = -0.3855882695021
hence, a = 32
b = -0.3855882695021
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.