Tutorial 7 Solution
Tutorial 7 Solution
1. Use nonlinear regression and the following set of pressure-volume data to find the best
possible values of the virial coefficients A1 and A2 for the following equation. Use that
R=82.05mL.atm/(gmol.K) and T=303K.
Radiation,W/m2 144 188 245 311 351 359 308 287 260 211 159 131
a) Fit the data with the following equation to determine the coefficients a0, a1, and a2
where R and M are the radiation for the corresponding month number M.
1
b) Use the resulting equation to predict the radiation in mid August.
Solution:
a) a0= 246.1667, a1= -0.0223 and a2= -105.9675
t=[1 2 3 4 5 6 7 8 9 10 11 12]';
R=[144 188 245 311 351 359 308 287 260 211 159 131]';
Z=[ones(size(t)) sin(pi/6*t) cos(pi/6*t)];
a=(Z'*Z)\(Z'*R)
y=a(1)+a(2)*sin(t*pi/6)+a(3)*cos(pi/6*t);
plot(t,R,'o',t,y)
b) RmidAugust= 273.6146W/m2
y=a(1)+a(2)*sin(8.5*pi/6)+a(3)*cos(pi/6*8.5)
2
Sec 52
85-220 Numerical Analysis of Engineering Systems
Winter 2014
Tutorial 7
t (hours) 0.5 1 2 3 4 5 6 7 9
c) Use the resulting equation to predict the decay p of the organisms after 6.5 hours.
Solution:
c) A= 4.1375, B = 2.8959, C = 1.5349
t=[0.5 1 2 3 4 5 6 7 9]';
p=[6 4.4 3.2 2.7 2 1.9 1.7 1.4 1.1]';
Z=[exp(-1.5*t) exp(-0.3*t) exp(-0.05*t)];
a=(Z'*Z)\(Z'*p)
y=a(1)*exp(-1.5*t)+a(2)*exp(-0.3*t)+a(3)*exp(-0.05*t);
plot(t,p,'o',t,y)
5.5
4.5
3.5
2.5
1.5
1
0 1 2 3 4 5 6 7 8 9
3
y1=a(1)*exp(-1.5*6.5)+a(2)*exp(-0.3*6.5)+a(3)*exp(-0.05*6.5)
2. A material is tested for cyclic fatigue failure whereby a stress, in MPa, is applied to the
material and the number of cycles needed to cause failure is measured. The results are in
the table below. Use nonlinear regression to fit a power model to this data given by:
A1 N m
where the A1 is in MPa, and m is dimensionless. From the fit determine the values of A1
and m.
N, cycles 1 10 100 1000 10,000 100,000 1,000,000
4
Sec 53
85-220 Analysis of Mechanical Systems
Winter 2014
Tutorial 7
3. Use nonlinear regression and the following set of pressure-volume data to find the best
possible values of the virial coefficients A1 and A2 for the following equation. Use that
R=82.05mL.atm/(gmol.K) and T=303K.
Radiation,W/m2 144 188 245 311 351 359 308 287 260 211 159 131
d) Fit the data with the following equation to determine the coefficients a0, a1, and a2
where R and M are the radiation for the corresponding month number M.
5
e) Use the resulting equation to predict the radiation in mid August.
Solution:
e) a0= 246.1667, a1= -0.0223 and a2= -105.9675
t=[1 2 3 4 5 6 7 8 9 10 11 12]';
R=[144 188 245 311 351 359 308 287 260 211 159 131]';
Z=[ones(size(t)) sin(pi/6*t) cos(pi/6*t)];
a=(Z'*Z)\(Z'*R)
y=a(1)+a(2)*sin(t*pi/6)+a(3)*cos(pi/6*t);
plot(t,R,'o',t,y)
f) RmidAugust= 273.6146W/m2
y=a(1)+a(2)*sin(8.5*pi/6)+a(3)*cos(pi/6*8.5)
6
Sec 54
85-220 Numerical Analysis of Engineering Systems
Winter 2014
Tutorial 7
t (hours) 0.5 1 2 3 4 5 6 7 9
f) Use the resulting equation to predict the decay p of the organisms after 6.5 hours.
Solution:
g) A= 4.1375, B = 2.8959, C = 1.5349
t=[0.5 1 2 3 4 5 6 7 9]';
p=[6 4.4 3.2 2.7 2 1.9 1.7 1.4 1.1]';
Z=[exp(-1.5*t) exp(-0.3*t) exp(-0.05*t)];
a=(Z'*Z)\(Z'*p)
y=a(1)*exp(-1.5*t)+a(2)*exp(-0.3*t)+a(3)*exp(-0.05*t);
plot(t,p,'o',t,y)
5.5
4.5
3.5
2.5
1.5
1
0 1 2 3 4 5 6 7 8 9
7
y1=a(1)*exp(-1.5*6.5)+a(2)*exp(-0.3*6.5)+a(3)*exp(-0.05*6.5)
4. A material is tested for cyclic fatigue failure whereby a stress, in MPa, is applied to the
material and the number of cycles needed to cause failure is measured. The results are in
the table below. Use nonlinear regression to fit a power model to this data given by:
A1 N m
where the A1 is in MPa, and m is dimensionless. From the fit determine the values of A1
and m.
N, cycles 1 10 100 1000 10,000 100,000 1,000,000