numerical derivation of function ?

1 次查看(过去 30 天)
how to derivate this function in matlab :
func = q*sin(phi)+r*cos(teta)
where q , r , teta ,phi are functions , how to find the derivative expression like this :
deriv_func =qdot*sin(phi)+phidot*cos(phi)*q +rdot*cos(teta)-tetadot*sin(teta)*r

采纳的回答

Walter Roberson
Walter Roberson 2018-6-20
You cannot do that numerically. Numeric differentiation can never return a symbolic result.
With the symbolic toolbox, you would do something like,
syms q(t) r(t) phi(t) teta(t)
func = q*sin(phi)+r*cos(teta)
diff(func, t)
to get
cos(teta(t))*diff(r(t), t) + sin(phi(t))*diff(q(t), t) + cos(phi(t))*q(t)*diff(phi(t), t) - sin(teta(t))*r(t)*diff(teta(t), t)
You indicated that q r phi teta were functions, but you did not indicate what they were functions of, so I assumed they were all functions of t.
  1 个评论
Waleed new
Waleed new 2018-6-20
thank you Walter Roberson .yes they are all functions of t .it works

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by