In: Mechanical Engineering
A bicycle rider is interested in the effects of temperature on air density. A change in temperature will also affect the tire pressure.
a) Write a computer program that calculates air density at atmospheric pressure for temperatures from -10?C to 50?C.
b) Assume that a bicycle tire is inflated to an absolute pressure of 450 kPa at 20?C. Assume also that the volume of the tire does not change with temperature. Write a program to show how the tire pressure changes with the temperature in the same range, -10?C to 50?C.
Prepare a table or graph or both.
a). Air density is related to temperature and pressure as follows:
where density()
is measured in kg/m3
Pressure (P) in pascal = 101325 Pa
Temperature(T) is measured in kelvin
R is gas constant for dry air = 287.03 J/(Kg-K)
[Copy-Paste the below program in Matlab and execute
it]
_____________________________________________________
clear
close all
clc
P = 101325; % pressure is in pascal
R = 287.05; % specific gas constant for dry air, units are in
J/(kg-K)
T=input('Enter temperature value in kelvin:');
rho = P/(R*T);
fprintf('density of air = %f\n',rho);
________________________________________________________________________
This program will give density as output in kg/m3 when temperature(in kelvin) in given as input for any value and not just in 263 to 323 kelvin(-10 to 50 celsius).
************************************************************************************************
b).
[Copy-Paste the below program in Matlab and execute
it]
____________________________________________________________________
clear
close all
clc
P1 = 450000; % pressure is in pascal
T1 = 293; % temperature is in
kelvin
T = 263:1:323;
P2 = (P1/T1).*T;
xlabel('Pressure');
ylabel('Temperature');
title('Pressure v/s Temperature plot');
hold on;
plot(P2,T,'*');
_________________________________________________________________________________