14440127 PS 2- Solutions

14440127 PS 2- Solutions - 14:440:127- Introduction to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
14:440:127- Introduction to Computers for Engineers Solutions to Problem Set 2 1) Problem 6.1 A: function N = num_grains(n) N = 2.^(n-1); B: num_grains(10:100) C: plot(10:100, num_grains(10:100)) 2) Problem 6.2 A: function E = energy(m) c = 2.9979*10^8; E = m*c^2; B: m = logspace(0,6,100); disp(energy(m)) C: m = logspace(0,6,100); subplot(2,2,1);plot(m, energy(m)) subplot(2,2,2);semilogx(m, energy(m)) subplot(2,2,3);semilogy(m, energy(m)) subplot(2,2,4);loglog(m, energy(m)) 3) Problem 6.3 A: function n = nmoles(m,MW) n = m./MW; B: [mgrid MWgrid] = meshgrid(1:10, [78.115 46.07 102.3]); n = nmoles(mgrid, MWgrid); 4) Problem 6.6 (for part a, return –inf if t<0) A: function h = height(t) if (t<0) h=-inf; else h = -9.8*t.^2 + 125*t +500; end B: time = 0:0.5:30; plot(time,height(time)) C: time = 0:0.5:30; [a b] = max(height(time)); disp(time(b))
Background image of page 1

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

View Full DocumentRight Arrow Icon
5) Problem 6.10 Parts a,b,c A: pressure = @(h) 13560*9.8*h; B: Pa_to_atm = (p) p./101325; C: disp(Pa_to_atm(pressure(0.5:0.1:1))) 6) Problem 6.11 Parts a,b
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.

Page1 / 3

14440127 PS 2- Solutions - 14:440:127- Introduction to...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online