You contact the jumpers used to generate the data in

c moment [Mx = EId 2 yd x 2 ], d shear [V x = EId 3 yd x 3 ], and e loading [wx = −EId 4 yd x 4 ]. Use the following parameters for your computation: L = 600 cm, E = 50,000 kNcm 2 , I = 30,000 cm 4 , w = 2.5 kNcm, and x = 10 cm. Employ the subplot function to display all the plots vertically on the same page in the order a to e. Include labels and use consistent MKS units when developing the plots.

2.22 The butterfly curve is given by the following paramet-

ric equations: x = sint e cos t − 2 cos 4t − sin 5 t 12 y = cost e cos t − 2 cos 4t − sin 5 t 12 Generate values of x and y for values of t from 0 to 100 with t = 116. Construct plots of a x and y versus t and b y versus x. Use subplot to stack these plots vertically and make the plot in b square. Include titles and axis labels on both plots and a legend for a. For a, employ a dotted line for y in order to distinguish it from x.

2.23 The butterfly curve from Prob. 2.22 can also be repre-

sented in polar coordinates as r = e sin θ − 2 cos4θ − sin 5 2θ − π 24 Generate values of r for values of θ from 0 to 8π with θ = π32. Use the MATLAB function polar to generate the polar plot of the butterfly curve with a dashed red line. Employ the MATLAB Help to understand how to generate the plot. 2.21 Figure P2.21a shows a uniform beam subject to a lin- early increasing distributed load. As depicted in Fig. P2.21b, deflection y m can be computed with y = w 120EIL −x 5 + 2L 2 x 3 − L 4 x where E = the modulus of elasticity and I = the moment of inertia m 4 . Employ this equation and calculus to generate MATLAB plots of the following quantities versus distance along the beam: a displacement y, b slope [θ x = dydx], PROBLEMS 47 w L a x = 0, y = 0 x = L, y = 0 x b FIGURE P2.21 Programming with MATLAB 48 CHAPTER OBJECTIVES The primary objective of this chapter is to learn how to write M-file programs to implement numerical methods. Specific objectives and topics covered are • Learning how to create well-documented M-files in the edit window and invoke them from the command window. • Understanding how script and function files differ. • Understanding how to incorporate help comments in functions. • Knowing how to set up M-files so that they interactively prompt users for information and display results in the command window. • Understanding the role of subfunctions and how they are accessed. • Knowing how to create and retrieve data files. • Learning how to write clear and well-documented M-files by employing structured programming constructs to implement logic and repetition. • Recognizing the difference between if...elseif and switch constructs. • Recognizing the difference between for...end and while structures. • Knowing how to animate MATLAB plots. • Understanding what is meant by vectorization and why it is beneficial. • Understanding how anonymous functions can be employed to pass functions to function function M-files. YOU’VE GOT A PROBLEM I n Chap. 1, we used a force balance to develop a mathematical model to predict the fall velocity of a bungee jumper. This model took the form of the following differential equation: dv dt = g − c d m v |v|