How to compute the functional derivative with respect to 'f(x)'?
조회 수: 8 (최근 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?
댓글 수: 0
답변 (1개)
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!
댓글 수: 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!