function xdot = bio(t,x) % % b.w. bequette % (c) 18 July 96 % % dynamic equations for bioreactor, integrated using ode45, % using the following command % % [t,x] = ode45('bio',t0,tf,x0) % % where t0 is the initial time (usually 0), tf is % the final time and x0 is the initial condition vector % x0(1) = biomass initial condition % x0(2) = substrate initial condition % % biomass ("bugs") consumes the substrate % % state variables % % x(1) = biomass % x(2) = substrate % % D = dilution rate (F/V, time^-1) % Y = yield biomass/substrate % mu = specific growth rate % mumax = parameter (both Monod and Substrate Inhibition) % km = parameter (both Monod and Substrate Inhibition) % k1 = parameter (Substrate Inhibition only, k1 = 0 for Monod) % sf = substrate feed concentration % % the function vector consists of 2 equations % f = zeros(2,1); % % parameter values % D = 0.3; mumax = 0.53; Y = 0.4; km = 0.12; sf = 4.0; k1 = 0.4545; % % Substrate Inhibition expression for specific growth rate % mu = mumax*x(2)/(km+x(2)+k1*x(2)*x(2)); % % dynamic equations % dx1dt = [(mu - D)*x(1); dx2dt = (sf - x(2))*D - mu*x(1)/Y; xdot = [dx1dt; dx2dt];