plot show up empty
Show older comments
Hi everyone, i have a problem with the plot of the next function:
function xd=lic(t,x)
global YH YA fp iXB iXP miuH bH KS KOH KNO miuA bA KOA KNH niug ka kh KX niuh
xd(1)=(miuH*(x(3)/(KS+x(3)))*(((x(10)/(KOH+x(10)))+niug*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9))))-bH))*x(1);
xd(2)=(miuA*(x(8)/(KNH+x(8)))*(x(10)/(KOA+x(10)))-bA)*x(2);
xd(3)=((-miuH/YH)*(x(3)/(KS+x(3)))*((x(10)/(KOH+x(10)))+niug*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9))))+kh*((x(4)/x(1))/(KX+(x(4)/x(1))))*((x(10)/(KOH+x(10)))+niuh*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9)))))*x(1);
xd(4)=(1-fp)*(bH*x(1)+bA*x(2))-kh*(x(4)/x(1))/(KX+x(4)/x(1))*((x(10)/(KOH+x(10)))+niuh*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9))))*x(1);
xd(5)=fp*(bH*x(1)+bA*x(2));
xd(6)=(iXB-fp*iXP)*(bH*x(1)+bA*x(2))-kh*(x(6)/x(1))/(KX+(x(4)/x(1)))*((x(10)/(KOH+x(10)))+niuh*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9)))*x(1));
xd(7)=(-ka*x(7)+kh*((x(6)/x(1))/(KX+x(4)/x(1)))*((x(9)/(KOH/x(9)))+ niuh*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9)))))*x(1);
xd(8)=(-iXB*miuH*(x(3)/(KS+x(3)))*(x(10)/(KOH+x(10))+niug*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9))))+ka*x(7))*x(1)-miuA*(iXB+(1/YA))*(x(8)/(KNH+x(8)))*(x(10)/(KOA+x(10)))*x(2);
xd(9)=-miuH*niug*(1-YH)/(2.86*YH)*(x(3)/(KS+x(3)))*(KOH/(KOH+x(10)))*(x(9)/(KNO+x(9)))*x(1)+(miuA/YA)*(x(8)/(KNH+x(8)))*(x(10)/(KOA+x(10)))*x(2);
xd(10)=-miuH*((1-YH)/YH)*(x(3)/(KS+x(3)))*(x(10)/(KOH+x(10)))*x(1)-miuA*((4.57-YA)/YA)*(x(8)/(KNH+x(8)))*(x(10)/(KOA+x(10)))*x(2);
xd=xd';
end
script:
global YH YA fp iXB iXP miuH bH KS KOH KNO miuA bA KOA KNH niug ka kh KX niuh
YH=0.67;
YA=0.24;
fp=0.08;
iXB=0.086;
iXP=0.06;
miuH=6.0;
bH=0.62;
KS=20;
KOH=0.20;
KNO=0.50;
miuA=0.80;
bA=0.20;
KOA=0.4;
KNH=1.0;
niug=0.8;
ka=0.08;
kh=3.0;
KX=0.03;
niuh=0.4;
x0=[0 0 0 0 0 0 0 0 0 0];
t0=0;
tf=10;
[t,x]=ode45(@lic, [t0 tf], x0);
figure(1)
subplot(511)
plot(t,x(:,1),'r')
title('1 ')
subplot(512)
plot(t,x(:,2),'b')
title('2')
subplot(513)
plot(t,x(:,3),'y')
title('3')
grid
subplot(514)
plot(t,x(:,4),'k')
title('4')
grid
subplot(515)
plot(t,x(:,5),'g')
title('5')
grid
figure(2)
subplot(511)
plot(t,x(:,6),'r')
title('6 ')
grid
subplot(512)
plot(t,x(:,7),'b')
title('7')
grid
subplot(513)
plot(t,x(:,8),'y')
title('8')
grid
subplot(514)
plot(t,x(:,9),'k')
title('9')
grid
subplot(515)
plot(t,x(:,10),'g')
title('10')
I don't understand why it is displayed empty. Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!