Change in Speed & Acceleration

2 views (last 30 days)
Andrei Sacal
Andrei Sacal on 18 Nov 2021
Commented: Adam Danz on 18 Nov 2021
Developing an algorithm to plot a cars plan in regards to acceleration and velocity.
speed: -20km/h +20km/h
What I have:
%constants
d1 = 28;
d2 = d1;
m = 2;
F = 6;
Vmax = 3;
%acceleration
a=F/m;
Acceleration=a
%Time
t=d1/Vmax;
Time=t
%speed
S=d1/Time;
% Graph to show velocity of cart at 10 intervals
T=0:t/10:t;
%velocity
v=a*T;
x=T;
plot(x,S,'-.dr');
yyaxis left
xlabel('Time')
ylabel('Speed')
title('Car Plan')
yyaxis right
plot(x,v);
ylabel('Distance')
Output:
What I'm looking for:
How do I go about adding a rate of change for both my acceleration and velocity?
  3 Comments
Adam Danz
Adam Danz on 18 Nov 2021
Hmmm then it would appear that the direction changes assuming that's what the sign of the speed is. And I'm assuming this is linear speed rather than angular. A lot of unknowns here.....

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!