{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midterm1b

# midterm1b - Introduction to Computational Physics Phy 265...

This preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: Introduction to Computational Physics Phy 265 Midterm 1b (In-Class) March 2, 2011 Write and upload the script .m file described below to the class website. In order to receive full credit, your script must have proper formatting, run, and give the correct output. The Ideal Gas equation relates volume, pressure, temperature, and quantity of gas by nRT V= P where V is the volume in liters, P is the pressure in atmospheres, T is the temperature in Kelvin, n is the number of moles of gas, and R is the Gas Constant. An experiment was conducted to determine the value of R. In the experiment, 0.05 moles of gas were compressed to different volumes by applying pressure to the gas. At each volume, the pressure and temperature of the gas were recorded. Using the data given below, write a MATLAB script to determine R by plotting V on the vertical axis vs. T/P on the horizontal axis, and fitting the data points with a linear equation. V (L) 0.75 0.65 0.55 0.45 0.35 T (C) 25 37 45 56 65 P (atm) 1.63 1.96 2.37 3.00 3.96 Important Points: Use the MATLAB tasks polyfit and polyval to determine the best fit and obtain R. Be sure to label the axes and provide a title. Plot your data as black squares and the best-fit line as a solid red line. Include comments in your script. Be careful, temperature is given in Celsius in the table, but the Ideal Gas equation requires temperature in Kelvin. Print your value of R to the command window. The "accepted" value of R is 0.08214 L atm mole-1K-1. ...
View Full Document

{[ snackBarMessage ]}