I am trying to determine the angular acceleration by applying the central difference technique?
Afficher commentaires plus anciens
I am trying to applied the central difference technique formula into my code but I am having trouble with the output. I am trying to determine the angular acceleration of by using the knee angle. I need to plot my ang_acc vs time . I am also using this formula: (x_(i+2)-2x_i+x_(i-2))/(4∆t^2 )
fs = 69.9;
t = [1/fs:1/fs:length(ankle)/fs];
fc = [.1:.1:(fs/2)-.1]';
n = length(fs);
t=106;
%% Step 1: Calculate Knee Angle
% hip -knee represent the end points of the thigh segment angle
%fibula-ankle represent the end points of the leg segment angle
theta21_thigh = atan2(hip(:,2)-knee(:,2),hip(:,1)-knee(:,1));
theta43_leg = atan2(fibula(:,2)-ankle(:,2),fibula(:,1)-ankle(:,1));
theta_knee = theta21_thigh - theta43_leg;
%% Step 2: Angular acceleration of the knee (central difference):
angular_acc = ((theta_knee(3:end))-(2*theta_knee)+(theta_knee(1:end-2))) ./(4*(106).^2);
2 commentaires
Sindar
le 28 Sep 2020
is it throwing an error?
may be as simple as:
angular_acc = ((theta_knee(3:end))-(2*theta_knee(2:end-1))+(theta_knee(1:end-2))) ./(4*(106).^2);
(if you want the first and last point using forward/backward difference, you could just define those separately)
daniel choudhry
le 28 Sep 2020
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Assembly dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!