Contents
Aaron Klapheck
clear, clc
Date = date
Date =
12-Dec-2007
Problem 16
Elongation = [0:1:10];
Elongation_without_0 = [1:1:10];
Increasing_tension = [0, 3500, 6300, 9200, 11500, 13000, 13500, ...
13900, 14100, 14300, 14500];
Decreasion_tension = [0, 3000, 6000, 8800, 11100, 12300, 13500, 14000, ...
14300, 14500];
plot(Elongation, Increasing_tension, '*--', Elongation_without_0, ...
Decreasion_tension, 'o--'), title('Strain vs. Tension'), ...
xlabel('Elongation (in.*10^-3)'), ylabel('Tension Force (lb)'), ...
gtext('Increasing Tension'), gtext('Decreasing Tension')
Problem 19
V = [20:0.1:100];
m_1 = 1; m_2 = 3; m_3 = 7;
RT_V = 286.7*293./V;
plot(V, m_1*RT_V, V, m_2*RT_V, V, m_3*RT_V), xlabel('Volume (m^3)'), ...
legend('m = 1kg', 'm = 3kg', 'm = 7kg'), ylabel('Pressure (Pa)'), ...
title('Pressure vs. Volume of Air at 293 Kelvin')
Problem 21
time = [1:8, 10];
speed = [1210, 1866, 2301, 2564, 2724, 2881, 2879, 2915, 3010];
b = 3010; c = -0.51415;
t = [1:0.01:10];
s_of_t = b.*(1 - exp(c.*t));
plot(time, speed, 'o--', t, s_of_t), title('Rotational Speed vs. Time'), ...
xlabel('Time (sec)'), ylabel('Speed (rpm)'), ...
gtext('Function Approximation'), gtext('Data')
Problem 22 - Stem plot
Year = [1990, 1991, 1992, 1993, 1994];
Temp = [18, 19, 21, 17, 20];
stem(Year, Temp), title('Average Temperature vs. Time'), ...
xlabel('Time (years)'), ylabel('Temperature (degrees C)')
Problem 22 - Bar plot
bar(Year, Temp), title('Average Temperature vs. Time'), ...
xlabel('Time (years)'), ylabel('Temperature (degrees C)')
Problem 22 - Stairs plot
stairs(Year, Temp), title('Average Temperature vs. Time'), ...
xlabel('Time (years)'), ylabel('Temperature (degrees C)')
Problem 30 - a.
x = [25, 30, 35, 40, 45];
y = [5, 260, 480, 745, 1100];
plot(x, y, 'o')
p = polyfit(x, y, 1);
f_of_x = p(1).*x + p(2);
plot(x, y, 'o', x, f_of_x), xlabel('x'), ...
title('Finding a Function to Fit the Data'), ylabel('y'), ...
legend('Data', 'Approximating Function')
Problem 30 - b.
x = [2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10];
y = [1500, 1220, 1050, 915, 810, 745, 690, 620, 520, 480, 410, 390];
plot(x, y, 'o')
p = polyfit(log10(x), log10(y), 1);
m = p(1);
b = 10.^p(2);
x_2 = [2.5:0.1:10];
f_of_x = b.*x_2.^m;
plot(x, y, 'o', x_2, f_of_x), xlabel('x'), ...
title('Finding a Function to Fit the Data'), ylabel('y'), ...
legend('Data', 'Approximating Function')
Problem 30 - c.
x = [550, 600, 650, 700, 750];
y = [41.2, 18.62, 8.62, 3.92, 1.86];
plot(x, y, 'o')
p = polyfit(x, log10(y), 1);
m = p(1);
b = 10.^p(2);
x_2 = [550:1:750];
f_of_x = b.*(10).^(m.*x_2);
plot(x, y, 'o', x_2, f_of_x), xlabel('x'), ...
title('Finding a Function to Fit the Data'), ylabel('y'), ...
legend('Data', 'Approximating Function')
Problem 32a,b
Problem 32 - part a
t = [0:1:100000];
b = 0.000126;
fraction_of_C14 = exp(-b.*t);
plot(t, fraction_of_C14), xlabel('Time (years)'), ...
title('Fraction of C14 Remaining Over Time'), ...
ylabel('Fraction of C14 (unitless)')
Problem 32 - part b
t = [800:1:850];
b = 0.000126;
fraction_of_C14 = exp(-b.*t);
plot(t, fraction_of_C14), xlabel('Time (years)'), ...
title('Fraction of C14 Remaining Over Time'), ...
ylabel('Fraction of C14'), grid, ...
[Years_ago_died, Fraction_of_C14] = ginput(1)
Years_ago_died =
836.4631
Fraction_of_C14 =
0.9000