Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You will be writing one Python program, and you will upload the py file to the Homework 7 Upload dropbox. 4s 2s 2 In Thermo
You will be writing one Python program, and you will upload the py file to the Homework 7 Upload dropbox. 4s 2s 2 In Thermo I, you studied the Rankine Cycle for power generation. Our BrightSpace site contains a substantial amount of review material for the Rankine Cycle. A core capability for performing calculations with the Rankine Cycle is the ability to determine the properties of STEAM, at the states. In Thermo I you learned how to use the steam tables in your textbook, and learned how to interpolate between the lines in the table. For this assignment, you will define a Python Class named State. The attributes and methods are defined below. The behavior of this class will be demonstrated with an example main program that uses the class The class named State has 8 attributes, an three methods: init defined below: cale, and print, as import numpy as np from scipy.interpolate import griddata class State: def-init-(self, pressure, T-None, x-None, w=None, h None, s None, name None): self.p-pressure # pressure-kPa self. T-T # Temperature-degrees C self.x-x # quality (a value between 0 and i) self.v-v # specific volume-m^3/kg self.h-h # enthalpy _ kJ/kg self s # s # entropy-kJ/(kg K) self.name name # a useful identifier self-region = None # 'superheated' or 'saturated' if T-None and x-None and v-None and h-None and s-None: return self.calc0 dercalc(sel): # calculate the "missing" steam properties using griddatao and the steam tables given earlier. IMPORTANT: a)look carefully at the PRESSURE units in the two tables. They are DIFFERENT. b) Beware of the GAP IN THE DATA problem! You will be writing one Python program, and you will upload the py file to the Homework 7 Upload dropbox. 4s 2s 2 In Thermo I, you studied the Rankine Cycle for power generation. Our BrightSpace site contains a substantial amount of review material for the Rankine Cycle. A core capability for performing calculations with the Rankine Cycle is the ability to determine the properties of STEAM, at the states. In Thermo I you learned how to use the steam tables in your textbook, and learned how to interpolate between the lines in the table. For this assignment, you will define a Python Class named State. The attributes and methods are defined below. The behavior of this class will be demonstrated with an example main program that uses the class The class named State has 8 attributes, an three methods: init defined below: cale, and print, as import numpy as np from scipy.interpolate import griddata class State: def-init-(self, pressure, T-None, x-None, w=None, h None, s None, name None): self.p-pressure # pressure-kPa self. T-T # Temperature-degrees C self.x-x # quality (a value between 0 and i) self.v-v # specific volume-m^3/kg self.h-h # enthalpy _ kJ/kg self s # s # entropy-kJ/(kg K) self.name name # a useful identifier self-region = None # 'superheated' or 'saturated' if T-None and x-None and v-None and h-None and s-None: return self.calc0 dercalc(sel): # calculate the "missing" steam properties using griddatao and the steam tables given earlier. IMPORTANT: a)look carefully at the PRESSURE units in the two tables. They are DIFFERENT. b) Beware of the GAP IN THE DATA
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started