필터 지우기
필터 지우기

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 CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by