MATLAB: How to plot this equation(‘ Xe=(Kc*(1+​(Fbo.*t/Na​o))-((((Kc​*(1+(Fbo.*​t/Nao))).^​2)-(4*(Kc-​1)*Kc(Fbo.​*t/Nao))).​^(1/2)))/(​2*(Kc-1))’​) in MATLAB

warning: subscript indices must either be real positive integers or logicals.

T=300; %Temperature (K) Kc=1.08; %Equilibrium Constant k=9*10^(-5); %Specific Reaction Rate (dm^3/mol*s) V=200; %İnitial volume in the vat (dm^3) vo=0.05; %Butanol Flow Rate (dm^3/s) Cao=7.72; %Pure concentration of ethyl acetate (mol/dm^3) Cbo=10.93; %Pure concentration of butanol (mol/dm^3) Nao=Cao*V; %Moles of ethyl acetate initially in the vat Fbo=Cbo*vo; %Molar flow rate of butanol (mol/s) t=0:5:10000; %Time variable (s) Xe=(Kc*(1+(Fbo.*t/Nao))-((((Kc*(1+(Fbo.*t/Nao))).^2)-(4*(Kc-1)*Kc(Fbo.*t/Nao))).^(1/2)))/(2*(Kc-1)); plot(t,Xe)

Best Answer

First, put a multiplication (or other) operator between ‘Kc’ and the following parenthesis in this term ‘Kc(Fbo.*t/Nao)’.
Xe=(Kc*(1+(Fbo.*t/Nao))-((((Kc*(1+(Fbo.*t/Nao))).^2)-(4*(Kc-1)*Kc*(Fbo.*t/Nao))).^(1/2)))/(2*(Kc-1));
↑ ← INSERT OPERATOR HERE
I chose a multiplication operator. Change it if that is not correct.