Integration and Trajectory of Dubin's Car Model

조회 수: 3 (최근 30일)
Allison Bushman
Allison Bushman 2019년 10월 18일
편집: Allison Bushman 2019년 10월 18일
T=30;%time
dt=.1; %step size
N=T/dt; %number of steps
deltheta=0; %steering input
delT=0.5; %throttle input
z=zeros(4,N);
z(i)=[x(i);y(i);theta(i);v(i)];
z(1)=[0;0;0;0];
xdot(i)=v(i)*cos(theta(i));
ydot(i)=v(i)*sin(theta(i));
thetadot(i)=-0.5*theta(i)+deltheta;
vdot(i)=-0.3*v(i)+delT;
u=[0; 0; deltheta; delT];
zdot=[xdot(i); ydot(i); thetadot(i);vdot(i)];
for i=1:N
zdot(i)=z(i)+u(i);
z(i+1)=z(i)+dt*zdot(i);
end
plot(z,t)
How do I solve for z and plot the trajectory in the x-y coordinate frame?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by