Fix my MATLAB code. % Define unknown quantities

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question

Fix my MATLAB code.

% Define unknown quantities in x-y system
% abc = Acceleration of B wrt C on beam CD in i direction
% vbc = Velocity of B wrt C on beam CD in i direction
% xacd = Angular acceleration of beam CD in k direction
% xvcd = Angular velocity of beam CD in k direction
syms abc vbc xacd xvcd;
% Create Unit Vectors in x-y coordinates
i = [1,0,0];
j = [0,1,0];
k = [0,0,1];
% Create Unit Vectors in X-Y coordinates (R is rotation Matrix)
Theta = 150; % Angle from X-axis to x-axis
R = [[cosd(Theta),-sind(Theta), 0]; ...
[sind(Theta), cosd(Theta), 0]; [0, 0, 1]];
XYZ = R*[i;j;k];
I = XYZ(1,:);
J = XYZ(2,:);
K = XYZ(3,:);
% Set known quantities for Beam AB (no slider connection).
xVab = -2.5*K; % Angular Velocity of Beam AB
xAab = -3*K; % Angular Acceleration of Beam AB
Rba = 0.2*(cosd(135)*I + sind(135)*J ); % Vector from A to B in X-Y
% Calculate velocity and acceleration of point B
% due to rotation of Beam AB (no slider connection).
Vb1 = cross(xVab,Rba);
Ab1 = cross(xAab,Rba) - dot(xVab,xVab)*Rba;
% Set Motion of moving reference frame (x-y wrt X-Y).
xV = xvcd*k;
xA = xacd*k;
% Set Motion of B wrt moving frame (x-y).
Rbc = 0.15*i;
Vbc = vbc*i;
Abc = abc*i;
% Calculate velocity and acceleration of point B
% due to rotation of beam CD (slider connection).
Vb2 = cross(xV,Rbc)+ Vbc;
Ab2 = cross(xA,Rbc) + cross(xV,cross(xV,Rbc)) + 2*cross(xV,Vbc) + Abc;
% Set velocity and acceleration equations equal for point B and solve.
Z = [Vb1(1)-Vb2(1),Vb1(2)-Vb2(2),Ab1(1)-Ab2(1),Ab1(2)-Ab2(2)];
[abc,vbc,xacd,xvcd] = solve(Z(1),Z(2),Z(3),Z(4));
abc = eval(abc)
vbc = eval(vbc)
xacd = eval(xacd)
xvcd = eval(xvcd)
Problem 5.5: The "quick-return" mechanism consists of a crank AB, slider
block B, and slotted link CD. If the crank has the angular motion shown,
determine the angular motion of the slotted link at this instant.
0-3 rad/s
9rad/s
CD-aco
100 min
30%
300 mm
Figure for Problem #5
Save the program in a file called DynLabProb5_5.m. Once you are sure each
program is working correctly, copy MATLAB's solutions into the bottom of each of
your programs and place "" in front of each line so it will be interpreted by
MATLAB as a comment. Then resave the program with the solution included at the
bottom.
Transcribed Image Text:Problem 5.5: The "quick-return" mechanism consists of a crank AB, slider block B, and slotted link CD. If the crank has the angular motion shown, determine the angular motion of the slotted link at this instant. 0-3 rad/s 9rad/s CD-aco 100 min 30% 300 mm Figure for Problem #5 Save the program in a file called DynLabProb5_5.m. Once you are sure each program is working correctly, copy MATLAB's solutions into the bottom of each of your programs and place "" in front of each line so it will be interpreted by MATLAB as a comment. Then resave the program with the solution included at the bottom.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Automation of Manufacturing Processes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY