How to compute the functional derivative with respect to 'f(x)'?

6 次查看(过去 30 天)
The function 'functionalDerivative' that is new in version 6.2 of the Symbolic Math Toolbox fails with the following simple input
>> u = sym('u');
>> fu = symfun(sym('f(u)'), [u]);
>> x = sym('x');
>> fx = symfun(sym('f(x)'), [x]);
>> functionalDerivative(fu, fx)
Error using symfun/privResolveArgs (line 187)
Symbolic function inputs must match.
The result I am expecting in this case is dirac shifted to x (i.e., g(s)=dirac(s - x)).
Am I not using functionalDerivative correctly, or is it not able to generate this result?

回答(1 个)

Philip Caplan
Philip Caplan 2015-4-17
The error you are receiving is due to the fact that "fu" and "fx" need to be functions of the same independent variable, otherwise there is nothing to link the two functions and, hence, compute the functional derivative.
For example, assume the second argument passed to "functionalDerivative" is "f(x)" as you have it. Then, a valid first argument would be an expression of "x", "f(x)", "diff(f(x),x)", "diff(f(x),x,x)", etc. Here is an example:
>> syms f(x)
>> g(x) = f(x)^3 + diff(f(x),x,x,x)*diff(f(x), x);
>> functionalDerivative(g(x), f(x))
Hope this helps!

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by