Numirecal integration for a vector
Show older comments
Hi everybody,
I am designing non-circular gears using MATLAB. I have designed several types. My last step is to generate the general case which starts from the speed ratio variation. I have this equation (in the photo attached).

I have the speed ratio as a vector and also I have the input angle. I need to calculate the second gear output angle. I think that I need to integrate the vector to get my goal, but how??????????
I need help in this. please.
% this program is for calculating the NCG (non-circular gear) with no approximation
clear, clc
disp('This program generates NCG depending on the imported speed ratio form Excel file')
disp('and entered center distance')
Ratio=xlsread('speed_ratio.xlsx','A:A');
Ratio=Ratio';
Center_dis=input('Enter the center distance value in mm, Center_distance= '); % use 89.305
m=input('enter the module you want to use in mm, m= '); % use 3
phi=input('enter the standard pressure angle in degrees, phi= '); % use 20
disp('*')
disp('*')
disp('The solution depends on the main equation of NCG design and geanaration')
disp('*')
disp('*')
% the input angle is equal parts since the driving gear angular velocity is
% constant, so depending on the number of the speed ratio elements, we
% can divide the one rotation (2*pi) to the same number of elements
Input_ang=0:0.0001*pi:2*pi;
% plot the speed ratio variations
figure(1)
% plot the center
plot(0,0,'or','LineWidth',5)
hold on
plot(Input_ang,Ratio,'LineWidth',3)
title('The speed ratio variations of the NC-gearset')
xlabel('input angle')
ylabel('W_2/ W_1')
axis equal
grid on
% generating the first centrode with its evolute, base curve, tip and root curve.
R_c1=(Center_dis.*Ratio)./(1+Ratio);
X_c1=R_c1.*cos(Input_ang);
Y_c1=R_c1.*sin(Input_ang);
% plot it with clear zero point
figure(2)
% plot the center
plot(0,0,'or','LineWidth',5)
hold on
plot(X_c1,Y_c1,'k')
title('The first centrode')
xlabel('X')
ylabel('Y')
axis equal
grid on
% generating the second centrode with its evolute, base curve, tip and root curve.
R_c2=Center_dis-R_c1;
% here I need to calcualte the second gear rotating angle but how???????? need help.
2 Comments
darova
on 1 Sep 2019
Use diff() or gradient() to differentiate a vector
nezir elali
on 3 Sep 2019
Answers (1)
Steven Lord
on 3 Sep 2019
0 votes
See the trapz or cumtrapz functions.
1 Comment
nezir elali
on 7 Sep 2019
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!