필터 지우기
필터 지우기

Not Enough input arguments/Unexplained line errors

조회 수: 1 (최근 30일)
Brianna Biondo
Brianna Biondo 2023년 3월 13일
댓글: Brianna Biondo 2023년 3월 13일
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

채택된 답변

Walter Roberson
Walter Roberson 2023년 3월 13일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by