Problem 1. For this assignment, you need to implement a MATLAB program for Kinem
ID: 3888548 • Letter: P
Question
Problem 1. For this assignment, you need to implement a MATLAB program for Kinematics analysis of a double slider mechanism shown in the figure: Your MATLAB program should do the following . Considers Izi,y1.01]T as the array of Absolute Generalized Coordinates. . Saves the Jacobian of the mechanism in matrix J and prints it. . Opens the file "functionDefinition.txt" and reads the string of characters that is on the first line of this . Converts this string of characters to a function that depends on time (let's call it f(t) . Conducts a Kinematics analysis of the mechanism with the kinematic constraints shown in the picture and a driving constraint defined as = f(t) - reads the number saved in the second line of "functionDefinition.txt". This number defines the value of L . reads two numbers saved in the third line of "functionDefinition.txt". These numbers define the vector s'P, which is the position of point P in local reference frame t0.0,0.1,0.2,..., 10.0 plots the trajectory of point P over time (for 10 second) plots the velocity and acceleration of point P over time (4 plots: . calculates the position, velocity, and acceleration of point P for 0 t10, with the frequency of 'y. a,ay) The file "function Definition.txt" is assumed to contain 3 lines, which should read: 10.5 sin (2.4t pi/2) 0.5 0.7Explanation / Answer
T_Int
=0:0.01:2;
3.
X0=[0 50 pi/2 125.86 132.55 0.2531 215.86 82.55 4.3026];
4.
global
T
5.
Xinit
=X0;
6.
7.
% Do the loop for each time interval
8.
for
Iter
=1:length(
T_Int
);
9.
T=
T_Int
(
Iter
);
10.
% Determine the displacement at the current time
11.
[
Xtemp,fval
] =
fsolve
(@constrEq4bar,Xinit);
12.
13.
% Determine the velocity at the current time
14.
phi1=
Xtemp
(3); phi2=
Xtemp
(6); phi3=
Xtemp
(9);
15.
JacoMatrix
=Jaco4bar(phi1,phi2,phi3);
16.
Beta=[0 0 0 0 0 0 0 0 2*pi]';
17.
Vtemp
=
JacoMatrix
Beta;
18.
19.
% Determine the acceleration at the current time
20.
dphi1=
Vtemp
(3); dphi2=
Vtemp
(6); dphi3=
Vtemp
(9);
21.
Gamma=Gamma4bar(phi1,phi2,phi3,dphi1,dphi2,dphi3);
22.
Atemp
=
JacoMatrix
Gamma;
23.
24.
% Record the results of each iteration
25.
X(:,
Iter
)=
Xtemp
; V(:,
Iter
)=
Vtemp
; A(:,
Iter
)=
Atemp
;
26.
27.
% Determine the new initial position to solve the equation of the next
28.
% iteration and assume that the kinematic motion is with inertia
29.
if
Iter
==1
30.
Xinit
=X(:,
Iter
);
31.
else
32.
Xinit
=X(:,
Iter
)+(X(:,
Iter
)
-
X(:,Iter
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.