///withoutPrompt function Xd=car(t,X) x=X(1);xd=X(2);y=X(3);yd=X(4);th=X(5);thd=X(6);xsi=X(7);eta=X(8); [lam2,lam4,x0,x1,mu0,mu1,w0,w1]=fun(X); if ST0 then lam2=0;end if ST1 then lam4=0;end xdd=-(lam2*Fx(x0)+lam4*Fx(x1))/m ydd=-(m*g-lam2-lam4)/m thdd=-(lam2*mu0+lam4*mu1)/J xsid=-(k*(xsi-d)+lam2*w0)/gam etad=-(k*(eta-d)+lam4*w1)/gam Xd=[xd;xdd;yd;ydd;thd;thdd;xsid;etad] endfunction function s=carg(t,X) x=X(1);xd=X(2);y=X(3);yd=X(4);th=X(5);thd=X(6);xsi=X(7);eta=X(8); [lam2,lam4,x0,x1,mu0,mu1,w0,w1]=fun(X); if ST0 then s1=y-xsi*cos(th)-l2*sin(th)-F(x0) else s1=lam2 end if ST1 then s2=y-eta*cos(th)+l2*sin(th)-F(x1) else s2=lam4 end s=[s1,s2] endfunction function [lam2,lam4,x0,x1,mu0,mu1,w0,w1]=fun(X) x=X(1);xd=X(2);y=X(3);yd=X(4);th=X(5);thd=X(6);xsi=X(7);eta=X(8); x0=x+xsi*sin(th)-l2*cos(th) x1=x+eta*sin(th)+l2*cos(th) mu0=Fx(x0)*(xsi*cos(th)+l2*sin(th))-xsi*sin(th)+l2*cos(th) mu1=Fx(x1)*(eta*cos(th)-l2*sin(th))-eta*sin(th)-l2*cos(th) w0=Fx(x0)*sin(th)+cos(th) w1=Fx(x1)*sin(th)+cos(th) lam2=(Fx(x0)*xd-w0*k*(xsi-d)/gam+mu0*thd-yd)*gam/w0^2 lam4=(Fx(x1)*xd-w1*k*(eta-d)/gam+mu1*thd-yd)*gam/w1^2 endfunction ///\withPrompt{}