How can i differentiate diff(q(t), t) again?
이전 댓글 표시
Hello..
I started to compute a function which has a variable depending on time which I defined as q(t). In the computation, the variable was differentiated and I ended up with diff(q(t), t). Now I want to further differentiate this resulting function wrt diff(q(t), t) i.e. q' but when I wrote "diff(exp3, diff(q(t), t));" matlab showed an error: "Second argument must be a variable or a nonnegative integer specifying the number of differentiations".
Can anybody help me figure this out.
So far I have tried to use functionalDerivative but that doesnt seem to work as well. Also I have found a way around this: I can use the sub function to substitute diff(q(t), t)) by qdot and do this diff(exp3, qdot); but that isnt what I intend to do.
Please Help.
댓글 수: 3
Dev Sahu
2020년 2월 26일
Benjamin Großmann
2020년 2월 26일
Sorry, i got you wrong so i deleted my Answer.
As compensation for my misunderstanding I prepared a MWE. Is this rebuilding your problem?
clearvars, close all
clc
syms q(t)
exp = q(t).^2;
exp2 = diff(exp,t);
Ouput of exp2 is
exp2 = 2*q(t)*diff(q(t), t)
Now, we want to differentiate exp2 w.r.t. diff(q(t),t).
Dev Sahu
2020년 2월 26일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!