% This file is a matlab script to simulate a batch problem. % This file calls batch1_rate.m with 1 parameter. %clear all; clc; %Define variables Coi=3; % initial concentration of oxigen [mg/l] Csi=10; % initial concentration of substrat [mg/l] Cbi=0.2; % initial concentration of biomass [mg/l] %define vector of concentrations c1=[Coi;Csi;Cbi]; ko=0.1; % Monod coefficients Oxigen [mg/l] ks=0.1; % Monod coefficients Substract [mg/l] umax=0.125/86400; % Maximun growth rate [1/d] Yo=0.125; % Oxigen Yield [mg X / mg O] Ys=0.25; % Substract Yield [mg X / mg S] Kdec=0.01/86400; % Decay rate kb=1; % Biomass Inhibition constant [mg/L] g = @(x,t) batch1_rate(x, t, ko); %Solve ODE tic() timerange=[0: 3600: 43*86400]; %[t,c]=ode15s(@batch1_rate,timerange,c1,[],ko,ks,Ys,Yo,Kdec,umax,kb); [c,t]=lsode(g,c1,timerange,ko); toc() %plot(timerange,c(:,2),timerange,c(:,1),timerange,c(:,3))