Not Enough input arguments/Unexplained line errors
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Brianna Biondo
le 13 Mar 2023
Commenté : Brianna Biondo
le 13 Mar 2023
I dont understand what it means when it says not enough input arguments and I am confused with the errors in solution, arguments and ode45. Is it an error in the function or the solution above. Any help would be much appreciated.
Fao=100;
Fbo = 0;
Fco = 0;
WRange=[0 100];
M0 = [Fao;Fbo;Fco];
[WSol,FSol] = ode45(@Membrane,WRange,M0);
plot(WSol,FSol)
legend("show")
xlabel("Weight (Kg)")
ylabel("F (mol/s)")
legend(["Fa","Fb","Fc"])
title("Problem 5.")
function M = Membrane (Fa, Fb, Fc)
k = 10;
kca = 1;
kcb = 40;
Kc = 0.01;
vo = 100;
Fao = 100;
Fbo = 0;
Fco = 0;
FTo = Fao + Fbo + Fco;
CTo = Fao/vo;
Ca = (CTo*Fa)/(Fa + Fb + Fc);
Cb = (CTo*Fb)/(Fa + Fb + Fc);
Cc = (CTo*Fc)/(Fa + Fb + Fc);
ra = -k*(Ca - ((Cb*Cc^2)/Kc));
rb = k*(Ca - ((Cb*Cc^2)/Kc));
rc = 2*k*(Ca - ((Cb*Cc^2)/Kc));
Ra = kca*Ca;
Rb = kcb*Cb;
dFadW = ra - Ra;
dFbdW = rb - Rb;
dFcdW = rc;
M = [dFadv,dFbdv,dFcdv];
end
0 commentaires
Réponse acceptée
Walter Roberson
le 13 Mar 2023
Fao=100;
Fbo = 0;
Fco = 0;
WRange=[0 100];
M0 = [Fao;Fbo;Fco];
[WSol,FSol] = ode45(@Membrane,WRange,M0);
plot(WSol,FSol)
legend("show")
xlabel("Weight (Kg)")
ylabel("F (mol/s)")
legend(["Fa","Fb","Fc"])
title("Problem 5.")
function M = Membrane (t, Fabc)
Fa = Fabc(1); Fb = Fabc(2); Fc = Fabc(3); %all three states in same variable
k = 10;
kca = 1;
kcb = 40;
Kc = 0.01;
vo = 100;
Fao = 100;
Fbo = 0;
Fco = 0;
FTo = Fao + Fbo + Fco;
CTo = Fao/vo;
Ca = (CTo*Fa)/(Fa + Fb + Fc);
Cb = (CTo*Fb)/(Fa + Fb + Fc);
Cc = (CTo*Fc)/(Fa + Fb + Fc);
ra = -k*(Ca - ((Cb*Cc^2)/Kc));
rb = k*(Ca - ((Cb*Cc^2)/Kc));
rc = 2*k*(Ca - ((Cb*Cc^2)/Kc));
Ra = kca*Ca;
Rb = kcb*Cb;
dFadW = ra - Ra;
dFbdW = rb - Rb;
dFcdW = rc;
M = [dFadW;dFbdW;dFcdW]; %must be column vector, and you were using wrong names
end
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!