Date: Tue, 12 Dec 95 13:48:35 CST From: rusin (Dave Rusin) To: Marc@rosl.demon.co.uk Subject: Re: dynamic cable modelling Newsgroups: sci.math In article <818159412snz@rosl.demon.co.uk> you write: >Hi, > > > I wish to model dynamic cables attached to articulated machinery for use in > graphical simulation software. I can produce a static cable so the actual > 'drawing' of a cable is not a problem. What I really need is some way of > modelling a 3-d curve. I am currently working with the following assumtions: > > End Point 1 (P1) > End Point 2 (P2) > Tangent at point 1 (P1dot) > Tangent at point 2 (P2dot) > Length of cable (L). > > The idea is if I move one or both of the end points the curve is redrawn > but the length stays fixed (non-elasticity assumed until later). I'm guessing that P1dot and P2dot are variables, not constants -- that is, you move the ends of the cable, but you let it hang as it wishes, rather than prop it up at the ends so that it sticks out in a predetermined direction. I also assume the cable bears no load. In this case, you determine the shape of the curve with a caternary -- the shape assumed by a curve fixed at the ends only but allow to sag under its own weight, assumed to be proportional to length (in particular, gravitational force is assumed constant). The equation of a caternary is of the form y= cosh(a(x-b))/a + c for some constants a, b, and c. The constants b and c are artifacts of the coordinate system; however, there are two coordinate-independent degrees of freedom (difference in heights of P1 and P2, and horizontal displacement of P1 from P2) bound by one constraint (the length of the cable) leaving still one free parameter (=a). The relation imposed by the length is given by calculus: the length of the cable is ( sinh(a(x2-b)) - sinh(a(x1-b)) )/a. Since the difference between the heights is y2-y1= ( cosh(a(x2-b)) - cosh(a(x2-b)) )/a, we have enough information to determine a and b. Substituting into the equation of the curve will easily then find c. Solving these two equations for a and b is a transcendental affair, which would be approached numerically, not symbolically. I note however that you list the tangents at the endpoints among your variables -- perhaps you are monitoring these slopes as the points move and the cable adjusts. If so, it's easy to find a and b: since y'=sinh(a(x-b)), we have two equations linear in b and 1/a: (1/a) arcsinh((dy/dx)_1) + b = x1 (1/a) arcsinh((dy/dx)_2) + b = x2 so that a = [arcsinh((dy/dx)_2) - arcsinh((dy/dx)_1) ]/(x2-x1) and so b = x1 - (1/a)*arcsinh((dy/dx)_1) and c = y1 - cosh(a(x1-b))/a = y1 - sqrt(1+(dy/dx)_1 ^2). I also note that the bottom of the curve is at (x,y) = (b,c), and that the second derivative there is a, so if you have a way of estimating the shape of the cable near its bottom, you can estimate a, b, and c, and thus the whole shape of the curve. dave PS -- I'm writing this while too tired to focus on the final exam I'm supposed to be writing, so take all equations above with a grain of salt.