Integration and Trajectory of Dubin's Car Model

3 次查看(过去 30 天)
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