Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 11. Symbolic Math > Examples of MATLAB Applications

11.9. Examples of MATLAB Applications

Sample Problem 11-2: Firing angle of a projectile

A projectile is fired at a speed of 210 m/s and an angle θ. The projectile's intended target is 2,600 m away and 350 m above the firing point.



  1. Derive the equation that has to be solved in order to determine the angle θ such that the projectile will hit the target.

  2. Use MATLAB to solve the equation derived in part (a).

  3. For the angle determined in part (b), use the ezplot command to make a plot of the projectile's trajectory.


Solution

(a) The motion of the projectile can be analyzed by considering the horizontal and vertical components. The initial velocity v0 can be resolved into orizontal and vertical components:

v0x = v0cos(θ) and v0y = v0sin(θ)

In the horizontal direction the velocity is constant, and the position of the projectile as a function of time is given by:

x = v0xt

Substituting x = 2600 m for the horizontal distance that the projectile travels to reach the target and 210cos cos(θ) for v0x, and solving for t gives:


In the vertical direction the position of the projectile is given by:


Substituting y = 350 m for the vertical coordinate of the target, 210sin(θ) for v0x, g = 9.81, and t gives:


The solution of this equation gives the angle θ at which the projectile has to be fired.

(b) A solution of the equation derived in part (a) obtained by using the solve command (in the Command Window) is:



(c) The solution from part (b) shows that there are two possible angles and thus two trajectories. In order to make a plot of a trajectory, the x and y coordinates of the projectile are written in terms of t (parametric form):


The domain for t is t = 0 to .

These equations can be used in the ezplot command to make the plots shown in the following program written in a script file.



When this program is executed, the following plot is generated in the Figure Window:





  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial