Problema en ode45, no compila
Ältere Kommentare anzeigen
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 Kommentar
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
