zainah
Newbie level 1
Dear all,
I want to solve 2 second order parameter and and 1 of them related to previous value"
% psiddot =2*m1/m2*tan(psi)*psidot/(cos(psi)*cos(psi))+ m1/m2*u4/(cos(psi)*cos(psi));
%xddot=v1=cos(theta)*cos(psi)*T1/m1; % theta is constant.
I write the program like below and these error came out:
The error that came out:
??? Function 'cos' is not defined for values of class 'char'.
Error in ==> yp2 at 22
dy(2)=cos(theta)*cos(psi)*T1/m1;
Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in ==> twoinput4state at 46
[t,y1]=ode45('yp2',[t],[3 0]);
What should i do to correct it? Thanks.
----------------------------------------------------------
t=[0:0.01:150];
[t,y]=ode45('yp1',[t],[2 0]);
psi=y,2);
u1=cos(theta)*cos(psi)*T1/m1;
v1=u1;
z21=-m1/m3*tan(theta)*sec(psi);
z31=m1/m2*tan(psi);
zddot=z21.*v1;
yddot=z31.*v1;
xddot=v1;
[t,y1]=ode45('yp2',[t],[3 0]);
x=y1,2);
_____________________
function dy = yp1(t,y)
u4=(l*T2)/Iz;
dy=zeros(2,1);
dy(1)=y(2);
dy(2)=2*m1/m2*tan(y(1))*y(2)/(cos(y(1))*cos(y(1)))+ m1/m2*u4/(cos(y(1))*cos(y(1)));
------------------------------------------
function dy = yp2(t,y,psi)
dy=zeros(2,1);
dy(1)=y(2);
dy(2)=cos(theta)*cos(psi)*T1/m1;
I want to solve 2 second order parameter and and 1 of them related to previous value"
% psiddot =2*m1/m2*tan(psi)*psidot/(cos(psi)*cos(psi))+ m1/m2*u4/(cos(psi)*cos(psi));
%xddot=v1=cos(theta)*cos(psi)*T1/m1; % theta is constant.
I write the program like below and these error came out:
The error that came out:
??? Function 'cos' is not defined for values of class 'char'.
Error in ==> yp2 at 22
dy(2)=cos(theta)*cos(psi)*T1/m1;
Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in ==> twoinput4state at 46
[t,y1]=ode45('yp2',[t],[3 0]);
What should i do to correct it? Thanks.
----------------------------------------------------------
t=[0:0.01:150];
[t,y]=ode45('yp1',[t],[2 0]);
psi=y,2);
u1=cos(theta)*cos(psi)*T1/m1;
v1=u1;
z21=-m1/m3*tan(theta)*sec(psi);
z31=m1/m2*tan(psi);
zddot=z21.*v1;
yddot=z31.*v1;
xddot=v1;
[t,y1]=ode45('yp2',[t],[3 0]);
x=y1,2);
_____________________
function dy = yp1(t,y)
u4=(l*T2)/Iz;
dy=zeros(2,1);
dy(1)=y(2);
dy(2)=2*m1/m2*tan(y(1))*y(2)/(cos(y(1))*cos(y(1)))+ m1/m2*u4/(cos(y(1))*cos(y(1)));
------------------------------------------
function dy = yp2(t,y,psi)
dy=zeros(2,1);
dy(1)=y(2);
dy(2)=cos(theta)*cos(psi)*T1/m1;