Document Sample
tech_report Powered By Docstoc
					                    Chained Boat Simulation
                                      Therese Esposo
                                      UC Santa Cruz
                                       May 17, 2011

      This program is meant to simulate a chain attached to a boat and a dock. In
      equilibrium, a chain falls naturally in a catenary curve. Individual chain links can
      be drawn accurately if you know this curve and the length of the chain. Assuming
      the point of attachment to the dock and the boat have the same height, this paper
      will show you how to get the points that will represent each link connection using
      the forces applied at their collisions. So far, the boat moves back and forth by a
      spring force and a user defined pseudo wind force. Physics based animation and
      Euler integration is used to find the position of the moving boat with the forces
      applied to it.

         There are three forces applied to individual chain links: the tension of the chain
above it, below it, and the force of gravity. The correct free body diagram for each chain
link can be very difficult to draw correctly with unknown angles and positions of the
chain in equilibrium. Luckily, we know that all chains, ropes, and strings with uniform
mass distribution naturally fall in what is called a catenary curve. The Catenary
Hypothesis states that the wire is perfectly flexible and inelastic[1]. It has no bending
forces and it cannot stretch, just like our hanging chain. This curve uses the hyperbolic
cosine to calculate its points: y=a cosh(ax) where a is a scaling function. It’s not enough
just to have this function; to draw any hanging wire, you need to know the length of the
wire, the distance between the two endpoints, and the height of these endpoints. Once
our curve is calculated, the forces need to be known at each collision point where one
link meets and is held by tension to another link. The horizontal force is the same at
every point on the curve because the weight of the chain acts vertically downward[2]. To
find the forces of tension acting in the x and y direction, we use the derivative or slope at
one of the endpoints. From this we can get the first angle at the top of the chain and work
our way down accordingly. Now, these forces were calculated for the connections in
between the links at point of collision rather than the center of an individual link;
therefore, the angles will be at the collision points and will also represent the tangent at
these collision points. Because our catenary has endpoints with equal height, once we
find anything on one half of the curve, we can assume it is the opposite on the other side
because of symmetry. With simple algebra we can get the angles of the chain links using
the calculated angles from the collision points. Once we have the angle a link lays in the
curve, we can easily find the position of the link knowing its length by using
         Now that we have our chain, curve, and positions the links lay on the curve, I
would like to simulate boat movement in the water, attached to a dock where we can
capture the chain with the endpoints moving back and forth. I started on with a simple
spring force to oscillate the boat in a swaying type motion. At this point there are many
ways you can apply forces to the boat to simulate movement. You can also continue with
physical based animation on the chain links while the boat moves for more realistic chain
movement. For the boat movement, I added a wind vector that is initiated by the user to
create a more random and interrupted motion.

The Problem
         The first problem in this project was to find the forces acting on each chain link
for movement, let alone placement. To find the forces in the x and y components you
would need to know at what angle one link is applying tension to another and where the
chain links lie in equilibrium. These angles can be found in various different ways. We
can have a compressed chain start in free fall and let the force of gravity take place until
they come in contact with another link and forces of tension form as they pull against
each other. However a hanging string with just two masses can prove to be very difficult
and once many links are in collision, the force of one link at an angle is not only applied
to it’s neighbor.

The Approach
        To approach this problem, I started with the chain in equilibrium in a static state.
The catenary is the curve that represents this state for a hanging chain. The general
equation for a catenary is y = (e^ax + e^-ax)/2a + b. Given a catenary of finite length we
can find the shape of a hanging chain by finding the values of a, b, and c where x is
bounded by constants –c and c using calculus and algebra[3]. Knowing the length of the
chain and the distance and height between the endpoints, then we can find the constants
a, b, and c. L=(e^ac + e^-ac)/a comes from the integral of the arc length, D=2c is the
distance from –c to c, and H=(e^ac + e^-ac)/2a +b is the height and equation when x==c.

                      QuickTime™ and a
               are neede d to see this picture.

                                                           Figure 1
We solve for c first, then plug it into L’s equation. L is not easily found by algebra, so I
came up with a function that keeps guessing the point of a, then until it gets very close to
the value of L. Plugging a and c into the function for H gives us b. Once we have these
variables, we can have the shape for any hanging chain with equal endpoint heights. We
can also get the different shapes of a cable getting wider and thinner by just changing the
c variable, and keeping the length L.

Once we know the curve, we need to find the forces acting on the links at point of contact
so we can find the angles and position them. In the diagram below, the tension Fy acting
on the whole chain is Mg where M is the total mass of all the links. At one end point, the
force in the y direction due to tension will be Mg/2, and the other endpoint will also be
Mg/2. So F1y at point P1 in the diagram is Mg/2. The tension in P2 will be F1y-mg
because it has the tension of half the force on the mass minus the weight of the one above
it. The force at Pi is F(i)y=F(i-1)y-mg. Now, this isn’t the force of the center point of the
chain, but the point where the links touch. However, these forces are acting along the
tangent of the link points where the angle alpha(i+1)=(theta(i)+theta(i+1))/2 or the

                                                                       Figure 2
Since P1 is at the endpoint, the tension is in the direction of dy/dx. Very important: this
gives us our alpha(1) or the angle in the direction of tension at point P1, and it is also
equal to theta(1).

The derivative of the curve is dy/dx=sinh(ax). Alpha(1) will be the arctan(dy/dx) where
x=c or or the x at point P1. Since the horizontal force is constant through the whole
chain, and we have F1y and alpha(1), we can solve for F1x, where
F1x=F1y/(tan(alpha(1)) and Fix=F1x. Now we have all the forces in the x and y
component at the points of linkage on the chain and we can solve for each alpha(i) with

       QuickTime™ and a
         decompress or
are needed to see this picture.

           Figure 3
Because of our equation in Figure 2, we can find theta(i) since we know theta(1) and
every alpha(i). Remember theta(1)=alpha(1), so to solve for theta(2):

To get a very close approximation of the positions of the points where the links touch, we
need to know the length of a chain link. The length is equal to total length L divided by
the number of links. Once we have this, we start at an endpoint like P1 with known x
and y coordinates. Let x1 and y1 be the coordinates of P1 and x2 and y2 be the
coordinates of P2. With known P1, we can derive that x2=x1-len*cos(theta(1)) and
y2=y1-len*sin(theta(1)) where len is the length of a link. We continue with P3 and the
next point going down and so forth and once we have half the chain, we can find the
points on the other side by taking the opposite (negate x) and mirroring across the middle.

After the chain curve was found, I wanted a way to simulate the boat moving back and
forth by a dock. There are many ways you can do this by applying forces to the mass of
the boat from different sides. I chose to do a spring motion with an additional wind force
to slow and speed up the boat. The force of a spring is –ks(Lcurr-Lrest). I decided to
have Lrest be half of the length of the chain. The starting point of the spring was at the
endpoint connected to the dock. If the current point of the boat endpoint was not at rest,
it will begin oscillating back and forth. The position of the Pboat is found by calculating
the total force of acting on the boat including the wind which added a velocity
component. Acceleration is found with F=ma. From here we use Euler’s integration to
find V(i+1)=V(i)+h(A), where h is a time step. Similarly, we can find the point using
Euler’s and find P(i+1)-P(i)+h(V). The current point and velocity are stored so we can
find the next velocity in the next time step. In addition, when the user presses spacebar,
the velocity in the x direction decreases by .5, giving it more velocity going to the left,
and slowing it down going to the right.

The Results
         I was able to get a working catenary curve for my chain to fall under and move
according to the displacement of the boat. I finally was able to understand the forces, at
least in equilibrium, of a chain[4]. Knowing those forces, I was able to get a close
approximation of the link intersection points. Given the time I would have liked to do
more with the forces in the chain to see if I could position them using physics or maybe
create a different chain that has this shape at equilibrium, but is made with stiff springs
that sway and move in a not-so-uniform manner. I was able to use physics based
animation when oscillating the boat back and forth to stretch the chain, but I would have
liked to have more wave action from the water.

Picture 1
Picture 2

[1] Project 13: The Catenary,

[2] The Catenary, J. B. Calvert, 10 July 2000,

[3] How to Find the Shape of a Cable, Rope, or Chain,.

[4] Zachary Streng, physics tutoring & help.

Other Resources

Shared By: