Professional Documents
Culture Documents
Diva Sansanwal Ing: de Biorreactores 4Fv2
Diva Sansanwal Ing: de Biorreactores 4Fv2
DIVA SANSANWAL
ING: DE BIORREACTORES 4FV2
Código de MATLAB
clear all; clc; close all;
t=[0,4.3,5.8,6.8,7.5,8.5,9.5,10,10.6,11.7,12.6,13,13.9,14.5,15.6,18.9,20];
s=[35,34,33,32,31,29,26,24,21,15,9,7,4,3,1.94,0.9,0.8];
DIVA SANSANWAL
ING: DE BIORREACTORES 4FV2
x=[0.1,0.55,1,1.45,1.9,2.8,4.15,5.05,6.4,9.1,11.8,12.7,14.05,14.5,14.95,15.39,15.41];
n=length(t);
plot(t,x,'*c')
xlabel('tiempo (h)')
ylabel('g/l')
grid on
hold on
plot(t,s,'*m')
dxdt=[0];
for i=2:n-1
dxdt(i)=x(i-1)*(t(i)-t(i+1))/((t(i-1)-t(i))*(t(i-1)-t(i+1)))+x(i)*(2*t(i)-t(i-1)-t(i+1))/((t(i)-t(i-1))*(t(i)-t(i+1)))+x(i+1)*(t(i)-t(i-1))/((t(i+1)-
t(i-1))*(t(i+1)-t(i)));
end
dxdt=[dxdt,0];
dxdt=dxdt(2:n-1);
%Ya que no hay diferenciación numerica del ultimo y del primer valor
dsdt=[0];
for i=2:length(t)-1
dsdt(i)=s(i-1)*(t(i)-t(i+1))/((t(i-1)-t(i))*(t(i-1)-t(i+1)))+s(i)*(2*t(i)-t(i-1)-t(i+1))/((t(i)-t(i-1))*(t(i)-t(i+1)))+s(i+1)*(t(i)-t(i-1))/((t(i+1)-
t(i-1))*(t(i+1)-t(i)));
DIVA SANSANWAL
ING: DE BIORREACTORES 4FV2
end
dsdt=[dsdt,0];
negdsdt=-dsdt;
negdsdt=negdsdt(2:n-1);
%Ya que no hay diferenciación numerica del ultimo y del primer valor
tgrafica=t(2:n-1);
figure
plot(tgrafica,dxdt,'*g')
xlabel('t (h)')
ylabel('g/l')
grid on
hold on
plot(tgrafica,negdsdt,'*b')
xlabel('t')
ylabel('g/l')
legend('dx/dt','-ds/dt')
m=length(dxdt);
xgrafica=x(2:n-1);
sgrafica=s(2:n-1);
DIVA SANSANWAL
ING: DE BIORREACTORES 4FV2
for j=1:m
mu(j)=dxdt(j)/xgrafica(j);
qs(j)=negdsdt(j)/xgrafica(j);
end
figure
plot(tgrafica,mu,'*k')
xlabel('t (h)')
ylabel('1/h')
hold on
grid on
plot(tgrafica,qs,'*')
legend('mu','qs')
figure
plot(sgrafica, mu,'r')
grid on
xlabel('s (g/l)')
ylabel('mu (1/h)')
legend('mu vs s')
sinversa=1./sgrafica;
DIVA SANSANWAL
ING: DE BIORREACTORES 4FV2
muinversa=1./mu;
figure
plot(sinversa,muinversa,'g')
xlabel('1/s (l/g)')
ylabel('1/mu (h)')
legend('1/mu vs 1/s')
grid on
figure
plot(s,x,'m')
xlabel('s (g/l)')
ylabel('x (g/l)')
grid on
legend('x vs s')
figure
plot(mu,qs,'-k')
xlabel('qs (1/h)')
ylabel('mu (1/h)')
grid on
legend('mu vs qs')
DIVA SANSANWAL
ING: DE BIORREACTORES 4FV2
Resultados
t (h) x (g/l) s (g/l) dx/dt (g/l*h) neg(ds/dt (g/l*h)) mu (1/h) qs(gsus/gcélula*h)
0 0.1 35 x x x x
4.3 0.55 34 0.249479 0.5544 0.4536 1.008
5.8 1 33 0.39 0.8667 0.39 0.86667
6.8 1.45 32 0.563445 1.2521 0.3885 0.86352
7.5 1.9 31 0.748739 1.6639 0.39407 0.87572
8.5 2.8 29 1.125 2.5 0.40179 0.89286
9.5 4.15 26 1.65 3.667 0.39759 0.88353
10 5.05 24 2.004545 4.4545 0.39694 0.88209
10.6 6.4 21 2.322193 5.1604 0.36284 0.80632
11.7 9.1 15 2.754545 6.1212 0.3027 0.67266
12.6 11.8 9 2.480769 5.5128 0.21023 0.46719
13 12.7 7 2.019231 4.4872 0.15899 0.35332
13.9 14.05 4 1.05 2.3333 0.0747 0.16607
14.5 14.5 3 0.629679 1.4185 0.04342 0.09783
15.6 14.95 1.94 0.340152 0.8015 0.022753 0.053613
18.9 15.39 0.9 0.04697 0.147 0.003052 0.0095497
20 15.41 0.8 x x x x