{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW10 - y t = y v y t-1 2 gt 2 x t = x v x t z t = z wt...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework #10: 3-D Plotting Reading: 6.6 Homework: This assignment will be done entirely in MATLAB. When asked for a “program” you should create an m-file (script) and any functions that are asked for. Be sure to turn-in the completed script and functions along with any runs you are asked for. In addition, you need a flow diagram for each program. Turn problems in IN THE ORDER THEY ARE ASSIGNED. Each problem needs to be labeled so the TA can find your work. Write a MATLAB script that 1. Creates the following 3-D plots for the function f ( x,y ) = xe - h y 2 + ( x - y 2 ) 2 i for values of x and y ranging from -2 to 2 with an increment of 0.1 (a) A wire mesh plot with a color bar (b) A surface plot with a color bar (c) A contour plot with labels The plots should appear on their own figures and have appropriate labels. 2. Plots the trajectory of a ball thrown into a cross-wind. The equations that govern this problem are
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y ( t ) = y + v y, t-1 2 gt 2 x ( t ) = x + v x, t z ( t ) = z + wt where w is the cross-wind. Assume that x = z = 0 and g = 9 . 81 m/s 2 . Your script should (a) Make g a global variable. (b) Call a function that you create that allows a user to read-in v x, , v y, , w and y . (c) Call a function that you create that calculates the 3-D trajectory. The trajectory is complete when the ball hits the ground ( y ≤ 0). (d) Plot the trajectory with appropriate labels (e) Display in a “nice” way the final positions and the final velocity, ˙ y , of the ball. Test your code for v x, = 15 m/s, v y, = 12 m/s, w =-2 m/s and y = 3 m....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online