Question
The vapor pressure of a component as a function of temperature can be predicted from the Antoine Equation: Where: A, B, and C are constants
The vapor pressure of a component as a function of temperature can be predicted from the Antoine Equation:
Where:
A, B, and C are constants for a given component
T is the Temperature in Kelvin
P* is the Vapor Pressure in mm Hg
Write a main program (.m file) in MATLAB that will calculate the vapor pressures of benzene between 300-600 Kelvin in increments of 30 K. The program should call a single function (separate .m file) called antoine, which will pass the Antoine constants and return (output) P* for each calculation of the vapor pressure.
The user should be prompted to enter a 1 or a 2 to select the type of loop used for the problem. Use a switch structure to solve the problem for either case - when case 1 is selected, a for loop should execute; when case 2 is selected, a while loop should run. In both cases, store the values of the temperature and pressure in a matrix
Use fprintf statements to print the your matrix as a table with the following headings:
Benzene
Temperature Vapor Pressure
(deg. Celsius) (mm Hg)
Remember to convert from Kelvin to degrees Celsius.
Finally, plot the vapor pressures as a function of temperature on a single plot, which is labeled appropriately. Use data markers of your choosing rather than a continuous curve.
Constants for Antoine Equation:
A B C
Benzene 15.9008 2788.1 -52.36
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