Differentiation of altitude and finding time when max v
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Gurpreet Sidhu
el 26 de Mayo de 2017
Respondida: Star Strider
el 26 de Mayo de 2017
I have a set of data from a spreadsheet with the altitude of rocket at time t the initial altitude is 60m. When i diff(a)/diff(t) for velocity i only get 25 values and i found the maximum velocity now how do i find the time at which it occurs
0 comentarios
Respuesta aceptada
Star Strider
el 26 de Mayo de 2017
Use the gradient function instead of diff to calculate the derivatives. It is the same length as the original vector, so the maximum velocity will correspond to the correct time.
Example —
t = linspace(0, 10); % Create Data
a = cos(2*pi*t/max(t)); % Create Data
dt = mean(diff(t));
velocity = gradient(a, dt);
t_max = t(velocity == max(velocity));
figure(1)
plot(t,a, t,velocity)
hold on
plot(t_max,max(velocity),'pg', 'MarkerSize',10, 'MarkerFaceColor','g')
hold off
grid
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!