Transcribed Text
Exercise 10 (1 pt): What output results when the following Matlab program executes (in order,
from top to bottom)? BE EXPLICIT! (HINT: WHAT DOES A SEMI-COLON AT THE END OF A
STATEMENT DO?)
a = 1
b = 3;
c = 2*a - 3*b;
d = c^2
Exercise 11 (1 pt): What output results when the following Matlab program executes (in order,
from top to bottom)? (HINT: Remember the ORDER OF OPERATIONS)
a = (1 + 2 - 3*4 - 1)/5
a = ((a + a)*a)/a
b = -1*a/4
c = b^3 - 4
d = a - b + c*c*c
Exercise 12 (2 pts): What output results when the following Matlab program executes (in order,
from top to bottom)?
a = 2^3;
b = a - 7;
c = abs(sqrt(16));
d = a*c - b*c;
d1 = a;
d2 = d;
d3 = d1 - d2 + d*2*(d1/c)
Exercise 13 (1 pt): You’re given the following two Matlab programs. Each program is
independent and no other statements precede either program:
PROGRAM A:
a = 1;
b = a - 3;
a
b
PROGRAM B:
b = a - 3;
a = 1;
a = b 3;
b
When PROGRAM A is executed in Matlab (statements execute in order, from top to bottom),
values for a and b are printed to the command console, but when PROGRAM B is executed in
Matlab (again, from top to bottom), errors occur. There are two errors in PROGRAM B. Identify
them and explain why they are errors.
Exercise 14 (2 pts): What output results when the following Matlab program executes (in
order, from top to bottom)? (HINT: It might be a very good idea to read this problem FIRST.)
m = 5;
a = 10
b = 2;
c = 4;
d = 18;
e = 0;
a = (c*(d/b))/12
a = a^a*b
b = ((b+c)^d/(c-b)^a)*e;
d = (d-a)^b
Exercise 15 (2 pts): What output results when the following Matlab program executes (in
order, from top to bottom)? (Pay attention to the ORDER OF OPERATIONS.)
a = (1 - (8 + 3*4) - 1)/5
b = -1*a/4
c = -1*((b - 4)^3)-20
d = (a + 6*b)^c + (c - 4)*(c - 5)*(c - 6)
INTRODUCTION
The Redlich-Kwong equation-of-state (RKEOS) models the pressure-volume-temperature
behavior of pure, non-polar gases over a wide variety of conditions. It’s frequently the “equation
of choice” for chemical process engineers because it’s easy to use and provides acceptable
accuracy. In this exercise you will translate the process conditions into Matlab assignment
statements, along with the critical point parametric equations needed to calculate various inputs
to the RKEOS (a and b). You’ll then translate the RKEOS into an assignment statement and use it
to calculate pressures for several temperature/volume pairs for one unit (one mole) of the pure
compound 2-methyl butane. The RKEOS is:
𝑃 =
𝑅𝑇
𝑉 − 𝑏 −
𝑎
𝑉2 + 𝑏𝑉
where:
𝑎 =
(0.42748) × 𝑅2 × 𝑇𝑐
2.5
𝑃𝑐 × √𝑇
𝑏 =
(0.08664) × 𝑅 × 𝑇𝑐
𝑃𝑐
and the critical point data for 2-methyl butane are:
𝑃𝑐 = 33.456 𝑎𝑡𝑚
𝑇𝑐 = 460.4 𝐾
𝑅 = 82.057
𝑐𝑚3𝑎𝑡𝑚
𝑚𝑜𝑙 𝐾
PROBLEM
Translate the RKEOS and the critical point data into a Matlab program. Then use your Matlab
program to calculate the pressure (P, in atm) of 2-methyl butane for the following process
conditions, given as the following temperature (T) volume (V) pairs:
T = 375 K, V = 1,500 cm3
;
T = 450 K, V = 6,500 cm3
; and
T = 850 K, V = 9,500 cm3
.
Please provide a screen shot of your Matlab program and its output.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction
of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.