vertical throw in matlab?
Ältere Kommentare anzeigen
So I have the following situation: Phase one: something is being accelerated using a spring with a certain lenght, hence gaining a certain velocity. Phase two: vertical throw with said starting velocity. My question: how am i able to plot these two phases (acc., velocity and position) in one graph? If I'd go with the classical approach learned in physics class I'd end up with two different equations for phase one and two, so how can i combine them? don't know if this makes sense since i am an absolute beginner at matlab. I tried plotting both phases separately but that kind of defeats its purpose. any tips?
5 Kommentare
Mehmed Saad
am 13 Apr. 2020
Bearbeitet: Mehmed Saad
am 13 Apr. 2020
do you want to plot position against velocity and accelaration against velocity on 1 graph?
Isak N.
am 13 Apr. 2020
Mehmed Saad
am 13 Apr. 2020
Bearbeitet: Mehmed Saad
am 13 Apr. 2020
velocity, accelaration and postition (3 plots) against time? like this

or this

KALYAN ACHARJYA
am 13 Apr. 2020
Isak N.
am 13 Apr. 2020
Antworten (2)
Image Analyst
am 13 Apr. 2020
I'd use three plots, all plotted with time as the x axis. Why? Because they could all have vastly different ranges! Let's say you dropped something from an airplane. The distance plot could range from 0 to 40,000 feet while the acceleration would be a constant 9.8 m/s^2. And velocity could be from 0 to 195 km/hour. So plotting the acceleration on the same plot as the position would make the acceleration plot virtually unnoticeable and the velocity barely noticeable. Of course you could do it if you want:
plot(t, acc, '-'); % Plot acceleration vs. time.
hold on;
plot(t, velocity, '-');
plot(t, position, '-');
legend('Acceleration', 'Velocity', 'Position');
grid on;
xlabel('Time', 'FontSize', 15);
ylabel('Accel, Velocity, or Position', 'FontSize', 15);
Mehmed Saad
am 14 Apr. 2020
Define three different times for acceleration, velocity and position if there time is different (remember that each time vector size must be equal to corresponding accelaration vector, velocity vector and position vector)
t_acc = starting_acc_point:sampling_time:ending_acc_point;
t_vel = starting_vel_point:sampling_time:ending_vel_point;
t_pos = starting_pos_point:sampling_time:ending_pos_point;
Now plot them
figure,plot(t_acc,acc),hold on,plot(t_vel,vel),hold on,plot(t_pos,pos)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!