Need help with integrals and derivatives

2 次查看(过去 30 天)
The length of a parameterized curve is the integral of the norm of the derivatives of the parameterized equations. So the curve length from time t1 to t2 is obtained by
s=integral(sqrt(x^2+y^2+z^2))from t1 to t2
Consider the curve parameterized by the equations
x(t)=sin(t)+t^2
y(t)=2t+cos(t)
z(t)=t
Write a program to determine
a) Length of this curve from t = 0 to t =3*pi.
b) Draw three dimensional plot of this curve.
c) Derivative of each component using the diff command
Please help I know I am going to have to use the trapz command but I am unsure how to do all three. It keeps telling me that t is undefined and I am not sure how to work it. Some help would be greatly appreciated.

回答(2 个)

Roger Stafford
Roger Stafford 2013-6-20
You should not be using 'trapz' in this problem in which you can calculate, (using some standard calculus or matlab's symbolic toolbox,) the integrand as an explicit function of t. The 'trapz' function is really intended for inherently discrete data such as that from empirical observations. Instead use one of the quadrature functions such as 'integral' or 'quad' to do your numerical integration. It is likely your teacher will expect you to do it this way for this problem.
For a) what you want to find is the integral with respect to t over the given t-range of the square root of the sum of the squares of the three derivatives, and this integrand can be obtained as a function of t for which you can give an explicit formula.

Walter Roberson
Walter Roberson 2013-6-20
x = @(t) sin(t) + t.^2;
Then try
x([0 1/4 1/3 1/2 1])
  1 个评论
Chris
Chris 2013-6-20
Ok that's helps me with the first two but I am lost on derivatives. Could you explain how those work and how I can format it to this situation?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by