Question: Finding the Catenary

Hi,

I posted a problem the other day to do with this specific problem and the issues got sorted out:)

The aim of the program is to find the catenary by iteration...

It's majorly diverging though and i'm not sure why.

Any ideas?

Thanks,

Rach

Trying_to_get_the_Ca.mw

restart

with(plots):NULL

G := Pi*RR[j-1]*(RR[j]-RR[j-1])^2/(ZZ[j]-ZZ[j-1])+Pi*RR[j]*(RR[j+1]-RR[j])^2/(ZZ[j+1]-ZZ[j]):

InitialPlot := pointplot3d({seq([x, x^2+cos(x), x], x = -1 .. 1, 2/n)}, axes = framed, color = black):

InitialPlot;

 

SortedPts := sort(IP[1 .. -1], proc (A, B) options operator, arrow; evalb(A[1] < B[1] or A[1] = B[1] and A[2] < B[2] or A[1 .. 2] = B[1 .. 2] and A[3] < B[3]) end proc):

Pts := `~`[proc (P) options operator, arrow; [sqrt(P[1]^2+P[2]^2), arctan(P[2], P[1]), P[3]] end proc](SortedPts):

R := Vector(n+1, proc (j) options operator, arrow; Pts[j][1] end proc):
 

GR := unapply(Gp, [RR, ZZ, j]):

ErrR := Vector(n+1, [0, 1]):

FinalPlot := pointplot3d([seq([R[l], T[l], Z[l]], l = 1 .. n+1)], color = red, coords = cylindrical):

 

``

 

(1)

``



Download Trying_to_get_the_Ca.mw

Please Wait...