You are on page 1of 4

CEE384 – Recitation 4.

1 - solution
Problem 1

𝑦 = 𝛼𝑒 𝛽𝑥
Take natural log of both sides

ln 𝑦 = ln 𝛼 + 𝛽𝑥
Make substitution in the above equation

Let 𝑧 = ln 𝑦

𝑎0 = ln 𝛼 implying 𝛼 = 𝑒 𝑎0

𝑎1 = 𝛽
The data z versus x now takes the form of a linear model

𝑧 = 𝑎0 + 𝑎1 𝑥
Use least square linear regression method to solve for 𝑎0 𝑎𝑛𝑑 𝑎1 coefficients

Calculate ∑ 𝑥

∑ 𝑥 = 0.1 + 0.2 + 0.4 + 0.6 + 0.9 + 1.3 + 1.5 + 1.7 + 1.8 = 8.5

∑ 𝑦 = 0.75 + 1.25 + 1.45 + 1.25 + 0.85 + 0.55 + 0.35 + 0.28 + 0.18 = 6.91

∑ 𝑥𝑦 = (0.1 × 0.75) + (0.2 × 1.25) + (0.4 × 1.45) + (0.6 × 1.25) + (0.9 × 0.85) + (1.3 × 0.55)
+ (1.5 × 0.35) + (1.7 × 0.28) + (1.8 × 0.18) = 4.46

∑ 𝑥 2 = 0.12 + 0.22 + 0.42 + 0.62 + 0.92 + 1.32 + 1.52 + 1.72 + 1.82 = 11.45

Calculate slope
𝑁 × ∑ 𝑥 − (∑ 𝑥 × ∑ 𝑦)
𝑚=
𝑁 × ∑ 𝑥 2 − (∑ 𝑥)2
9 × 4.46 − (8.5 × 6.91)
𝑚=
9 × 11.45 − (8.5)2
= −0.60432
Calculate y intercept
∑ 𝑦 − (𝑚 × ∑ 𝑥)
𝑐=
𝑁
6.91 − (−0.60432 × 8.5)
𝑐=
9
= 1.33852
Least square regression line equation is

𝑦 = 1.3385 − 0.6043𝑥
And

𝑧 = 𝑎0 + 𝑎1 𝑥
𝑎0 = 1.3385
𝑎1 = −0.6043
𝑎1 = 𝛽 = −0.6043

𝛼 = 𝑒 𝑎0 = 𝑒 1.3385 = 3.8133
𝛽 = −0.6043 𝛼 = 3.8133
Therefore,

𝑦 = 3.8133𝑒 −0.6043𝑥

Problem 2

𝑘𝑚𝑎𝑥 𝑐 2
𝑘=
𝑐𝑠 + 𝑐 2
Taking the reciprocal of both sides and rearrange
1 𝑐𝑠 1 1
=( . 2) +
𝑘 𝑘𝑚𝑎𝑥 𝑐 𝑘𝑚𝑎𝑥
After linearization, the following substitutions are made above;
1
𝑧=
𝑘
1
𝑞=
𝑐2
1 1
𝑎0 = 𝑖𝑚𝑝𝑙𝑦𝑖𝑛𝑔 𝑘𝑚𝑎𝑥 =
𝑘𝑚𝑎𝑥 𝑎0
𝑐𝑠 𝑎1
𝑎1 = 𝑖𝑚𝑝𝑙𝑦𝑖𝑛𝑔 𝑐𝑠 =
𝑘𝑚𝑎𝑥 𝑎0
The data z versus q now takes the form of a linear model

𝑧 = 𝑎0 + 𝑎1 𝑞
Use matlab to perform linear regression analysis

c=[0.5 0.8 1.5 2.5 4.0];


k=[1.1 2.4 5.3 7.6 8.9];
Y=transpose(k);
for n=1:5
X(n,1)=1;
X(n,2)=c(n);
end
format long
B=X\Y
kcalc=B(2)*X+B(1);
scatter(c,k)
hold on
plot(c,kcalc)
xlabel('c')
ylabel('k')
title('Linear Regression Relation Between c and k')
grid on

B =

0.931314878892733
2.219723183391004
𝑘 = 0.9313𝑐 + 2.2197
𝑧 = 𝑎1 𝑞+𝑎0
𝑎0 = 2.2197
𝑎1 = 0.9313
1 1
𝑘𝑚𝑎𝑥 = = = 0.4505
𝑎0 2.2197
𝑎1 0.9313
𝑐𝑠 = = = 0.4196
𝑎0 2.2197

You might also like