Strange behavior of functionalDerivative()
조회 수: 1 (최근 30일)
이전 댓글 표시
Hey all,
I've encountered the issue where functionalDerivative() gives a wrong result:
clear
syms x(t)
f = diff(x, t)^2 * x^2
functionalDerivative(f,x)
results in
- 2*x(t)*diff(x(t), t)^2 - 2*x(t)^2*diff(x(t), t, t)
while it should be (at least if my knowledge of partial derivates is still correct)
2*x(t)*diff(x(t), t)^2
How can this be?
If encountered this while trying to get the dynamics equation of a system using the Lagrangian approach.
Interestingly this error leads to -dL/dx = 0 producing the correct end result, while usually the equation d/dt( dL/ddiff(x,t) ) - dL/dx = 0 should produce this result. (with L=T-V, T being the kinetic and V the potential Energy of the system)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!