Al compilar la función me aparece "Not enough input arguments."
Como puedo solucionarlo??
function dzdt=funciontp2(t,x)
m=53
Iy=144000
Sw=30
ST=7.5
s=7.5
c=4
Claw=4.5
ClaT=3.2
w=18
lw=0.6
lT=7
wg0=6.25
V=187.5
le=0.25
la=0.25
lwm=0.1
A=0.1
B=0
ke0=0.1396
Gamma_e0=0.0873
rho=0.784
aw=0.5*rho*V^2*Sw*Claw
aT=0.5*rho*V^2*ST*ClaT
l=lw+lT
t0=l/V
wgt=wg0
wgtlv=((t>0) & (t<t0)).*0 + (t>=t0).*wg0
dxdt1=x(2)
dxdt2=(-aw-aT)/(V*m)*x(2) + (aw*lw+aT*lT)/(V*m)* x(4) - (aw+aT)/(V*m)*x(3)- aw/V/m*wgt - aT/V/m*wgtlv
dxdt3=x(4)
dxdt4=(aw*lw-aT*lT)/V/Iy * x(2) + (aT*lT^2-aw*lw^2)/V/Iy * x(4) + (aw*lw-aT*lT)/V/Iy * x(3) + aw*lw/V/Iy*wgt - aT*lT/V/Iy*wgtlv
dzdt=[dxdt1;dxdt2;dxdt3;dxdt4]
end
El código donde se llama a la función es:
tspan=[0:0.05:10]
CI=[0;0;0;0]
[t Y]= ode45(@funciontp2,tspan,CI)
m=53
Iy=144000
Sw=30
ST=7.5
s=7.5
c=4
Claw=4.5
ClaT=3.2
w=18
Epsilon=0.04
lw=0.6
lT=7
wg0=6.25
V=187.5
le=0.25
la=0.25
lwm=0.1
A=0.1
B=0
ke0=0.1396
Gamma_e0=0.0873
rho=0.784
aw=0.5*rho*V^2*Sw*Claw
aT=0.5*rho*V^2*ST*ClaT
l=lw+lT
t0=l/V
wgt=wg0
wgtlv=((t>=0) & (t<t0)).*0 + (t>=t0).*wg0
zpp=(-aw-aT)/(V*m)*Y(:,2) + (aw*lw+aT*lT)/(V*m)* Y(:,4) - (aw+aT)/(V*m)*Y(:,3)- aw/V/m*wgt - aT/V/m*wgtlv
titapp=(aw*lw-aT*lT)/V/Iy * Y(:,2) + (aT*lT^2-aw*lw^2)/V/Iy * Y(:,4) + (aw*lw-aT*lT)/V/Iy * Y(:,3) + aw*lw/V/Iy*wgt - aT*lT/V/Iy*wgtlv
%z
plot(tspan,zpp)

댓글 수: 1

Ponemos las cosas en orden para poder compilar lo aqui y ver lo que esta pasando.
tspan=[0:0.05:10];
CI=[0;0;0;0];
[t Y]= ode45(@funciontp2,tspan,CI);
m=53;
Iy=144000;
Sw=30;
ST=7.5;
s=7.5;
c=4;
Claw=4.5;
ClaT=3.2;
w=18;
Epsilon=0.04;
lw=0.6;
lT=7;
wg0=6.25;
V=187.5;
le=0.25;
la=0.25;
lwm=0.1;
A=0.1;
B=0;
ke0=0.1396;
Gamma_e0=0.0873;
rho=0.784;
aw=0.5*rho*V^2*Sw*Claw;
aT=0.5*rho*V^2*ST*ClaT;
l=lw+lT;
t0=l/V;
wgt=wg0;
wgtlv=((t>=0) & (t<t0)).*0 + (t>=t0).*wg0;
zpp=(-aw-aT)/(V*m)*Y(:,2) + (aw*lw+aT*lT)/(V*m)* Y(:,4) - (aw+aT)/(V*m)*Y(:,3)- aw/V/m*wgt - aT/V/m*wgtlv;
titapp=(aw*lw-aT*lT)/V/Iy * Y(:,2) + (aT*lT^2-aw*lw^2)/V/Iy * Y(:,4) + (aw*lw-aT*lT)/V/Iy * Y(:,3) + aw*lw/V/Iy*wgt - aT*lT/V/Iy*wgtlv;
%z
plot(tspan,zpp)
function dzdt=funciontp2(t,x)
m=53;
Iy=144000;
Sw=30;
ST=7.5;
s=7.5;
c=4;
Claw=4.5;
ClaT=3.2;
w=18;
lw=0.6;
lT=7;
wg0=6.25;
V=187.5;
le=0.25;
la=0.25;
lwm=0.1;
A=0.1;
B=0;
ke0=0.1396;
Gamma_e0=0.0873;
rho=0.784;
aw=0.5*rho*V^2*Sw*Claw;
aT=0.5*rho*V^2*ST*ClaT;
l=lw+lT;
t0=l/V;
wgt=wg0;
wgtlv=((t>0) & (t<t0)).*0 + (t>=t0).*wg0;
dxdt1=x(2);
dxdt2=(-aw-aT)/(V*m)*x(2) + (aw*lw+aT*lT)/(V*m)* x(4) - (aw+aT)/(V*m)*x(3)- aw/V/m*wgt - aT/V/m*wgtlv;
dxdt3=x(4);
dxdt4=(aw*lw-aT*lT)/V/Iy * x(2) + (aT*lT^2-aw*lw^2)/V/Iy * x(4) + (aw*lw-aT*lT)/V/Iy * x(3) + aw*lw/V/Iy*wgt - aT*lT/V/Iy*wgtlv;
dzdt=[dxdt1;dxdt2;dxdt3;dxdt4];
end

댓글을 달려면 로그인하십시오.

 채택된 답변

Cris LaPierre
Cris LaPierre 2023년 3월 30일
편집: Cris LaPierre 2023년 4월 2일

0 개 추천

No puedo recrear su error, ni aqui, ni en R2016a. Ponga un punto y coma al fin de cada linea para que se ejecute mas rapido su codigo.
Tiene que quardar funciontp2 en su propio archive con el nomber funciontp2.m en R2016a.
Si usas el codigo que puse arriba, no debe haber un error.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

제품

릴리스

R2016a

태그

질문:

2023년 3월 30일

편집:

2023년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by