
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
can you please type in the code so I can copy paste
![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,a(P)
Ug =
P
where,
Ug = specific volume of the saturated steam (units kg/m3)
P = Pressure (units Pa)
Tra (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[(1/T,)]04 + c/T? + d/T,4 + e/T,S
Values for a - e are given below
a
C
d
e
-7.75883
3.23753
2.05755
-0.06052
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.
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 m3/kg.
]: ## Question 1(a)
## Autograded Answer
## Question 1 ################
import numpy as np
def get_vg(T):
# YOUR CODE HERE
raise NotImplementedError()
return vg
]: # Don't write code in this line](https://content.bartleby.com/qna-images/question/7a796d22-ee71-47ae-8ac5-4e88821c6b17/2b9061bf-05b0-4b0b-a2f7-3aaf81209580/m9pt43_thumbnail.png)
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,a(P)
Ug =
P
where,
Ug = specific volume of the saturated steam (units kg/m3)
P = Pressure (units Pa)
Tra (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[(1/T,)]04 + c/T? + d/T,4 + e/T,S
Values for a - e are given below
a
C
d
e
-7.75883
3.23753
2.05755
-0.06052
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.
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 m3/kg.
]: ## Question 1(a)
## Autograded Answer
## Question 1 ################
import numpy as np
def get_vg(T):
# YOUR CODE HERE
raise NotImplementedError()
return vg
]: # Don't write code in this line
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- Use the functions from the previous three problems to implement a pro-gram that computes the sum of the squares of numbers read from a file. Your program should prompt for a file name and print out the sum of thesquares of the values in the file. Hint: Use readlines ()arrow_forwardi need help rewriting my code. the question and the errors are screenshotted. I spoke with a TA and they said that i dont need a loop and im supposed to use .urllib.request or whatever IN the function, not as a from statement like shown, Hence the rewrite part. Help would be immensely appreciated. i was told that this function should be pretty small. from urllib.request import urlopenimport json def json_loader(url): response = urllib.request json_data = json.loads(response.read()) for data, value in json_data.items():print(data , ":" , value)arrow_forwardDo you know if you can paste the code in eclpise format?arrow_forward
- How do I write a code that will open the text file for reading, (test.txt), and that prints the first line of the file?arrow_forwardThis is not a graded questionarrow_forwardns the sa sing turns t to and er eturns file. E he new C Question 6 In the following code, what values does the loop index x take in each iteration? infile = open("filename.txt", "r") for x in infile: # more code Numbers 0, 1, 2, ... Each line of the file with name "filename.txt" Each character of the file with name "filename.txt" 1 pts Each character of the string "filename.txt" 1 ptsarrow_forward
- my code is # importing pandas for csv file operationsimport pandas as pd # filename to store the filename, change it to your filenamefileName = 'survey.csv' # Creating a dataframe by opening the given filedf = pd.read_csv(fileName) # converting the date string to datetimepd.to_datetime(df['Timestamp']) Question - Python code to drop the data values from your data set where the age is less than 1 or greater than 99.• Print the shape of your new data frame using the shape property.• Has the number of columns changed?• Has the number of rows changed?• Explain why each has or has not changed.arrow_forwardmy code is # importing pandas for csv file operationsimport pandas as pd # filename to store the filename, change it to your filenamefileName = 'survey.csv' # Creating a dataframe by opening the given filedf = pd.read_csv(fileName) # converting the date string to datetimepd.to_datetime(df['Timestamp']) Question - Python code to drop the data values from your data set where the age is less than 1 or greater than 99 BY USING DROP FUNCTION. DO NOT CHANGE ORIGINAL DATA FRAME Example of function required is df_data.drop(df_data[df_data.salary<0].index,inplace=True) • Print the shape of your new data frame using the shape property.• Has the number of columns changed?• Has the number of rows changed?• Explain why each has or has not changed.arrow_forwardI have the following code but with the input file studentInfo.txt that has the input: ed18, Edward Duran, 077, 3.5 abc1234MikePeterson, 123, 3.7dw0,Danika Wilson, 083 , 3.9wd50,WillDavidson, 090,3hpj4332, Helen Jordan1983.88xd222XavierDavies1983.65ah1 Allisson Henson 147 2.9ne099 NinaEstrada, 095, 2sh5555 Skylar Huff 112 3.3 def reformat_student_info(filename): try: #Function to split the name into first and last parts def split_name(name): parts = name.split() if len(parts) == 2: return parts else: #If no space assume last name starts after first letter return [parts[0], parts[1:]] #Function to format GPA def format_gpa(gpa): #Ensure exactly one decimal point if '.' not in gpa: gpa = gpa + '.0' return gpa #Open input file with open(filename, 'r') as input_file: lines =…arrow_forward
- What is the purpose of the scanf() function?a. It creates formatted output.b. It converts binary values into ASCII characters that are put into memory.c. It inputs ASCII characters and converts them into binary values that it copies intovariables.d. It processes keys typed at the keyboard.arrow_forwardUsing Python Where am I going wrong with my code that the the "Difficult words percentage is :" keeps returning 100% instead of the correct percentage for the input text?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY