0

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

student22
  • 3
  • 1
  • Begin implementing the golden section method. Check [here](https://en.wikipedia.org/wiki/Golden-section_search) or [here](http://nm.mathforcollege.com/mws/gen/09opt/mws_gen_opt_txt_goldensearch.pdf) for some explanation and algorithm. Test it with some easy functions you know the answer (polynomials and trigonometric functions). – Thales Oct 11 '19 at 11:02
  • When you are sure the Golden section method is working, you must think on how you will use it to your problem. You want to maximize the x-distance. It has some constraints. The time spent on air you can calculate from the y-displacement. You can calculate it analytically, as it is a 2nd order polynomial, or use a root-finding algorithm to calculate it in your code. Changing the `theta` angle changes the x-distance, so you can find the maximum of the function using your algorithm – Thales Oct 11 '19 at 11:05

0 Answers0