%The length of the crank and the slider a=2;b=5; %Point P1 P1 = [0,0]; %Parameters of the plot axis(gca,'equal'); %The aspect ratio axis([-2 7 -2 3]);%The limite %The angular speed of crank in rad/s k = 1; % Now comes the loop for t=1:500 % t is the time in tenths of seconds theta = k*(t/10); % The point P2 P2= a*[cos(theta) sin(theta)]; %The angle alpha alfa=asin(a*sin(theta)/b); %The point P3 P3 = [a*cos(theta)+ b*cos(alfa) 0]; %The crank line crank = line([P1(1) P2(1)],[P1(2) P2(2)]); %The slider line slider = line([P2(1) P3(1)],[P2(2) P3(2)]); % The point P2 tajectory P2_traj=viscircles([0 0],a,'LineStyle','--'); % The point P1,P2 anad P3 P1_circ= viscircles(P1,0.1); P2_circ= viscircles(P2,0.1); P3_circ= viscircles(P3,0.1); % The interval to update the plot pause(0.011); % Delete the previous line delete(crank); delete(P1_circ); delete(P2_circ); delete(slider); delete(P3_circ); end
I don't know why but I can't see the right animation, specifically I called the crank --> manovella and the slider --> biella, then I substitute also the P0--> O, P1-->A, P2-->B but it doesn't work and I don't know why, can I send to you my code to see if I'm doing all right?
It has to do with how fast the mechanism is moving and the pause. With k =1 and pause(0.001), it recaptures an image update every 0.001 seconds and the plot looks fine. If you double k, the plot still works and can be seen easily. Once you reach k = 4 the plot gets pretty choppy because it's moving so fast. By changing the pause time to 1 it really slowed down the graph for me. At least this is my interpretation.
%The length of the crank and the slider
a=2;b=5;
%Point P1
P1 = [0,0];
%Parameters of the plot
axis(gca,'equal'); %The aspect ratio
axis([-2 7 -2 3]);%The limite
%The angular speed of crank in rad/s
k = 1;
% Now comes the loop
for t=1:500 % t is the time in tenths of seconds
theta = k*(t/10);
% The point P2
P2= a*[cos(theta) sin(theta)];
%The angle alpha
alfa=asin(a*sin(theta)/b);
%The point P3
P3 = [a*cos(theta)+ b*cos(alfa) 0];
%The crank line
crank = line([P1(1) P2(1)],[P1(2) P2(2)]);
%The slider line
slider = line([P2(1) P3(1)],[P2(2) P3(2)]);
% The point P2 tajectory
P2_traj=viscircles([0 0],a,'LineStyle','--');
% The point P1,P2 anad P3
P1_circ= viscircles(P1,0.1);
P2_circ= viscircles(P2,0.1);
P3_circ= viscircles(P3,0.1);
% The interval to update the plot
pause(0.011);
% Delete the previous line
delete(crank);
delete(P1_circ);
delete(P2_circ);
delete(slider);
delete(P3_circ);
end
I am just leaving a comment for no reason
thank u cuetian mecha vai id 1803126
Thanks a lot for sharing your work. It's really helpful.
is it just my pc or is there no sound in the video
Cool! Thanks for the sharing this work!
Thanks so much. It's very usefull
I don't know why but I can't see the right animation, specifically I called the crank --> manovella and the slider --> biella, then I substitute also the P0--> O, P1-->A, P2-->B but it doesn't work and I don't know why, can I send to you my code to see if I'm doing all right?
great!
thank you for sharing this work it good and help me :)
please asap what would the x and y axis be labled as
please asap what would the x and y axis be labled as
bro did you get the code ? :(
Can someone explain why for the crank = line([P1(1) P2(1)], [P1(2) P2(2)]) what the (1) and (2)'s do?
I think it's referring to the P1 and P2 x, y values. (1) and (2) call the value in the array. Line must be a matlab command.
it is called indexing. P1(1) access the first element of the vector p1. For example v1(6) access the sixth element of vector v1
i use a same delay of 0.001 sec in pause but still mine isn't as smooth as yours
Maybe your machine is running it slow
Please can any one tell me this code can be activated by matlab2009 or no.
Please I want the answer very more
sound???
can anyone show how to label axes in animated plot
please asap what would the x and y axis be labled as
Could you please provide this code? I'm having a hard time following
please asap what would the x and y axis be labled as
Can you provide your code please?Cause i followed your steps, i wasn't success however. It said that my crank was undefined.
Hi , can you tell me how can i change the angula veloccity k? why is that when I change the k value , the figure cease to move.
It has to do with how fast the mechanism is moving and the pause. With k =1 and pause(0.001), it recaptures an image update every 0.001 seconds and the plot looks fine. If you double k, the plot still works and can be seen easily. Once you reach k = 4 the plot gets pretty choppy because it's moving so fast. By changing the pause time to 1 it really slowed down the graph for me. At least this is my interpretation.
could you provide for this
Can you help me make a mechanism?
Thanks, This helped so much. Can you do a tutorial of a more complicated crank slider mechanism, one with sliding pairs.
please asap what would the x and y axis be labled as
Youcef Merabt 4 years too late
4yrs ago had no idea what matlab was
@@youcefmerabt4482 And I haven't used Matlab in 4 years.
😂😂 i finished my code now atleast
Gracias
could you provide code for this
theivamae sema po
Alpha is wrong in your code.
alpha = a*sin(theta) / b
Asin means sin inverse .It is absolutely right .verify yourself and then comment as it causes misguidance for those who wants to learn
please asap what would the x and y axis be labled as