Part (b) – MATLAB Code and Plots
function ctrl = controls()
clear all;
close all;
A = [9.479 848.7];
trange = [0:1000];
[t,y] = ode45(@odefun,trange,A);
figure;
plot(t,y(:,1))
title('x1 - penicillium')
figure;
plot(t,y(:,2))
title('x2 - penicillin')
return
function dXdt = odefun(t, A)
dXdt = zeros(2,1);
dXdt(1) = 0.03120*A(1)*(1-A(1)/47.70) - 0.02125*A(1); %x1 penillium
dXdt(2) = 3.374*A(1)-0.01268*A(2) - 0.02125*A(2); %x2 penicillin
return
Part (d) – Plotting Linear vs. Nonlinear
Can’t see non linear model since magnitude of linearized model is so large and negative. Probably not a
valid model, which makes sense since original equations are nonlinear.
Part (g)
Part (h)
Well, unless you care about the initial 20 mins where there is a slight difference, there’s no need to
accurately model mixing characteristics for this process because inaccurate modeling yields a very
similar result.