Effacer les filtres
Effacer les filtres

Not Enough input arguments/Unexplained line errors

1 vue (au cours des 30 derniers jours)
Brianna Biondo
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);
Not enough input arguments.

Error in solution>Membrane (line 28)
Ca = (CTo*Fa)/(Fa + Fb + Fc);

Error in odearguments (line 92)
f0 = ode(t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ode45 (line 107)
odearguments(odeIsFuncHandle,odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
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

Réponse acceptée

Walter Roberson
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
  1 commentaire
Brianna Biondo
Brianna Biondo le 13 Mar 2023
Thank you so much. I really appreciate the help.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by