Please use MATLAB and show me how to write the function program.
The crane below rotates with a constant angular velocity ω = 0.30 rad/s and the boom is being raised with a constant angular velocity ω = 0.50 rad/s. The length of the boom is L = 12 m.
θ = 30
The acceleration of point P is given by the equation: a = a_r + ω^2 * r, where a is the acceleration, ω is the angular acceleration, and r is the distance from O to P.
The angular velocity (ω) is given by the vector: ω = 0i + ωj + 0k. The angular acceleration (α) is given by the equation: α = 0i + 0j + k.
The distance from O to P (r) is given by: r = L * cosθi + L * sinθj + 0k.
Requirements: Write a function program that will take the cross product of two vectors. Name your function program "cross_prod". Inputs to the function program will be the vectors a and b. Output from the function program will be the vector c. You must use the equation above for the cross product. You CANNOT use any MATLAB built-in functions to calculate the cross product.
1. Write a main program to calculate the acceleration of point P. In your main program:
a. Define variables for the constants ω, α, and L.
b. Using these variables, define the vectors a and b.
c. Calculate c by making a call to your function program using appropriate vectors for a and b.
d. Calculate a by using the equation a = α * r.
e. Output should be as follows: "The calculated acceleration is: [0.08, 0.8, 0]."
3. You should be submitting TWO m-files: one for the function program and one for your main program.
Solution: The calculated acceleration is: [-3.533, -1.500, 1.800].