Code in matlab. The reference code for Q1 and Q2 are both attached. Please confirm you received and can do in 24 hours (can't extend the deadline)
Q#1
revisit the HW on the baseball/softball flight and hitting a homerun.
use either your own solution(s) or the one provided (specify which) as a basis to start your code from.
assume all the park dimensions, etc are the same as they were
using a minimizer tool such as fmincon, ga, surrogateopt, gamultiobj , or similar (read documention on each if we didn't cover them in class).
for the same launch angles previously studied, find
a) the minimum launch velocity to hit a home run to centerfield using the minimizer and a UDF for the equation(s) you want to minimize (or maximize)
you will need to be thoughtful/creative in coming up with good objective function(s).
*objective function means similar to fv in the backpack problem , etc. it's the thing you want to find the min/max value of
b) take your values from part a, and divide them by 2 (reduce 50%).
repeat the solution by finding the
i) for how much less the density of air needs to be for the hit to still be a home run at this reduced speed
(playing in Denver Colorado analogy)
ii) or how much less the acceleration due to gravity needs to be for the hit to still be a home run at this reduced speed
(playing on the moon analogy)
Q#2
a)
revisit any of the HW/exam/demo that used the reaction A->B->C with rate constants k1 and k2, respectively, as a starting point for your code(s) for this one.
assume now that we have a batch reactor and the reaction A->B is exothermic by 100 kJ/mol and B->C is endothermic by 33 kJ/mol
assume the reaction contents are infinitely quickly mixed/dispersed, (diffusion is fast, etc).
assume the reactor starts at 40*C , and the rate constants are to be calculated from the following
A1 (prefactor) 10^6 /s
A2 (prefactor) 10^8 /s
Ea1 (activation energy ??? unknown (to be solved for) kJ/mol-K
Ea2 42 kJ/mol-K
assume that reactor has volume of 1000L, and the reactions are dissolved/diluted in water (solvent)
assume initial conditions A: 2 molar, B: 0.02 molar, C: 0.12 molar
find the Ea1 that
minimizes
the selectivity of C to B while maintaining the reactor T below 55C
you will need to be thoughtful/creative in coming up with good objective function(s) and or constraints
Also report the overall conversion if the reactor is operated this way.
b)
You can buy the chemicals above required to make the feedstock for part A, from 5 vendors. Each vendor sells different amounts/concentrations/purities.
Vendors who sell fixed bottle sizes only
Vendor |
Volume Sold |
% A (aqueous) |
%B (aqueous) |
%C(aqueous) |
% impurities |
Cost/bottle |
# bottles available |
1 |
5L |
5 |
2 |
3 |
1 |
$100 |
1000 |
2 |
10L |
3 |
3 |
3 |
0 |
$500 |
200 |
3 |
1L |
4 |
0 |
0 |
2 |
$200 |
500 |
4 |
20 gallon |
10 |
0 |
0 |
0.5 |
$1000 |
500 |
Vendors who sell any volume you want
5 |
Volume To buy |
% A (aqueous) |
%B (aqueous) |
%C(aqueous) |
% impurities |
Cost/ 100 L |
Max volume on hand |
6 |
any |
5 |
0 |
0 |
.1 |
8000 |
10000 |
7 |
any |
1 |
0 |
0 |
.1 |
600 |
10000 |
8 |
any |
3 |
0 |
0 |
.001 |
10000 |
3000 |
Assume ideal mixing, no change in volume due to mixing etc.
The cost to remove impurities from the final mix prior to feeding the reactor is $50000 per mole.
Assume from part a) you are operating at that condition(s).
What suppliers/quantities do you buy to minimize the cost of making your feedstock.
Assume the following: vendors/suppliers are competitive and vindictive. Especially #4. If he finds out you buy ANY from #2 or #6, he will prohibit you from buying from him. Maybe this matters, maybe it doesn't. But include it in your calculations.