Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help writing function a2fn for matlab specifically Grading Policy: This assignment is worth 50 points. It will be graded against a rubric created by
please help writing function a2fn for matlab specifically
Grading Policy: This assignment is worth 50 points. It will be graded against a rubric created by the instructor. This rubric will be made available to the students 1 week after the assignment is due, beyond which no submission will be accepted for credit-you will have earned 0 points. Task 1: Function of Interest (25 pts): Consider the following Peng-Robinson equation of state in polynomial form: 73 - (1 - B)/2 + (A - 2B - 3B2)2 - (AB - B2-B) = 0 where pV z = RT CENG 3320 Chemical Engineering Analysis Spring 2022 a = (0,45724) CE b = 0.0778 T: a = ((1 + X(1 - 796)))/T, K = 0.37464 + 1.542660 -0.2699202 7 T = To P, P Z is the compressibility factor. w is the acentric factor of the species. It is said to be a measure of the non-sphericity (centricity) of molecules. As it increases, the vapor curve is "pulled" down, resulting in higher boiling points. Vm is the molar volume, R is the universal gas constant, T, criti- cal temperature, pe critical pressure. Write a MATLAB function for this function, calling it a2fn.m. It must have the interface: Z a3fn General Description This returns the function: f(Z) = 73 - (1-B)22 + (A - 2B - 3B2)Z - (AB - B2-B3) Calling Syntax f = a2fn(2) Input Argument scalar A positive number Return Argument f scalar Solution to the function. Additional Specifications and Notes This function must check to ensure that only one scalar argument is input. Furthermore, this argument must be positive, i.e., 2 > 0. If not, a meaningful error message must be issued. It must return the value to function. Values of the parameters are to be decided accordingly. Write a script file a taskla.m that call function fzero, sending to it function a2fn via a handle (an @ pointer). The purpose is to get estimates for roots of function a2fn using the root-finding algorithm fzero. This script ataskla is to determine the compressibility factor Z for n-butane (you need the 0.193, TC = 425.2K, Pc = 37.5 atm values.). Find the molar volume Vm at saturated pressure Psat (T) = 20.8 atm for n-butane at 390K. @= - Grading Policy: This assignment is worth 50 points. It will be graded against a rubric created by the instructor. This rubric will be made available to the students 1 week after the assignment is due, beyond which no submission will be accepted for credit-you will have earned 0 points. Task 1: Function of Interest (25 pts): Consider the following Peng-Robinson equation of state in polynomial form: 73 - (1 - B)/2 + (A - 2B - 3B2)2 - (AB - B2-B) = 0 where pV z = RT CENG 3320 Chemical Engineering Analysis Spring 2022 a = (0,45724) CE b = 0.0778 T: a = ((1 + X(1 - 796)))/T, K = 0.37464 + 1.542660 -0.2699202 7 T = To P, P Z is the compressibility factor. w is the acentric factor of the species. It is said to be a measure of the non-sphericity (centricity) of molecules. As it increases, the vapor curve is "pulled" down, resulting in higher boiling points. Vm is the molar volume, R is the universal gas constant, T, criti- cal temperature, pe critical pressure. Write a MATLAB function for this function, calling it a2fn.m. It must have the interface: Z a3fn General Description This returns the function: f(Z) = 73 - (1-B)22 + (A - 2B - 3B2)Z - (AB - B2-B3) Calling Syntax f = a2fn(2) Input Argument scalar A positive number Return Argument f scalar Solution to the function. Additional Specifications and Notes This function must check to ensure that only one scalar argument is input. Furthermore, this argument must be positive, i.e., 2 > 0. If not, a meaningful error message must be issued. It must return the value to function. Values of the parameters are to be decided accordingly. Write a script file a taskla.m that call function fzero, sending to it function a2fn via a handle (an @ pointer). The purpose is to get estimates for roots of function a2fn using the root-finding algorithm fzero. This script ataskla is to determine the compressibility factor Z for n-butane (you need the 0.193, TC = 425.2K, Pc = 37.5 atm values.). Find the molar volume Vm at saturated pressure Psat (T) = 20.8 atm for n-butane at 390K. @= 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