Integration and Trajectory of Dubin's Car Model

3 vues (au cours des 30 derniers jours)
Allison Bushman
Allison Bushman le 18 Oct 2019
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?

Réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by