Q1(a) Write a function to calculate the specific volume using the ideal gas equation. The input of the function should be temperature (in units of degrees Celsius). The output should be in units of m³/kg. [1]: ## Question 1(a)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Answer q1A
In [1]: import numpy as np
data = np.array([[0.5,81.3, 3.239],
[1,99.6,1.694],
[10,179.9,0.1944],
[20,212.4,0.09957],
[40,250.3,0.04977],
[100,311,0.01802],
[150,342.1,0.01035],
[180,357,0.00751],
[200,365.7,0.00585],
[220,373.7,0.0036811)
The code below can be used to import the Rogers and Mayhew table. Note: you will need to use this data inside functions in some questions. You can copy
and paste the code below into the specific function.
P_data= data[:,0]
Tsat_data= data[:,1]
vg_data= data[:,2]
In [1]: ## Question 1(a)
## Autograded Answer
## Question 1 ########********
import numpy as np
def get_vg (T):
Q1(a)
Write a function to calculate the specific volume using the ideal gas equation. The input of the function should be temperature (in units of degrees Celsius).
The output should be in units of m³/kg.
# Your code here
200
return vg
220
In [2] # Don't write code in this line
365.7
373.7
0.00585
0.00368
Transcribed Image Text:In [1]: import numpy as np data = np.array([[0.5,81.3, 3.239], [1,99.6,1.694], [10,179.9,0.1944], [20,212.4,0.09957], [40,250.3,0.04977], [100,311,0.01802], [150,342.1,0.01035], [180,357,0.00751], [200,365.7,0.00585], [220,373.7,0.0036811) The code below can be used to import the Rogers and Mayhew table. Note: you will need to use this data inside functions in some questions. You can copy and paste the code below into the specific function. P_data= data[:,0] Tsat_data= data[:,1] vg_data= data[:,2] In [1]: ## Question 1(a) ## Autograded Answer ## Question 1 ########******** import numpy as np def get_vg (T): Q1(a) Write a function to calculate the specific volume using the ideal gas equation. The input of the function should be temperature (in units of degrees Celsius). The output should be in units of m³/kg. # Your code here 200 return vg 220 In [2] # Don't write code in this line 365.7 373.7 0.00585 0.00368
Question 1
The specific volume of saturated steam can be calculate using the ideal gas equation of state and the saturation temperature and pressure as follows
RT (P)
P
where
Ug = specific volume of the saturated steam (units kg/m³)
P= Pressure (units Pa)
Tsat (P) = Saturation temperature at pressure P (units K)
R= specific ideal gas constant (=461.5 J/kg K for steam)
It is well known, however, that the ideal gas equation will produce very large errors at high pressure, in particular as the pressure approaches the critical point.
Affandi et al. (2013) have proposed an alternative equation of state, based on the reduced saturation temperature (T, = T/Terit) only, as follows
In(vg) = a + b[ln (1/T,)]04 + c/T² + d/T + e/T
Values for a -e are given below
A = -7.75883
B = 3.23753
C = 2.05755
D=-0.06052
E = 0.00529
The aim of this exercise is to validate or otherwise the two methods using a data set taken from the Rogers and Mayhew property tables used in this module.
This data is given below:
In [1]; import numpy as np
data = np.array([[0.5,81.3,3.239],
P [bar] Tat [C] ug [m³/kg]
0.5
81.3
1
99.6
10
20
[1,99.6,1.694],
[10,179.9,0.1944),
[20,212.4,0,09957),
[40,250.3,0.04977),
40
100
150
180
200
220
The code below can be used to import the Rogers and Mayhew table. Note: you will need to use this data inside functions in some questions. You can copy
and paste the code below into the specific function.
179.9
212.4
250.3
311
342.1
357
365.7
373.7
3.239
1.694
0.1944
0.09957
0.04977
0.01802
0.01035
0.00751
0.00585
0.00368
Transcribed Image Text:Question 1 The specific volume of saturated steam can be calculate using the ideal gas equation of state and the saturation temperature and pressure as follows RT (P) P where Ug = specific volume of the saturated steam (units kg/m³) P= Pressure (units Pa) Tsat (P) = Saturation temperature at pressure P (units K) R= specific ideal gas constant (=461.5 J/kg K for steam) It is well known, however, that the ideal gas equation will produce very large errors at high pressure, in particular as the pressure approaches the critical point. Affandi et al. (2013) have proposed an alternative equation of state, based on the reduced saturation temperature (T, = T/Terit) only, as follows In(vg) = a + b[ln (1/T,)]04 + c/T² + d/T + e/T Values for a -e are given below A = -7.75883 B = 3.23753 C = 2.05755 D=-0.06052 E = 0.00529 The aim of this exercise is to validate or otherwise the two methods using a data set taken from the Rogers and Mayhew property tables used in this module. This data is given below: In [1]; import numpy as np data = np.array([[0.5,81.3,3.239], P [bar] Tat [C] ug [m³/kg] 0.5 81.3 1 99.6 10 20 [1,99.6,1.694], [10,179.9,0.1944), [20,212.4,0,09957), [40,250.3,0.04977), 40 100 150 180 200 220 The code below can be used to import the Rogers and Mayhew table. Note: you will need to use this data inside functions in some questions. You can copy and paste the code below into the specific function. 179.9 212.4 250.3 311 342.1 357 365.7 373.7 3.239 1.694 0.1944 0.09957 0.04977 0.01802 0.01035 0.00751 0.00585 0.00368
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education