A soccer ball is kicked, create a function that maximizes the x-distance by choosing an angle for any user-defined initial velocity. the question asks to:
a) create a function with at least the following inputs v0, and x(a)
b) Find the maximum value of objective function using the golden section search method with an appropriate error if needed. Do not use MATLAB built-in functions to perform optimization.
c)Output the maximum value to the command window
I haven't tried anything yet, I don't know where to even begin. some additional information given is:
change in x = v_x * t
change in y = v_y * t - 0.5 * g * t^2
v_x = v0cos(theta)
v_y = v0sin(theta) - g*t
Given a = [theta]
maximize x(a)
0
x > 0
y > 0