1. Math
2. Advanced Math
3. matlab question computer science mathematical computing in the engineering...

# Question: matlab question computer science mathematical computing in the engineering...

###### Question details

MATLAB QUESTION

(COMPUTER SCIENCE / MATHEMATICAL COMPUTING)

In the engineering industry, a four-bar linkage is often used in pump-jacks, foot-operated machines i.e. lathe machines, gear shift linkages and steam engines and locomotives. The mechanism consists of four links connected in a loop by four joints. A diagram of the mechanism is shown below. The first link, 𝑎, is the input link (crank). The second link, 𝑏, is a coupler link. The third link, 𝑐 is the output link. The fourth link, 𝑑, is the fixed link (ground). The angular position of the output link (𝜃4) of a four-bar linkage corresponding to the angular position

of the input link (𝜃2) can be computed using the Freudenstein’s equation: The length of the links are as follow: 𝑎 = 1 unit, 𝑏 = 2 units, 𝑐 = 4 units, and 𝑑 = 5 units. The following parameters can be used for root finding:
𝑥𝑖 = 120°, 𝑥𝑖−1 = 110°, 𝛿 = 0.01, 𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 = 0.001

PART A

Find the value of 𝜽𝟒 for 𝜽𝟐 = 𝟔𝟎° using any open root finding method.
Subsequently, create a stick figure image of the four-bar linkage when 𝜃2 = 60° with the following specifications:

• - Link 𝑎

• - Link 𝑏

• - Link 𝑐

Line specification: Blue solid line with thickness of 8. Line specification: Green solid line with thickness of 8. Line specification: Red solid line with thickness of 8.

Axes ranges should be set to the same axes ranges shown in the picture below. Ensure that the grid is turned on. PART B

Find the values of 𝜃4 for 𝜃2 = 0: 1: 360° using any open root finding method of your choice. You can monitor the outputs of all iterations to help you choose a suitable root finding method. In a new figure, plot a graph of output angle versus input angle using red asterisks.

PART C

Animate the stick figure created in Part A In a new figure window, use the calculated values of 𝜃4 from Q1b to show an animation of one complete revolution (for 𝜃2 = 0 to 360°). Ensure that all links are moving in a logical manner where the length of 𝑎, 𝑏 and 𝑐 are constant and cannot be changed. Axes ranges should be set to the same axes ranges in Q1a. Ensure that the grid is turned on. The current 𝜽𝟒 value should be stated in the title.

The following MATLAB functions: plot() and pause() will need to be used.

To achieve an animation effect, the coordinates of links quickly will need to be updated quickly. A pause of 0.01 seconds is recommended.
The stick figure animation should look like the following (at the respective instances): ###### Solution by an expert tutor 