Question: EDIT OR CHANGE MY CODE ( MATLAB ) Ideal Gas (vector creation and use in formula) My Solutions : The pressure, volume, temperature, and mass

EDIT OR CHANGE MY CODE ( MATLAB )EDIT OR CHANGE MY CODE ( MATLAB ) Ideal Gas (vector creationand use in formula) My Solutions : The pressure, volume, temperature, and

Ideal Gas (vector creation and use in formula) My Solutions : The pressure, volume, temperature, and mass of an ideal gas are related by the ideal gas equation of state: PV=MmRT where P represents pressure (Pascals), V represents volume (cubic meters), m represents mass (grams), T represents temperature (Kelvin), and M represents the molecular mass of the gas (grams/mole). R is the ideal gas constant and has a value of 8.31447 Joules/(mole-Kelvin). An isothermal expansion process is one in which the gas temperature remains constant as the volume of the gas increases. Consider the isothermal expansion of a mass of 500 grams of carbon dioxide ( CO2,M=44.01 grams/mole) from a volume of 0.1 cubic meters to a volume of 0.8 cubic meters at a constant temperature of 750 Kelvin. Write a script to compute the pressure in the gas corresponding to 80 equally-spaced volume values between the minimum and maximum volumes. Assign the calculated pressure values to a variable named Pressure. Next combine these pressure values with the incremental volume values and the temperature in a 3 -column matrix with temperature values in the first column (all values in this column equal 750), the evenly-spaced volume values in the second column, and the corresponding pressure values in the third column. Assign this matrix to the variable TVPvalues. Solve this problem using vectorized code (i.e. do not use a loop in your solution.) Script 0 \begin{tabular}{ll} 1 & function pressureTable = isothermallG (gasNames, molarMass, volume) \\ 2 & ( \\ 3 & M=44.01; \\ 4 & R=8.31447; \\ 5 & m=500; \\ 6 & T=750; \\ 7 & v=1inspace(0.1,0.8,80); \\ 8 & v= transpose (v); \\ 9 & Pressure= (mRT)/(vM); \\ 10 format short e; \\ 11 & TVPvalues=[T. ;ones (size(v)) v Pressure] \\ \hline \end{tabular} Assessment: Pretest results are not submitted for grading. To run all the tests and submit the results for grading, click Submit. Are the values assigned to Pressure correct? (Pretest) Solution script not found. Did you mean to write a script instead of a function? Are the values assigned to TVPvalues correct? Is solution approach free of loops (for or while)? Output Solution script not found. Did you mean to write a script instead of a function? (c) 2022 The MathWorks, Inc

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!