Parabolas and better still catenaries

Started by samdavo, August 28, 2014, 02:24:24 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

samdavo

Back on the parabolic curve for a minute, another quick comment (as an engineer) is that the parabolic profile of a prestressing cable usually mentions the "drape" (in each span) - it is a good way to summarise its curvature,  and hence (together with the prestress load in the cable) the load-carrying capacity. 

And above the supports there is a "reverse" parabola with a hog rather than a sag.  (2 cents)
cheers
gd

prl

#16
Sam,

Here is the basiccad routine I use for graphically drawing cables.  It has an engineering approach to the data input/output.

Edit:  Sam reminded me and looking over my code, it does appear I approached this routine as a 2d mode routine.  So you should be in 2d mode for it to give you the proper sag, distance between points, cable length, etc.



'Program: catenary.d3m 
'draws a catenary line between two given points (points may be at different elevations)


n = 50 'number of divisions along length when drawing line
ntimes = 30 'bisection method max looping

sys(1)=0
setpoint "set two points defining cable support locations", 2

pointval x1, y1, z1, 1
pointval x2, y2, z2, 2

sys(1) = 0

L = x2 - x1
H = y2 - y1

input "w (weight of cable per foot)", w
input "Fh (horizontal reaction at support)", Fh

'bisection method used to locate catenary low point relative to supports
a = -L
b = 3*L

for i = 1 to ntimes
  p = (a + b) / 2
 
  x = a
  gosub 480
  fa = func
 
  x = b
  gosub 480
  fb = func
 
  x = p
  gosub 480
  fp = func
 
  if abs (fp) <= .01 then
    message i, p
    exit for
  endif
 
  if fa * fp < 0 then
    b = p
    goto 430
  endif
 
  if fb * fp < 0 then
    a = p
    goto 430
  endif
 
  message "error in interval selection"
  end
 
430:
next i

'draw the catenary
seg = L/n
>curve
{
'first point
x = p - L
y = (Fh/w)*(hcos(w*x/Fh)-1) 'eq 6.13
<pointxyz [x,y,0]

for i = 1 to n
    x = x + seg
    y = (Fh/w)*(hcos(w*x/Fh)-1)
    <pointxyz [x,y,0]
next i
}

clen = length(sys(9))

'move curve to proper location
x = p - L
y = (Fh/w)*(hcos(w*x/Fh)-1)

>PointSelect
{
<Pointxyz [x, y, 0]
}
>DragMove
{
<Pointxyz [x1, y1, z1]
}

'>fittowindow
'{
'}
sys(80) = 0
regen
F = Fh*hcos(w*x/Fh)
Message "Cable tension at supports is ", F, "   Cable length = ", clen

end

       
   
480:
' ************************** subroutine containing function *************
func = Fh/w*(hcos(w*x/Fh)-1) - Fh/w*(hcos(w*(x-L)/Fh)-1) - H
return



Quote from: samdavo on August 31, 2014, 11:40:04 AM
PS I suspect a problem in 3D in calculating the xz length in plan, but in 2D it works brilliant.

The transcribed code is from an ancient GWBasic routine I wrote when screens had two colors (amber and green) thinking only in x and y, plus it is sourced on an applied mechanics book by Housner and Hudson copyright 1949. 

samdavo

#17
Thanks prl
that's a great macro.

Just for fun, I have used it in 2D to draw a catenary (red) - then found the drape (below the midpoint of the chord), then drawn the parabola (cyan) using drapecurve1.d3m.

The catenary moves the parabola to the east towards the high end of the rope - or if you prefer the parabola is west of the catenary.

It makes sense that the catenary would sag more at the high end.  i.e. I add a point A1 which is opposite A, hence A-A1 makes a symmetrical catenary curve.   And the weight of the rope could be expected (or imagined lol) to make the rope above A1 hang more vertically.  (Maybe my imagination is kidding itself) :)   

(edit) another way of saying this is that it conforms to the general principle that a catenary is more U-shaped than a parabola (which is a marginally narrower i.e. V shape)

The same / similar point in the parabola is called point A2 which is 60 west of A1.  Likewise the bottom of the parabola is about 30 west of the bottom of the catenary.

PS I suspect a problem in 3D in calculating the xz length in plan, but in 2D it works brilliant.


PS I used w = 1 lb/ft, and Fh = 2000lb.  Distance AB in x dirn is 4243, and in y dirn is 1000.
(or w=2 and T=4000 of course).
cheers and thanks

samdavo

#18
prl
I've twigged your macro (watching gibbons in Wild China in the background - prefer to play with DCAD - but that's a gibbon).

The macro is called catenarylength.d3m

The objective is to drape a rope of a certain length between two points - obtained by iteration.
You can select two points in the XY plane  (or in a temporary XY workplane if you want a 3D version) ...

and you enter the length you would like, (must be at least as long as the chord)
plus the tolerance when the iterations will stop, default is 0.1% (unless you quit early with Q)

and input the same data you had for w and Fh, (weight per unit length, and FIRST TRIAL for horizontal force component) - although it chooses defaults of 1 and 2000 if you just press enter, 

It then runs the iterations comparing the curve length with the desired length, adjusts Fh, continues until it meets the tolerance requirements +/-,   
After each iteration it asks do you want to quit early (in case it gets lost in semi-endless loops)

If you want to do a very accurate curve eg 0.001%, then run the macro again but starting from the final Fh of the first run.  (edit) or just change the default to 0.001 in the first place - only takes a few seconds.

The enclosed jpeg shows two points A and B, with multiple catenaries between them.  (dx = 4243, and dy = 2131).  The distance between them = chord length = 4748.   Very approx the dimensions of a typical bedroom in mm.   A is half height of the room, and B is at ceiling height diagonally opposite.

There are 4 catenaries there, all using the default tolerance of 0.1% (i.e. really rough)

a red one of length 5004.9, (easily improved to +/- 0.001% about the target)
a green one of length 5996.6 (ditto)
a cyan one of length 6997.6
and a magenta one of length 8000.1

It gives you the iterated value of Fh, for interest, and/or just in case you want to rerun the macro, eg to get 0.001% or better, then it is a logical place to start.

Finally, if you want the catenary curves in 3D, then choose a temp working plane.   In the jpeg, the same set of "necklaces" are shown in the background using temp working planes based on axes u v w.  (dead simple).
cheers

PS It draws the curve after each run of the iterations, and these have to be deleted - clumsy I know , but you get there in the end.

(edit) re tolerances,  0.1% is obviously 1mm in a metre;  and 0.001% is a hair's breadth (hare's breath? 0.1mm) in 10 metres - close enough for most applications surely.

samdavo

#19
Of course, sometimes catenaries can be in the horizontal plane.

eg in the jeweller's shop :)

samdavo

#20
Quote from: samdavo on September 02, 2014, 05:08:41 AM
PS It draws the curve after each run of the iterations, and these have to be deleted - clumsy I know , but you get there in the end.

Just a quick comment / reminder that everyone will probably know...
assuming you have "drag select" set to be "select only entities wholly inside the selection box",
...
then to select multiple curves that are close together, just change that (momentarily) to "select all entities inside OR touched by the box"  by simply using "Ctrl + drag select" so that the selection box intersects all the lines.  This lets you delete all those unwanted curves in one fell/foul/fowl swoop/swap/sweep. ( 2 cents).   

samdavo

The other thing about that final macro - you get a stack of catenaries - which can be used for things like ...  comet trails for instance :)

samdavo

#22
I found that it can sometimes be the case that you bounce from one side of the target length to the other - making for a VERY slow convergence ... and hence I have added what I call a convergence factor, cf, default value 0.5,  ("slow but steady"convergence to avoid this effect) which can be changed to eg 0.7 to speed up that convergence if you find it a bit too slow (2 cents)   (Convergence speed seems to depend on a stack of imponderables, chord lengths vs rope length, etc - imponderable to me anyway :)  )

macro catenarylength2.d3m  attached.