Partial Differentiation wrt a Symbolic Variable Defined as Another Function
조회 수: 5 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!