Catenary at different height between 2 fixed points ?

34 visualizzazioni (ultimi 30 giorni)
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 Commenti
VIGNESH BALAJI
VIGNESH BALAJI il 6 Set 2023
@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

Accedi per commentare.

Risposte (2)

David Hill
David Hill il 6 Set 2023
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 Commento
VIGNESH BALAJI
VIGNESH BALAJI il 6 Set 2023
@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.

Accedi per commentare.


DGM
DGM il 8 Set 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

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by