HW 4
Problem 1
The class notes gave us practice solving one equation and one unknown using Newton’s method, Goal Seek, and Solver, for simple problems. This problem does the same for a real problem for one equation in one unknown, but that has additional parameters. Make cells for these and refer to them. Make unit conversions as needed. Make it pretty!
The Redlich/Kwong Equation of State is
$$P = \frac{RT}{V-b} - \frac{a}{T^{1/2}V(V+b)},$$where $T$ is temperature, $V$ is molar volume, $R$ is the universal gas constant, $a$ and $b$ are compound-specific constants. Find the molar volume of ethane for the vapor phase that is present at $T=77$ $^o$C and $P=1$ bar. (Note, you should convert T to an absolute temperature scale (K).
For ethane, $a=2.877\times 10^8$ cm$^6$bar K$^{0.5}$mol$^{-2}$ and $b=60.211$ cm$^3$mol$^{-1}$.
This equation has three solutions. One of them corresponds to the liquid volume, the other is in between and is not physical. Think about what you can do to get a good initial guess for the vapor volume. This was discussed in class, and in the posted notes/questions.
Part A
- Solve using Excel’s Solver
Part B
- Solve using Newton’s method
Problem 2
The problem solves two equations in two unknowns, similar to the notes. Practice.
Find one solution for $x$ and $y$ to the following equations using Excel’s Solver (there are 9 possible solutions):
$$2x^3 + 2xy - 21x + y^2 - 7 = 0,$$$$x^2 + 2xy + 2y^3 - 13y - 11 = 0.$$
The solutions are the critical points of the famous Himmelblau’s function, which is used to test optimization problems. (Using AI amounts to solving optimization problems, that is, minimizing functions, which corresponds to the AI’s output.) See also these notes from the C$_\beta$E 541 course.
Problem 3
This problem solves three equations in three unknowns, the same problem as in the notes. Practice.
$$x^2 + y^2 = 1,$$$$xy + yz = -1.1,$$
$$y^2 + z^2 = 2.$$
A good initial guess is $x=y=z=2$.
Problem 4
This is a real problem with multiple equations. It has additional parameters. Make cells for these and refer to them. Make unit conversions as needed. Make it pretty!
Imagine mixing liquid benzene (species 1) and toluene (species 2) together in an initially empty container. At equilibrium, some of the liquid from both species will evaporate into the vapor phase and some will be left as liquid for certain temperatures and pressures. In thermodynamics, Raoult’s law may be used to describe the distribution of species in each phase. Raoult’s law gives the following two expressions describing the equilibrium state:
$$y_1P = x_1P_1^{sat}(T), $$$$y_2P = x_2P_2^{sat}(T), $$
where $y_i$ is the mole fraction of species $i$ (either 1 or 2) in the vapor phase, and $x_i$ is the mole fraction of species $i$ in the liquid phase, $P_i^{sat}(T)$ is the vapor pressure of species $i$ at the system temperature (T), and $P$ is the system pressure.
The vapor pressures can be found from the Antoine Equation,
$$ \ln(P_i^{sat}(T)) = A_i - \frac{B_i}{T + C_i}.$$Here, $A_i$, $B_i$, and $C_i$ are constants. In this equation, $T$ is evaluated in $^o$C, and $P_i^{sat}(T)$ is in kPa.
| Compound | A | B | C |
|---|---|---|---|
| Benzene | 13.7819 | 2726.81 | 217.572 |
| Toluene | 13.9320 | 3056.96 | 217.625 |
If our mixture has $y_1=0.33$ and $P=120$ kPa, find $x_1$ and T. Remember that the mole fractions of each phase must sum to 1.
Hints:
- First figure out what you are solving for. Then figure out how many equations you have.
- You might want to set up a cell for $P_1^{sat}$ and $P_2^{sat}$ that reference your cell containing $T$.
- Using Excel’s Solver, it is fine to have variable cells, then other intermediate cells that depend on the variable cells, then “function” cells that depend on the intermediate cells and/or the variable cells. The solver just varies the variable cells to make the function cells have the desired value (zero). Intermediate cells will be updates as part of the solution. Include cells with parameters, like $P$, $A$, $B$, $C$, etc.
- You should get around 0.17 for $x_1$ and 109 $^o$C for T.
Note (readme!)
When writing text that includes equations, as in this homework assignment, equations should be punctuated as if they are part of the text. Note the commas, and periods at the ends of equations. Some terms are in line with the text, and some are on their own lines. Learning to write with equations is an important part of your engineering education. I have some engineering books that don’t do this, but my math books do, and the mathematicians know equations. Punctuate your math! The man responsible for all the equations you see in books and the internet, Donald Knuth, who invented TeX (as in LaTeX), punctuates his math, and so should you. We’ll learn how to write LaTeX equations in a couple weeks.
(There are two kinds of people in this world, those who click the links, and those who just want to get their homework done. The links are the salt on your popcorn. You don’t need it, but then, what’s the point? We’ll skip the butter though 😉)