MATLAB Answers

Finding curve length of vector r(t)=<2t, t^2, 1/3t^3> Given0<=t<=1

조회 수: 7(최근 30일)
Scott Stearns
Scott Stearns 2021년 6월 18일
편집: John D'Errico 2021년 6월 18일
syms t r(t) R(t) magnitude length
r(t)=(2*t)+(t^2)+((1/3)*t^3) %Statement of original equation from vector < 2t, t^2, (1/3)t^3 >
r(t) =
t^3/3 + t^2 + 2*t
R(t)=diff((2*t)+(t^2)+((1/3)*t^3))%Derivative of original equation r(t)
R(t) =
t^2 + 2*t + 2
magnitude=sqrt((t^2)^2+(2*t)^2+(2)^2) %Calculation of the magnitude of R(t)
magnitude =
(t^4 + 4*t^2 + 4)^(1/2)
simplify(magnitude) %Simplify view of the Magnitude
ans =
((t^2 + 2)^2)^(1/2)
***Portion I am currently stuck at is creating code to solve for the length (which I'm not sure why MATLAB will not simplify further to the following ((t^2+2)^2)^(1/2) as "t^2+2") but length would be calculated as L=int1 0[t^2+2(dt)]


Paul 2021년 6월 18일
It looks like the equation for "magnitude" is incorrect Why is magnitude the sqrt of the sum of the squares of each individual term in R(t)?.
syms t
syms r(t) R(t)
R(t) = diff(r(t),t)
Now you have all the information to apply the arclength formula, which isn't quite as in your question. Note that you might need to use vpaintegral().
  댓글 수: 2
Paul 2021년 6월 18일
Oh. I completely misunderstood the question because, in the code, r(t) and other variables are all defined as scalar quantities, not vectors. I was admittedly confused because the code didn't seem to match the question. Anyway, it seems it should go like this:
syms t real % specify that t is real
r(t)=[2*t; t^2; t^3/3]
r(t) = 
rdot(t) = 
magnitude = simplify(sqrt(dot(rdot(t),rdot(t))))
magnitude = 
I think that specifying t to be real is critical to achieve the expected expression.

댓글을 달려면 로그인하십시오.

John D'Errico
John D'Errico 2021년 6월 18일
편집: John D'Errico 2021년 6월 18일
Just for kicks, I'll use my arclength tool, see how well it can do.
t = linspace(0,1,100);
X = 2*t;;
Y = t.^2;
Z = t.^3/3;
format long g
ans =
That does not help you any, but is it close? There are at least 3 ways I can think of here. Let me see, if I compute the proper arclength differential, call it L...
ans =
Oh well, at least that gives you the right answer to check.
Can you compute that integral exactly? Hmm, well, yes. ... The answer is:
ans =
And as a decimal, that is...
ans =
Again, you need to do your own homework, but that appears to be the analytical solution. When they cooked up the problem, it was one where things simplify down nicely. You could probably do it using pencil and paper. Anyway, at least this gives you a target, so you know when you got it right.

Community Treasure Hunt

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

Start Hunting!

Translated by