derivative of a function of two variables

조회 수: 23 (최근 30일)
Rasto
Rasto 2013년 2월 21일
댓글: onur karakurt 2018년 10월 17일
Hello,
How can I get such a derivative in Matlab-Symbolic Toolbox ?
Differentiation according to two variables q1 and q2.
y=L1*cos(q1)+L2*cos(q2)
y´=-L1*sin(q1)-L2*cos(q2)
There is only this alternative?
z´=diff(y,q1)+diff(y,q2)
Thank you very much
  댓글 수: 1
onur karakurt
onur karakurt 2018년 10월 17일
Thanks, but this is symbolic derivative, Can you give example numerical derivative with the function of y=L1*cos(q1)+L2*cos(q2)

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

채택된 답변

Kaijie Cui
Kaijie Cui 2013년 2월 21일
To get a numerical difference (symmetric difference), you calculate (f(x+dx)-f(x-dx))/(2*dx)
or "gradient", "polyder" (calculates the derivative of a polynomial) functions. Also a function "derivest" could also give numerical differentiation.

추가 답변 (1개)

Babak
Babak 2013년 2월 21일
y = L1*cos(q1)+L2*cos(q2)
yp =-L1*sin(q1)-L2*cos(q2)
Do you want to take the derivative with respect to both independent parameters? if so, do this:
dy_over_dq1_dq2 = diff(diff(y,q1),q2)
  댓글 수: 1
Rasto
Rasto 2013년 2월 22일
But if derivatives under him dy_over_dq1_dq2 = diff(diff(y,q1),q2) in Matlab me comes 0.

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

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by