"Not enough Imput arguments" ERROR

1 view (last 30 days)
Hi, in the following script where every variable is defined I call a ode solver and a function as:
(Ignore the comments, they are in Spanish)
if J==1
n0=n_eq; %Concentración inicial de neutrones
c0=c_eq; %Concentración inicial precursores de neutrones diferidos
I0=Xe_eq; %Concentración inicial de Yodo-135
X0=Xe_eq; %Concentración inicial de Xenon-135
y0 = [n0; c0; (TF_eq-Tm0)/(Tref-Tm0); (TC_eq-Tm0)/(Tref-Tm0); TM_eq; I0; X0]; %Datos Iniciales de las variables a estudiar
[t,Y]=ode23s(@(t,y) Feedback_Ven_STEP(t,y,LAMBDA,yield,dconst,Bigf,Rf0,aF,rc0,kf,Tf0,Tm0,K,Bigc,Rci,Bi,hi,Mc,cp,alphaM,alphaF,rhoC_V,m,Sc,dconst_I,yield_I,sigma_f,yield_X,dconst_X,alphaX,micro_X,Tref,J), tspan, y0);
else
n0=ne; %Concentración inicial de neutrones
c0=yield/(dconst*LAMBDA)*ne; %Concentración inicial precursores de neutrones diferidos
I0=3.92e14; %Concentración inicial de Yodo-135
X0=3.16e14; %Concentración inicial de Xenon-135
%I0=0; %Concentración inicial de Yodo-135 Startup
%X0=0; %Concentración inicial de Xenon-135 Startup
y0 = [n0; c0; (Tf0-Tm0)/(Tf0-Tm0); (Tc0-Tm0)/(Tf0-Tm0); Tm0; I0; X0]; %Datos Iniciales de las variables a estudiar
[t,Y]=ode23s(@(t,y) Feedback_Ven_STEP(t,y,LAMBDA,yield,dconst,Bigf,Rf0,aF,rc0,kf,Tf0,Tm0,K,Bigc,Rci,Bi,hi,Mc,cp,alphaM,alphaF,rhoC_V,m,Sc,dconst_I,yield_I,sigma_f,yield_X,dconst_X,alphaX,micro_X,Tref,J), tspan, y0);
end
And inside my function Feedback_Ven_STEP I have:
function [dy]=Feedback_Ven_STEP(t,y,LAMBDA,yield,dconst,Bigf,Rf0,aF,rc0,kf,Tf0,Tm0,K,Bigc,Rci,Bi,hi,Mc,cp,alphaM,alphaF,rhoC_V,m,Sc,dconst_I,yield_I,sigma_f,yield_X,dconst_X,alphaX,micro_X,TM_eq,TF_eq,Tref,J)
format long
dy=zeros(7,1);
if J==1
rho = rhoC_V + alphaM*(y(5) - TM_eq) + alphaF*(y(3)*(Tref-Tm0) + Tm0 - TF_eq) + y(7)*alphaX;
dy(1) = y(1)*(rho-yield)/LAMBDA + dconst*y(2);
dy(2) = y(1)*yield/LAMBDA - dconst*y(2);
dy(3)= -2*Bigf*(y(3)-y(4))/Rf0 + (y(1)*aF*(rc0^2))/(kf*(Tref-Tm0));
dy(4)= 2*K*(Bigc*Rci*(y(3) - y(4))-Bi(1)*y(4))/(1-Rci^2);
%Tc_dim=y(4)*(Tref-Tm0) + Tm0;
dy(5)= (hi(1)*Sc*(y(4)*(Tref-Tm0) + Tm0 - y(5))-2*m*cp*(y(5)-Tm0))/(Mc*cp);
dy(6)=yield_I*sigma_f*y(1) - dconst_I*y(6);
dy(7)=dconst_I*y(6) + yield_X*sigma_f*y(1) - dconst_X*y(7) - micro_X*y(7)*y(1);
else
rho = rhoC_V + alphaM*(y(5) - Tm0) + alphaF*(y(3)*(Tf0-Tm0) + Tm0 - Tf0) + y(7)*alphaX;
dy(1) = y(1)*(rho-yield)/LAMBDA + dconst*y(2);
dy(2) = y(1)*yield/LAMBDA - dconst*y(2);
dy(3)= -2*Bigf*(y(3)-y(4))/Rf0 + (y(1)*aF*(rc0^2))/(kf*(Tref-Tm0));
dy(4)= 2*K*(Bigc*Rci*(y(3) - y(4))-Bi(1)*y(4))/(1-Rci^2);
%Tc_dim=y(4)*(Tref-Tm0) + Tm0;
dy(5)= (hi(1)*Sc*(y(4)*(Tref-Tm0) + Tm0 - y(5))-2*m*cp*(y(5)-Tm0))/(Mc*cp);
dy(6)=yield_I*sigma_f*y(1) - dconst_I*y(6);
dy(7)=dconst_I*y(6) + yield_X*sigma_f*y(1) - dconst_X*y(7) - micro_X*y(7)*y(1);
end
end
I keep getting the error:
Not enough input arguments.
Error in Feedback_Ven_STEP (line 5)
if J==1
Any ideas? Can´t figure it out.
  1 Comment
Stephen23
Stephen23 on 15 Jun 2023
"Any ideas? Can´t figure it out."
Not enough input arguments.
Rather than so many positional input arguments (which leads to these kinds of bugs), perhaps using one scalar structure would be more robust.

Sign in to comment.

Accepted Answer

Alan Stevens
Alan Stevens on 15 Jun 2023
You haven't included J as an input argument to function Feedback_Ven_STEP.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!