Question: Problem 4: (5 points) Consider a gas in a piston-cylinder device in which the temperature is held constant. As the volume of the cylinder (vol)

Problem 4: (5 points) Consider a gas in a piston-cylinder device in which the temperature is held constant. As the volume of the cylinder (vol) is changed, the pressure (pres) is measured. Write a function with the header [] = myPistonCyl (vol, pres, int) which fits volume-pressure data with first-, second-, third-, and fourth-order polynomial using the polyfit function Plot your results on the same graph e Plof the acfual data as a circle with no line . Calculate the values to plot prom your polynomial regression results at intervals of int. Do not show the calculated values on the plot, but do connect the points with solic lines. >> vol = 1:6; >> pres [2494 1247 831 623 499 416]; myPistonCyl (vol, pres, 0.2) Figure 1 File Edit View nsert Tools Desktop Window Help Piston-cylinder de vice at T 300K 2500 O Data -1st order -2nd order -3rd order 4th ordcr 2000 1500 1000 0. 500 1 1.5 2 2.5 33.5 44.5 5 5.5 6 Volume, m3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
