Finding the derivative of a function with respect to the derivative of a variable
5 ビュー (過去 30 日間)
古いコメントを表示
I am trying to derive the expression that contains a dependent variable x with respect to the derivative of x, but although I defined dx as a variable I get the error message
Second argument must be a variable, a symfun or a list of variables and symfuns.
The output should be 2*diff(x,t,1).
syms x(t)
dx = diff(x,t,1);
L = dx^2
functionalDerivative(L,dx)
0 件のコメント
回答 (1 件)
Deepak Meena
2021 年 1 月 20 日
Hi Andrew ,
Now to get the desired Output you can do get something like this:
syms x(t) dx ad
dx = diff (x, t, 1);
L(ad) = subs(dx^2, dx, ad);
p = subs(diff(L, ad), ad, dx);
>>p
p(ad) =
2*diff(x(t), t)
Thanks
Deepak
0 件のコメント
参考
カテゴリ
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!