Analytically and numerically computed arc length

15 ビュー (過去 30 日間)
Carlos
Carlos 2012 年 7 月 10 日
コメント済み: Bilgah Johnson 2020 年 12 月 11 日
Hi,
I'm trying to compute the length of a curve defined in parametric form:
t = linspace(0,pi); % Actually t could go from 0 to any angle lower than 2*pi
r = 1 ./ ( 1 - t / (2*pi) );
x = r.*cos(t); y = r.*sin(t);
dx = diff(x); dy = diff(y);
l = sum( sqrt(dx.^2 + dy.^2) ); % Arc length. Linear aprox.
This way the length is equal to 4.4725.
If I do the calculations analytically, I find the length is:
l = -2*pi*log( 1 - angle/(2*pi) ); % Being the initial point angle = 0
using angle = pi the result is 4.3552.
What's the reason of this difference?
Thanks in advance.

採用された回答

Teja Muppirala
Teja Muppirala 2012 年 7 月 10 日
I'm not sure how you are analytically calculating path length. It seems from your expression that you just integrated r(t) straight up, which is not the correct way to do it. You need to use the formula for path length.
For example, it is given for cylindrical coordinates here:
http://tutorial.math.lamar.edu/Classes/CalcII/PolarArcLength.aspx (Google: arc length cylindrical coordinates)
That equation is difficult to integrate by hand, but it can be done symbolically in MATLAB very easily.
syms r t
r = 1 ./ ( 1 - t / (2*pi) );
ds_dt = sqrt(r^2 + diff(r)^2);
path_length = int(ds_dt,0,pi)
subs(path_length)
You get a long analytical expression for path length, which turns out to be the same answer as you got numerically, 4.47.
  2 件のコメント
Bilgah Johnson
Bilgah Johnson 2020 年 12 月 11 日
i am using this code but I'm not able to get the answer. Please help as soon as possible.
Bilgah Johnson
Bilgah Johnson 2020 年 12 月 11 日
PLEASE HELP ME> HOW TO SOLVE THE ABOVE QUESTION USING THE CODE.

サインインしてコメントする。

その他の回答 (1 件)

Carlos
Carlos 2012 年 7 月 10 日
You are right. I made a mistake and I came here too soon.
Thanks. Should I delete that question?
  1 件のコメント
Walter Roberson
Walter Roberson 2012 年 7 月 10 日
No, it's okay, it will help other people in future.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by