Partial Differentiation wrt a Symbolic Variable Defined as Another Function

5 ビュー (過去 30 日間)
Seth
Seth 2015 年 5 月 3 日
回答済み: Nalini Vishnoi 2015 年 5 月 5 日
I am trying to reduce the amount of times that I have to use the subs command and have run into this problem quite a bit when using symbolic differentiation. In my case I'd like to take the derivative of a function with respect to another variable that has already been defined as a generic function of "t". The below example should describe what I mean by that. To be clear this is something that I would like to do.
syms detheta dy; y=sym('y(t)'); theta=sym('theta(t)'); Rb=y - L*cos(theta); dRb=diff(Rb,y)*dy+diff(Rb,theta)*dtheta;
What I just do now is substitute the values 'y(t)' and 'theta(t)' for a different symbolic variable such as yS and thetaS into Rb, take the partial wrt the desired yS/thetaS, then substitute the original 'y(t)'/'theta(t)' back into the equation since I will later need them back in that form. Is there a more streamlined way to do this in 2013a w/ symbolic toolbox?

回答 (1 件)

Nalini Vishnoi
Nalini Vishnoi 2015 年 5 月 5 日
Yes, you can use the 'Chain rule'. Look at the discussions in this Answers post .

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by