Integration and Trajectory of Dubin's Car Model
3 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!