I am havng trouble with plotting this curve.
4 次查看(过去 30 天)
显示 更早的评论
Cables are used to suspend bridge decks and other structures. If a heavy uniform cable hangs suspended from its two endpoints, it takes the shape of a catenary curve whose equation is where a is the height of the lowest point on the chain above some horizontal reference line, x is the horizontal coordinate measured to the right from the lowest point, and y is the vertical coordinate measured up from the reference line. Let a % 10 m. Plot the catenary curve for !20 # x # 30 m. How high is each endpoint?
So far I have
a=10 , y=a*cosh(x/a), x=-20:0.01:30; and plot(x,y),xlabel('x'),ylabel('y')
0 个评论
回答(1 个)
Matt J
2017-11-29
Since y depends on x, you must define x first:
a=10 ,
x=-20:0.01:30;
y=a*cosh(x/a),
plot(x,y),xlabel('x'),ylabel('y')
3 个评论
DGM
2023-9-6
The curve is symmetric about x=0; since the vector x is not symmetric about 0, the endpoints are not the same height.
a = 10; % the height of the curve at x=0
x = -30:0.01:30; % x is now symmetric
y = a*cosh(x/a);
plot(x,y),xlabel('x'),ylabel('y')
VIGNESH BALAJI
2023-9-6
@DGM thank you for the nice explanation.
What should I do, if I want to draw a catenary at different heights entirely on positive x axis (with fixed y at both ends)?
I have been trying to do it.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!