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 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by