Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 - Linearized Model: Cubic Equation of State ( 1 5 pts ) The van der Waals ( vdW ) cubic equation of state
Problem Linearized Model: Cubic Equation of State pts
The van der Waals vdW cubic equation of state is a model that describes the thermody
namic properties of a nonideal gas using two parameters a and :
where is the pressure, is the gas constant, is the temperature, and is the molar vol
ume.
We would like to use linear regression to solve for the parameters of the model in the case of
methane gas. Experimental data for the pressure as a function of molar volume is provided in
the "eosdata.dat" file. All data was collected at However, since the equation of
state is not linear with respect to the parameters, a linearized version should be derived first.
a Derive a linearized form of the vdW equation of state shown above. There are several
ways to linearize the equation of state. However, some methods are better than
others; aim for three unknowns where one is technically a function of the other two. Fi
nally, rewrite into general matrix form where is the vector of unknowns.
b Using Python and the matrix method for linear least squares regression, solve and re
port the model parameters for a and Sanity check that your third unknown is close
to its expected value based on the fit values of a and
c Code a function in Python that computes an array of pressures given an array of molar
volumes and the model parameters a and Use this function to plot the model predic
tions against the experimental data for the pressure of methane.
d Finally, discuss if other direct solvers, eg Gaussian Elimination, and iterative solvers,
eg GaussSeidel, would be appropriate for this problem. Explain your reasoning with
evidence.
"eosdata.dat" file content:
# VmLmol Pbar
Problem Linearized Model: Cubic Equation of State pts
The van der Waals vdW cubic equation of state is a model that describes the thermody
namic properties of a nonideal gas using two parameters a and :
where is the pressure, is the gas constant, is the temperature, and is the molar vol
ume.
We would like to use linear regression to solve for the parameters of the model in the case of
methane gas. Experimental data for the pressure as a function of molar volume is provided in
the "eosdata.dat" file. All data was collected at However, since the equation of
state is not linear with respect to the parameters, a linearized version should be derived first.
a Derive a linearized form of the vdW equation of state shown above.
Let's define a new variable, So
the equation becomes:
and
The equation now reads:
Create new variables:
and
The equation can be rewritten as follows:
This equation is now linear in relation to the
parameters alpha, beta, and
Finally, rewrite this equation in the general
matrix form
Start Answering from here using the equation above
b Using Python and the matrix method for linear least squares regression, solve and re
port the model parameters for a and Sanity check that your third unknown is close
to
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