548 CHAPTER 29. FIRST ORDER SCALAR ODE

-4 -2 0 2 4

-4

-2

0

2

4

I used MATLAB to graph the above. One thing might be helpful to mention aboutMATLAB. It is very good at manipulating matrices and vectors and there is distinctivenotation used to accomplish this. For example say you type

x=[1,2,3]; y=[2,3,4]; x.*y

and then press “enter”. You will get 2,6,12. Of course you would get an error if you wrotex*y. Similarly, type

[2,4,6,8]./[1,2,3,4]

and press “enter”. This yields 2,2,2,2. Of course [2,4,6,8]/[1,2,3,4] doesn’t make anysense.

You can get graphs of some integral curves in MATLAB by typing the following andthen “enter”. You don’t have to type it on two lines, but if you want to do so, to get to anew line, you press “shift” and “enter”.

>> [x,y]=meshgrid(-4:.1:4,-4:.1:4);z=y-(y.ˆ3/3+x.ˆ3/3);contour(x,y,z,[-.5,-1,-.3,1,2])

Example 29.3.6 What is the equation of a hanging chain?

Consider the following picture of a portion of this chain.

T0

T (x)

θ

T (x)cosθ

T (x)sinθ

ρl(x)g

In this picture, ρ denotes the density of the chain which is assumed to be constant andg is the acceleration due to gravity. T (x) and T0 represent the magnitude of the tension in