matlab hw set 2

# matlab hw set 2 - Problem 1 Po=100 rabbits Po = 100 rabbits...

This preview shows pages 1–8. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Problem 1 Po=100 rabbits Po = 100 rabbits r=0.9 r = 0.9000 t=10 years t = 10 years e=2.718 e = 2.7180 P=Po*e^(r*t) P = 8.0955e+005 Problem 2 Q=8000 Q = 8000 R=1.987 R = 1.9870 ko=1200 ko = 1200 T=[100:50:500] T = 100 150 200 250 300 350 400 450 500 k=ko*exp(-Q./(R*T)) k = Columns 1 through 7 0.0000 0.0000 0.0000 0.0001 0.0018 0.0121 0.0510 Columns 8 through 9 0.1561 0.3820 fprintf('\n'); fprintf('k ko R T Q\n'); k ko R T Q fprintf('-------------------------\n');------------------------- fprintf('%2d %6.4f %6.2 %-2s %-3s\n', ... k, ko, R, T, Q);end Problem 3 20*100 ans = 2000 4*500 ans = 2000 heatO= 3000 heatO = 3000 2000+200+heatO ans = 5200 2000+2000+heatO 7000/2000 ans = 3.5000 Problem 4 theta = 0: pi/100: pi/2; v0 = 100; g= 9.81; R= v0^2 * sin(2*theta)/g; maxR=0 maxR = index= 0; for ind = 1: length(R) if R > maxR maxR = R; index=ind; end end maxAngle=theta maxAngle = Columns 1 through 8 0 0.0314 0.0628 0.0942 0.1257 0.1571 0.1885 0.2199 Columns 9 through 16 0.2513 0.2827 0.3142 0.3456 0.3770 0.4084 0.4398 0.4712 Columns 17 through 24 0.5027 0.5341 0.5655 0.5969 0.6283 0.6597 0.6912 0.7226 Columns 25 through 32 0.7540 0.7854 0.8168 0.8482 0.8796 0.9111 0.9425 0.9739 Columns 33 through 40 1.0053 1.0367 1.0681 1.0996 1.1310 1.1624 1.1938 1.2252 Columns 41 through 48 1.2566 1.2881 1.3195 1.3509 1.3823 1.4137 1.4451 1.4765 Columns 49 through 51 1.5080 1.5394 1.5708 plot(theta,R) title('Range vs the Angle theta'); xlabel('Angle Theta'); ylabel('Range'); grid on; Problem 5 n= 1:50 n = Columns 1 through 13 1 2 3 4 5 6 7 8 9 10 11 12 13 Columns 14 through 26 14 15 16 17 18 19 20 21 22 23 24 25 26 Columns 27 through 39 27 28 29 30 31 32 33 34 35 36 37 38 39 Columns 40 through 50 40 41 42 43 44 45 46 47 48 49 50 hn= 1./n hn = Columns 1 through 7 1.0000 0.5000 0.3333 0.2500 0.2000 0.1667 0.1429 Columns 8 through 14 0.1250 0.1111 0.1000 0.0909 0.0833 0.0769 0.0714 Columns 15 through 21 0.0667 0.0625 0.0588 0.0556 0.0526 0.0500 0.0476 Columns 22 through 28 0.0455 0.0435 0.0417 0.0400 0.0385 0.0370 0.0357 Columns 29 through 35 0.0345 0.0333 0.0323 0.0313 0.0303 0.0294 0.0286 Columns 36 through 42 0.0278 0.0270 0.0263 0.0256 0.0250 0.0244 0.0238 Columns 43 through 49 0.0233 0.0227 0.0222 0.0217 0.0213 0.0208 0.0204 Column 50 0.0200 cumsum(hn) ans = Columns 1 through 7 1.0000 1.5000 1.8333 2.0833 2.2833 2.4500 2.5929 Columns 8 through 14 2.7179 2.8290 2.9290 3.0199 3.1032 3.1801 3.2516 Columns 15 through 21 3.3182 3.3807 3.4396 3....
View Full Document

{[ snackBarMessage ]}

### Page1 / 19

matlab hw set 2 - Problem 1 Po=100 rabbits Po = 100 rabbits...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online