Beruflich Dokumente
Kultur Dokumente
ASSIGNMENT #4
Name: Uday Karri
Lab Section: B02
Date: October 15, 2013
Part A: Output
Please enter the temperature value in degrees F:30
Please enter the windspeed in mi/h:42
The wind chill temperature is: 13 degrees F.
The output for Q2 is:
years
monthly payment total payment
10.00
1053.34 126400.61
11.00
979.04 129232.91
12.00
917.38 132103.25
13.00
865.46 135011.41
14.00
821.17 137957.19
15.00
783.00 140940.34
16.00
749.79 143960.61
17.00
720.68 147017.75
18.00
694.96 150111.46
19.00
672.11 153241.46
20.00
651.70 156407.43
21.00
633.37 159609.05
22.00
616.84 162846.00
23.00
601.88 166117.91
24.00
588.28 169424.44
25.00
575.88 172765.22
26.00
564.55 176139.85
27.00
554.16 179547.96
28.00
544.61 182989.14
29.00
535.81 186462.98
30.00
527.69 189969.06
The output for Q10 is:
Interest Rate ACC Value
2.00 12189.94
2.50 12800.85
3.00 13439.16
3.50 14105.99
4.00 14802.44
4.50 15529.69
5.00 16288.95
5.50 17081.44
6.00 17908.48
The output for Q13 is:
n(months)
B
% loan Paid
0 20000.00
0
6.00 18278.92
8.61
12.00
18.00
24.00
30.00
36.00
42.00
48.00
54.00
60.00
16501.14
17.49
14664.80
26.68
12767.96
36.16
10808.63
45.96
8784.76
56.08
6694.22
66.53
4534.80
77.33
2304.25
88.48
0.21
100.00
Part B: Code
% Assignment #4
% Name: Uday Karri
% ID: 10078524
% Lab Section: B02
%clearing all variables and screen
clc
clear
%Question 1
% ask user for inputs:
T = input('Please enter the temperature value in degrees F:');
v = input('Please enter the windspeed in mi/h:');
%Write the equation out:
Twc = 35.74+0.6215*T-35.75*v^0.16+0.4275*T*v^0.16;
roundedTwc = round(Twc); %round function
P = 391.32;
n = 0:6:60;
rate = r/1200; %extracting pieces that will be repeated in the next equation.
%equations using element by element operations due to the presence of matrices:
B = A.*(1+(rate)).^n - ((P/rate).*((1+rate).^n - 1));
Paid = ((A-B)./A)*100;
%combining everything into a matrix to display in the proper format as per
question.
MatrixC = [n' B' Paid'];
disp('The output for Q13 is:')
disp('n(months)
B
% loan Paid')
disp(MatrixC)
%Question 15
%define variables:
vrun = 3;
vswim = 1;
L = 48;
ds = 30;
dw = 42;
y = 20:48; %range of y values are given using colon operator with an increment of 1.
%equations using element by element operations due to the presence of matrices:
Ds = sqrt(ds.^2+y.^2);
Dw = sqrt(dw.^2+(L-y).^2);
trun = Ds./vrun;
tswim = Dw./vswim;
Totaltime = trun+tswim;
Minimumtime = min(Totaltime); %finding the minimum time from the total time
matrix.
indexminimum = find(Totaltime == Minimumtime); %retrieving the index of the
minimum time.
ymin = y(indexminimum); %equating the corresponding y index and retrieving the
designated value.
disp('The output for Q15 is:')
1;
1;
1;
1;
1;];
hold on
plot(Eps_t, Sigma_t, '-r');
legend('engineering','true');
hold off
%Question 24:
c = 1.5; %cord length in meters.
t = 0.2; %maximum thickness as a fraction of cord length.
x = [0:0.01:1.5];
y1 = (t*c/0.2)*((0.2969*sqrt(x/c))-(0.1260*(x/c))(0.3516*(x/c).^2)+(0.2843*(x/c).^3)-(0.1015*(x/c).^4));
y2 = -(t*c/0.2)*((0.2969*sqrt(x/c))-(0.1260*(x/c))(0.3516*(x/c).^2)+(0.2843*(x/c).^3)-(0.1015*(x/c).^4));
plot(x,y1,'-b');
hold on %using the hold command to add the second plot to the same graph.
plot(x,y2,'-b');
hold off
title('Shape of symmetrical four digit NACA airfoil', 'FontSize', 14);