Question: Please write MATLAB program that has a main code named HW 4 p 2 _ Task 2 _ UCusername.m and two functions Displacement _ UCusername.m

Please write MATLAB program that has a main code named HW4p2_Task2_UCusername.m and two functions Displacement_UCusername.m and Velocity_UCusername.m.
The main code will prompt the user to enter:
o The compressors dimensions L1, L2, and L3 in inch
o The initial crank angle (theta2) in degrees
The rotational speed of the crank (w2) in RPM
The main code will convert (w2) to radsec.
The main code will create 2 array that starts from the angle 2i, increments by 10 up to
a full rotation (2i+360).
Then, the main code will call the function Displacement_UCusername.m and pass L1,L2,L3, and 2.
The function Displacement_UCusername.m calculates and returns the arrays 3 and L4 shown in the equations below.
Then, the main code will call function Velocity_UCusername.m and pass L2,L3,2,3 and w2.
The function Velocity_UCusername.m calculates and returns the arrays w3 and v4 shown in the equations below.
The main code will find the minimum and maximum of L4
The main code will calculate and output the stroke of the piston =L4max-L4min
The main code will plot L4 versus 2 on Figure 1 and v4 versus 2 on Figure 2. Add axis
labels (with units), and titles for both figures.
Hint: Pay close attention to the units for the angles, make sure you are consistent with the
units, use MATLAB Commands sind, cosd, and asind.
Hint: use command figure(1) before 1st plot command to create Figure 1 and command
figure(2) before the 2nd plot command to create Figure 2.
Closed form equations for a slider-crank mechanism [3]:
3=sin-1(L1+L2sin2L3)
L4=L2cos(2)+L3cos(3)
3=-2(L2cos2L3cos3)
v4=-2L2sin2+3L3sin3
Please write MATLAB program that has a main code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!