Catenary at different height between 2 fixed points ?

I am making a script to write catenary at different height.
I do get a catenary with different height with the below code. The problem is the cable length is not what I set initially, it changes. For example, I set a cable length of 15 m and when I got the result, it was 37 meters. I am not sure whether there is a problem in finding curvature or I need to add a term x-x0 and find x0 while computing y for the catenary. If I had to compute x0, can you suggest me a way to do it ?
P.S - I have attached the function file to check arclength
%% catenary parameters
% end points
x1 = 0
y1 = 5
x2 = 10
y2 = 2
horizontal_diff_distance = abs(x1-x2);
vertical_diff_distance = abs(y1-y2);
L = 15; % total cable length, follows min length check L = sqrt(horizontal_diff_distance^2 + vertical_diff_distance^2)
%% find curvature 'a'for catenary at different height
d = horizontal_diff_distance;
v = vertical_diff_distance;
fun = @(a) (- L + (a * sinh((d/(2*a)) + atanh(v/L))) + (a * sinh((d/(2*a)) - atanh(v/L)))); x0 = 0.15;
a = abs(fzero(fun,x0));
%fun = @(a) (- l/2 + a * sinh(d/(2*a))); x0 = 5.0;
%a = abs(fzero(fun,x0));
%% plot catenary
x=x1:0.01:x2;
y= a*cosh(x/a);
plot(x,y),xlabel('x'),ylabel('y');
%% cross check length of cateanry
length = arclength(x, y,'spline');
disp(length)

2 Kommentare

The simple catenary curve that you are generating, thus a*cosh(x/a) has no reason for it to pass through the two points you designate.
Check that.
x1 = 0;
y1 = 5;
x2 = 10;
y2 = 2;
horizontal_diff_distance = abs(x1-x2);
vertical_diff_distance = abs(y1-y2);
L = 15; % total cable length, follows min length check L = sqrt(horizontal_diff_distance^2 + vertical_diff_distance^2)
%% find curvature 'a'for catenary at different height
d = horizontal_diff_distance;
v = vertical_diff_distance;
fun = @(a) (- L + (a * sinh((d/(2*a)) + atanh(v/L))) + (a * sinh((d/(2*a)) - atanh(v/L)))); x0 = 0.15;
a = abs(fzero(fun,x0));
a
a = 3.1691
plot([x1,x2],[y1,y2],'o')
hold on
fplot(@(x) a*cosh(x/a),[x1,x2])
So why would you expect arclengths to be consistent between the curves, when they do not satisy the requirements?
Essentially, the basic curve, y=a*cosh(x/a) is probably some variation of catenary curve, between two points at fixed height. I'd need to check that claim, but it I'll accept that as true. But y1 and y2 are not at fixed heights, so that basic curve has nothing to do with this problem.
@John D'Errico My requirement is to draw a catenary curve between 2 points and not a random catenary curve.
The statement which you mentioned about arclength is wrong. Since I set the length of the curve in the program to be 15 meters. However I draw the catenary cuve between these 2 points is ok as long as the final length of the curve (arclength) is equal to what I mentioned in the program because I used this value for parameterization of curvature (steepness of the curve). Since the length is wrong in the end the physical meaning of this is I generated an extra length curve out of nowhere which shows there is something seriously wrong in this script.
It would be nice if you can suggest me the mistake i could have made

Melden Sie sich an, um zu kommentieren.

Antworten (2)

maximum a is minimum y. And the minimum cable length can be found using:
a=2;H=10;
minL=2*a*sinh(H/2/a)
minL = 24.2008
Use cable length > minimum cable length
H=10;%horizontal
L=30;%cable length
v=3;%vertical
fun=@(a)2*a/H*sinh(H/2/a)-sqrt(L^2-v^2)/H;
a=fzero(fun,1)
a = 1.7663

1 Kommentar

@David Hill If I use cable length as minimum cable length then the cable length increases while parametersing a. The physical meaning is I aam generating cable which is out of physical reality.
I however used the final answer which was mentioned there and I got a value of 256 meters whereas your set value is 30 meters.
This is the graph and this seems to be wrong.

Melden Sie sich an, um zu kommentieren.

DGM
DGM am 8 Sep. 2023
Here, I think this is what you're after. This is blindly based on this answer.
% input parameters
x0 = [0 10];
y0 = [5 2];
L = 15;
npoints = 100;
% initial calculations
dx = diff(x0);
dy = diff(y0);
xb = mean(x0);
yb = mean(y0);
% check for sane inputs
if L < sqrt(dx^2 + dy^2)
error('L is too short to span the distance at any tension')
end
% solve r = sinh(A)/A, for A>0
r = sqrt(L^2 - dy^2)/dx;
% these are the suggested initial estimates
if r<3
A0 = sqrt(6*(r-1));
else
A0 = log(2*r) + log(log(2*r));
end
A = fzero(@(A) sinh(A^2)./A^2 - r,A0)^2;
% catenary parameters
a = dx/(2*A);
b = xb - a*atanh(dy/L);
c = yb - L/(2*tanh(A));
% get point list
x = linspace(x0(1),x0(2),npoints);
y = a*cosh((x-b)/a) + c;
% plot the curve and specified endpoints
plot(x,y); hold on
plot(x0,y0,'o')
% verify arc length
length = arclength(x,y,'spline')
length = 15.0000

7 Kommentare

Katya
Katya am 9 Dez. 2023
Verschoben: Dyuman Joshi am 9 Dez. 2023
From where have you derived the equation for finding the length of the catenary at unequal points?
DGM
DGM am 9 Dez. 2023
Verschoben: Dyuman Joshi am 9 Dez. 2023
Who are you asking?
Katya
Katya am 9 Dez. 2023
Verschoben: Dyuman Joshi am 9 Dez. 2023
You
Dyuman Joshi
Dyuman Joshi am 9 Dez. 2023
Verschoben: Dyuman Joshi am 9 Dez. 2023
@Katya, you should have either commented on DGM's answer or tagged DGM.
I am moving your non-answer response to a comment under DGM's answer.
Torsten
Torsten am 9 Dez. 2023
Bearbeitet: Torsten am 9 Dez. 2023
From where have you derived the equation for finding the length of the catenary at unequal points?
There is no such equation for the length of the catenary at unequal points in @DGM answer. The function
y = a*cosh((x-b)/a) + c;
is approximated at discrete points, the points are connected by a spline curve, and the length of this spline curve is then computed by numerical integration with the help of the function "arclength".
But you could try to get an analytical expression:
or directly try the formula for arclength
syms x
y = a*cosh((x-b)/a) + c;
curvelength = double(int(sqrt(diff(y,x)^2+1),x0(1),x0(2)))
DGM
DGM am 10 Dez. 2023
As Torsten has already mentioned, all the answers (and the original question) assumed the length as an input, and any other explanation for the code I provided is already available at the link I included.
The arclength() function used to verify the results is something that John wrote and OP included above in the original question.
@Katya Did you try to ask the derivation of it. I can show you the derivation of it. How we added the vertical seperation distance in the length formula similar to horizontal seperation distance of end points.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2021b

Gefragt:

am 6 Sep. 2023

Kommentiert:

am 11 Dez. 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by