This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: NAME: .................................................................. AME 150  Final Exam 05/04/06 Closed book, closed notes, no calculator. Problem 1. (30 points) The ideal gas law relates pressure P (kPa), volume V (L), and absolute temperature T (K) through the equation PV = nRT, where n is the number of moles and R = 8 . 314 L · kPa/ ( mol · K ) is the universal gas constant. Write a MATLAB script that calculates pressure P as two moles of gas are compressed from 10 L to 1 L at constant temperature T = 300 K and plots pressure vs. volume on a loglog plot using 900 data points and a solid line with a width of 3 pixels. The plot must have a title and axes appropriately labelled. Problem 2. (50 points) Consider a function, given by the following formula p ( x ) = ( a if  x  ≤ x 0 if  x  > x , where x = 1. (a) (10 points) What must be the value of the constant a for p ( x ) to be the probability density function? Justify your answer. Write MATLAB statements that produce a vector of 100 x values from x 1 = − 2 to x 2 = +2 and a corresponding vector of 100 p ( x ) function values (b) (20 points) using only for loop and ifelse constructs (c) (20 points) using only vector syntax and logical arrays Problem 3. (40 points) The script file and MATLAB functions seed and random1 given...
View
Full Document
 Spring '08
 Domaradzki
 matlab, ........., Cumulative distribution function

Click to edit the document details