hi there
i would like to know if we differentitate position to get velocity and acclereation, do we get same results and graphs going back form accleration to velocity and position using integration?
when differentiating my position to get velocity and acclereation i did work out all three of them by hand, quite sure it is right
here are the codes i have used
this is the differentation of my position and the codes for the plot
clc
close all
t=linspace(0,5,100)
a=0.5
f=5
y=a*sin((2*pi)/f*t)
plot(t,y,'b-');
title('position')
y2=(a*2*pi/f)*cos(2*pi/f*t)
plot(t,y2,'r-');
title('velocity')
y3=(-a*2*pi/f)^2*sin(2*pi/f*t)
plot(t,y3,'g-');
title('accleration')
ylabel('amplitude')
xlabel('time(s)')
this is integration of my acclereation to plot my velocity and position graphs
clear all
close all
clc
a=0.5
f=5
t=linspace(0,5,100);
acc=(-a*2*pi/f)^2*sin(2*pi/f*t);
figure(1)
plot(t,acc,'g-')
xlabel('Time (sec)')
ylabel('Amplitude (m/sec^2)')
title('acceleration')
velocity=cumtrapz(t,acc);
figure (2)
plot(t,velocity,'r-')
xlabel('Time (sec)')
ylabel('Amplitude (m/sec)')
title('velocity')
position=cumtrapz(t,velocity);
figure(3)
plot(t,position,'b-')
xlabel('Time (sec)')
ylabel('amplitude(m)')
title('position')
when i plot my differentitated graphs going from position to accleration, then integrate accleration to position, i dont obtain the same graphs, this is an experiment for findig positon through intgration using simple sine wave.
i would really appreciate any help
thank you
0 Comments
Sign in to comment.