Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Suppose the nozzle of a water hose is located at the origin in the (x, y) plane, where r is the horizontal direction and

image text in transcribed

image text in transcribed

4. Suppose the nozzle of a water hose is located at the origin in the (x, y) plane, where r is the horizontal direction and y is the vertical direction. The nozzle is shooting water with an initial water velocity v at an angle a with respect to the ground (x direction) The trajectory of the water stream, obeys the following equation 2 ucos where r 0.30sec1 is the level of air resistance and g 9.8065m/sec is the acceler- ation of gravity. One would like to adjust the angle so that the water stream hits a target lying on the roof of a building with height ytarget, at a distance Ttarget from the nozzle. Let the initial water velocity be v - 20m/sec, the height of the target ytarget-4m, and the horizontal distance to the target be xtarget-11m For any particular angle a, formula (1) gives the vertical distance y of the water stream at a given horizontal distance r from the source. Hence, for a fixed distance "target the effective height ytarget is a function of the scalar variable . We wish to find the angle * which hits the target at a horizontal distance of ata get and height equal to ytarget. a) Use a numerical root-finding procedure to find the angles a in degrees to within an error of at most 0.01 degrees. There are two answers * and ** in the range [0, 90] - find them both. For the choice of numerical root-finding procedure, you can use bisection, Newton's method, or the secant method, but in any case you should explain how you go about initializing the method so as to find both angles. This might involve simple probing of the function values in [0, 90], but Note: the built-in trig functions all expect radians and "log" is the natural logarithm you should explain this. Include a printout of the code for the secant, Newton, or bisection method itself, and a table of iterates (with function values). You do not have to write a general purpose root-finder. Rather you can hardcode the function (1) and/or its derivative in your root-finder, as long as the formula for the function is easily identifiable within the code. Every root-finder requires an initial value. In this problem you can use some ad- hoc hand computations to find the initial values for your root-finder. However, you hand in a written description of how to came up with your initial values. You should not attempt to write a general purpose program to hunt for good initial values, and there is no need to write a general purpose root-finder at this stage. (b) For each of the two angles computed in part 4a, plot the trajectory of the stream of water from the hose (x 0) to the target (target), boh on a single plot. Identify which curve is which. In addition to the plot, (i) describe the method you used to figure an initial value for your root-finder, and (ii) identify the root-finder algorithm you used. All the above should be included in your PDF submission. Also hand in your code in a separate ZIP file. 4. Suppose the nozzle of a water hose is located at the origin in the (x, y) plane, where r is the horizontal direction and y is the vertical direction. The nozzle is shooting water with an initial water velocity v at an angle a with respect to the ground (x direction) The trajectory of the water stream, obeys the following equation 2 ucos where r 0.30sec1 is the level of air resistance and g 9.8065m/sec is the acceler- ation of gravity. One would like to adjust the angle so that the water stream hits a target lying on the roof of a building with height ytarget, at a distance Ttarget from the nozzle. Let the initial water velocity be v - 20m/sec, the height of the target ytarget-4m, and the horizontal distance to the target be xtarget-11m For any particular angle a, formula (1) gives the vertical distance y of the water stream at a given horizontal distance r from the source. Hence, for a fixed distance "target the effective height ytarget is a function of the scalar variable . We wish to find the angle * which hits the target at a horizontal distance of ata get and height equal to ytarget. a) Use a numerical root-finding procedure to find the angles a in degrees to within an error of at most 0.01 degrees. There are two answers * and ** in the range [0, 90] - find them both. For the choice of numerical root-finding procedure, you can use bisection, Newton's method, or the secant method, but in any case you should explain how you go about initializing the method so as to find both angles. This might involve simple probing of the function values in [0, 90], but Note: the built-in trig functions all expect radians and "log" is the natural logarithm you should explain this. Include a printout of the code for the secant, Newton, or bisection method itself, and a table of iterates (with function values). You do not have to write a general purpose root-finder. Rather you can hardcode the function (1) and/or its derivative in your root-finder, as long as the formula for the function is easily identifiable within the code. Every root-finder requires an initial value. In this problem you can use some ad- hoc hand computations to find the initial values for your root-finder. However, you hand in a written description of how to came up with your initial values. You should not attempt to write a general purpose program to hunt for good initial values, and there is no need to write a general purpose root-finder at this stage. (b) For each of the two angles computed in part 4a, plot the trajectory of the stream of water from the hose (x 0) to the target (target), boh on a single plot. Identify which curve is which. In addition to the plot, (i) describe the method you used to figure an initial value for your root-finder, and (ii) identify the root-finder algorithm you used. All the above should be included in your PDF submission. Also hand in your code in a separate ZIP file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions