Dear Forum,
This is my first post, I hope I'm not doing anything wrong. I am not a native English speaker, but I hope to translate the mathematical expressions well.
I want to define a function for a cam gear. I have already defined the cam mechanism linearly, now I want to define the actual function using a sinoid. That means, I set up the laws of motion in general. I have done that (f0,f1,f2,f1f2). Now I would like to determine the special parameters and for this I define the motion function and its derivatives (F0,F1,F2,F1F2) again with boundary conditions. For example, for phi between 0° and 10° the motion function of the path should be -1.
I wanted to try it the way you can see below. But no matter what I do, the error remains. I need your help.
N_Vert = 25.4/11; %11 needles for 25.4mm = 2.31mm
% define Positions
s_hubweg = N_Vert*[0;-1;-1;0;0;1;1;2;2;1;1;0;0];winkel = [0;10;22.5;32.5;45;55;90;100;112.5;122.5;135;145;180];% create the laws of movement
z = linspace(0,1,180);f0 = 0.5*(1-cos(pi*z)); %added for the forum: f0=f
f1 = (pi/2)*sin(pi*z); %added for the forum: f1=f'
f2 = (pi^2/2)*cos(pi*z); %added for the forum: f2=f''
f1f2 = f1.*f2; %added for the forum: f1f2=f'*f''
% nominal parameters for cam gear
C_vn = 1.57;C_an = 4.93;C_Mdynn = 3.88;% Übertragungsfunktion F von phi
phi = linspace(0,360,360);% define Function for areas of phi
% function of the way
F0(phi>=0 & phi<10) = flip(f0-1);F0(phi>=10 & phi<22.5) = -1;F0(phi>=22.5 & phi<32.5) = f0-1;% ... and more
% function of speed
F1(phi>=0 & phi<10) = -f1;F1(phi>=10 & phi<22.5) = 0;F1(phi>=22.5 & phi<32.5) = f1;% ... and more% function of acceleration
F2(phi>=0 & phi<10) = -f2;F2(phi>=10 & phi<22.5) = 0;F2(phi>=22.5 & phi<32.5) = f2;% ... and more% function of momentum
F1F2(phi>=0 & phi<10) = -f1f2;F1F2(phi>=10 & phi<22.5) = 0;F1F2(phi>=22.5 & phi<32.5) = f1f2;% ... and more% adjust amplitudes
F0 = F0*N_Vert;F1 = F1*N_Vert;F2 = F2*N_Vert;F1F2 = F1F2*N_Vert.^2;
My error starts to appear with this line:
F0(phi>=0 & phi<10) = flip(f0-1);
And continues with all similar lines.
I hope I've given you all the relevant information about the code so that you can understand my problem.
Can you tell me, how to setup such a process correctly in MATLAB?
I would be very grateful for an answer! Thanks a lot!
Best Answer