MATLAB As a newly hired engineer for Amgen you have been tas
Solution
% (1) Use Matlab to create a surface plot of rDmab as a function of both
% [D] and [U] concentrations from 0 M to 3 M.
% (2) Determine the concentrations that maximize the rate of production of
% Dmab.
% Clear command window and all variables
________
________
% Create two vectors, D and U, which represent the concentrations of D and
% U we want to use to make our plot. \"linspace\" is a useful command that
% allows us to divide a specified range, in this case 0 to 3, into an
% specific number of numerical steps. Here we have arbitrarily selected
% 100.
D = linspace(________);
U = linspace(________);
% Create an initial minimum value of rmax for future comparisons
rmax = ________;
% Now use nested ________________ to cycle through all values of the
% vectors D and U. At each value of D, the inside for loop will go through
% all the values in U. In this way, all pairs of D and U values
% will be considered in the rate equation
for i = 1:length(D)
for j = ________
% This is the rate equation expression. Note that the values D(i)
% and U(j) are scalars, and represent the values of D and U in the
% i-th and j-th position of those respective vectors.
r = ________________________________________________________;
% Each time the rate expression calulates a new value, we need to
% record it. Previously we were able to record all values into a
% vector, as we only had one variable changing. Now there are 2 (U
% and D). This requires we save them into an array.
________________ = r;
% Here we are using a comparison technique for capturing the
% largest or maximum rate (rmax) that is obtained for the various
% D and U combinations. The values of D and U which give this
% maximum rate are recorded in dmax and umax, respectively.
if r > rmax
rmax = r;
dmax = ________________;
umax = ________________;
end % end of ________ block
end % end of ________ loop
end % end of ________ loop
% The following plot command creates a surface plot with U and D along the
% x and y axes, and the rate (rDmab) on the z axes: NOTE the positions of
% the U and D vectors relative to there order in the array. It is OPPOSITE
% what you might expect. To make sure you have it right, make D and U
% vectors different lengths. If your order is incorrect, you will get a
% dimensions related error in \"surf\". If you have D and U the same size,
% and you have them reversed, you might never know it!
surf(________________________)
title(‘________________________________’)
xlabel(‘________________’)
ylabel(________________________)
zlabel(________________________)
% This next step takes the maximum (umax, dmax, rmax) and adds it to the
% plot. The next command then adds a label to that point
hold on
scatter3(________, ________, ________,‘k.’)
s=strcat(‘maximum at’,‘(‘,num2str(________),‘,’,num2str(________),‘,’,num2str(________),‘)’);
text(umax,dmax,1.1*rmax,s)
hold off
% Output the maximum rate and the corresponding D and U values to the
% Command window.
fprintf(‘n The maximum rate is %6.4f mol/s and it ‘, ________)
fprintf(‘n occurs at [D] = ________ M and [U] = ________ M.n’, dmax, umax)
% end of program


