Question: Write a MATLAB function called optimizeTrebuchet that optimizes l, 92 (0), and 0. for a given projectile mass m to maximize the range for
Write a MATLAB function called optimizeTrebuchet that optimizes l, 92 (0), and 0. for a given projectile mass m to maximize the range for a given projectile mass. Your function should use MATLAB's fminsearch command, to minimize the negative of the range computed by computeRange. You should watch the plots of the trebuchet motion that are generated as fminsearch calls computeRange to see what it is doing as it explores the trebuchet design- space. Your function should have the following attributes: The function must be called optimize Trebuchet. The function must take wo input arguments: (1) The projectile mass m in kilograms, and (2) an array containing an initial guess for [1, 0(0), 0*] in units of meters and degrees. The function must return two output arguments: (1) The maximum range, and (2) an array containing the values of [12. 02(0), 0] that achieve this range. You should try running your optimization code starting from different initial values of [1, 0(0), 0*]. Does the code always find the same optimal solution? Once you can optimize the trebuchet for a 50 Kg projectile, try changing the mass and see how that affects the optimal trebuchet setup [12, 0(0), 0]. You can also see how sensitive the range it small changes in [1, 0(0), 0*].
Step by Step Solution
3.38 Rating (148 Votes )
There are 3 Steps involved in it
Solution Here is a MATLAB function called optimizeTrebuchet that optimizes the trebuchet parameters ... View full answer
Get step-by-step solutions from verified subject matter experts
