Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) 40 points. Calculate multiple Pressure-Density Isotherms for ethylene using the Peng-Robinson Equation of State (PREoS) Create a program using the Python-based Juypter Notebook to

image text in transcribed

image text in transcribed

1) 40 points. Calculate multiple Pressure-Density Isotherms for ethylene using the Peng-Robinson Equation of State (PREoS) Create a program using the Python-based Juypter Notebook to calculate"n" different pressure-density isotherms. Use a value of n-3 in the worksheet, but your program should be coded to allow the user to input any value of n. Create the PREoS program so that it has a loop within a loop to calculate three different isothermal, Pressure (bar) - Density (g/cc) sets of data with pressure ranging from 10 bar to a maximum pressure of 120 bar. Your program must address the following issues 1) The temperatures and pressures-density data must be printed by your program. They should have 0, 1, and 3 numbers past the decimal point, and this formatting should be done by your program If the name of the compound is changed, the name should change automatically in the table headers and worksheet label. 2) 3) The pressure range used for the calculations should go from 10 to 120 bar. 4) The three temperatures should vary by 25 C -- choose a starting temperature between 40 and 5) Tloop should be the integer counter name for the temperature loop & Ploop should be the 6) Your program should 'read in' the input data from a "Data" Excel workbook and 'write out' the 60 C. integer counter name for the pressure loop input PLUS calculated data into a "Results" Excel workbook. Your program should name the written sheet as ""Compound Name'... Cto C". The 'Compound Name' is the entry in cell (7,2), the first temperature is in cell (2,2), and final temperature depends on what you choose for the initial temperature 7) Print your workbook showing the results for two different starting temperatures for ethylene 8) Print your code -- be sure to annotate your code! 9) The critical properties of ethylene are shown in the next figure -- do your calculations for ethylene 10) Here are specific items your program must have Your program must be in a function that you name Read in data to your program from the worksheet and use the Cells(row, column) format. Use a temperature loop called Tloop and within this loop create a pressure loop called Ploop to do calculations at each temperature over the entire pressure range there are approximately 30 lines for the entire temperature-pressure loop combination in my program, you should have roughly the same number of lines. d. Call the FindZ program from your main subroutine, but transfer in the RAI, RA2, RA3, a. b. c. and RA4 for the PREoS, which means that FindZ stands alone as a subroutine that solves any cubic equation and FindZ does not contain any calculations with PREoS variables. The PREoS, rewritten in compressibility, Z, is Z3 + (BB-1)-Z2 + (AA_2.BB-3.BB*)2+(BB" + BB2-AA+BB) = 0 and the code for the solution to the cubic equation is written as 1) 40 points. Calculate multiple Pressure-Density Isotherms for ethylene using the Peng-Robinson Equation of State (PREoS) Create a program using the Python-based Juypter Notebook to calculate"n" different pressure-density isotherms. Use a value of n-3 in the worksheet, but your program should be coded to allow the user to input any value of n. Create the PREoS program so that it has a loop within a loop to calculate three different isothermal, Pressure (bar) - Density (g/cc) sets of data with pressure ranging from 10 bar to a maximum pressure of 120 bar. Your program must address the following issues 1) The temperatures and pressures-density data must be printed by your program. They should have 0, 1, and 3 numbers past the decimal point, and this formatting should be done by your program If the name of the compound is changed, the name should change automatically in the table headers and worksheet label. 2) 3) The pressure range used for the calculations should go from 10 to 120 bar. 4) The three temperatures should vary by 25 C -- choose a starting temperature between 40 and 5) Tloop should be the integer counter name for the temperature loop & Ploop should be the 6) Your program should 'read in' the input data from a "Data" Excel workbook and 'write out' the 60 C. integer counter name for the pressure loop input PLUS calculated data into a "Results" Excel workbook. Your program should name the written sheet as ""Compound Name'... Cto C". The 'Compound Name' is the entry in cell (7,2), the first temperature is in cell (2,2), and final temperature depends on what you choose for the initial temperature 7) Print your workbook showing the results for two different starting temperatures for ethylene 8) Print your code -- be sure to annotate your code! 9) The critical properties of ethylene are shown in the next figure -- do your calculations for ethylene 10) Here are specific items your program must have Your program must be in a function that you name Read in data to your program from the worksheet and use the Cells(row, column) format. Use a temperature loop called Tloop and within this loop create a pressure loop called Ploop to do calculations at each temperature over the entire pressure range there are approximately 30 lines for the entire temperature-pressure loop combination in my program, you should have roughly the same number of lines. d. Call the FindZ program from your main subroutine, but transfer in the RAI, RA2, RA3, a. b. c. and RA4 for the PREoS, which means that FindZ stands alone as a subroutine that solves any cubic equation and FindZ does not contain any calculations with PREoS variables. The PREoS, rewritten in compressibility, Z, is Z3 + (BB-1)-Z2 + (AA_2.BB-3.BB*)2+(BB" + BB2-AA+BB) = 0 and the code for the solution to the cubic equation is written as

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions