## Plot A Graph With Asymptotic Behavior

on 6 Apr 2019

### dpb (view profile)

on 6 Apr 2019
% Input : limits Vstart and Vend for the volume;
% system parameters q, m0, Cx, Cf, YXS, and KS
% Output : two plots of CSss(V) and CXss(V)
n = 100; V = linspace(Vstart,Vend,n); % initialize
a = YXS*(q-m0*V); % quadratic polynomial coeff.
b = m0*V*(Cx+Cs*YXS)-q*YXS*(Cs-KS);
c = -q*Cs*YXS*KS;
CS = (-b + (b.^2 - 4*a*c).^0.5)./(2*a); % CSss data
CX = ((q*(Cs-CS)*YXS).*(KS+CS))./(m0*CS.*V);
limCSss = Cx + Cs*YXS; % finding optimal CXss plot region limits :
ymaxCX = max(max(CX),limCSss);
yminCX = min(min(CX),limCSss);
if ymaxCX == limCSss
yCXtop = ymaxCX + 0.05*(ymaxCX-yminCX);
else,
yCXtop = ymaxCX;
end
if yminCX == limCSss
yCXbot = yminCX - 0.05*(ymaxCX-yminCX);
else
yCXbot = yminCX;
end
subplot(2,1,1)
plot(V,CS)
xlabel('V','Fontsize', 14)
ylabel('C_{S_{ss}} ','Fontsize', 14,'Rotation',0)
title([{'Anaerobic Digester Steady State Concentrations'},{' '},...
{['with q = ', num2str(q,'%5.4g'),', \mu_0 = ',num2str(m0,'%5.4g'),...
', C_{X_s} = ',num2str(Cx,'%5.4g'),', C_{S_s} = ',...
num2str(Cs,'%5.4g'),', Y_{XS} = ',num2str(YXS,'%5.4g'),...
', K_{S} = ',num2str(KS,'%5.4g')]}],'FontSize',12)
subplot(2,1,2), plot(V,CX), v = axis; axis([v(1),v(2),yCXbot,yCXtop]);
xlabel(['V ( lim C_{Sss} = ',...
num2str(limCSss,'%5.4g'),' )'],'Fontsize', 14), hold on,
plot([v(1), v(2)],[limCSss, limCSss],':r'); % asymtotic line
text(v(2),0.97*(limCSss-v(3))+v(3),' lim C_{Sss}','Fontsize',12,'Color','r'),
ylabel('C_{X_{ss}} ','Fontsize', 14,'Rotation',0), hold off
ymaxCX = max(max(CX),limCSss); yminCX = min(min(CX), limCSss);
From this sentence, what does it means to?

### dpb (view profile)

on 6 Apr 2019

ymaxCX = max(max(CX), limCSss);
yminCX = min(min(CX), limCSss);
Just getting an overall min/max value of the data in vector CX and the computed limit for setting axis xlim values it would appear (altho you need to read the terribly poorly formatted code extremely carefully to be able to find just where that usage actualy is...)