I have a problem when computing the derivative of a first order function as below:
syms x(t)
xd = diff(x);
y = xd*xd;
how to compute derivative of y by xd;
functionalDerivative(y,xd);
Then, it raises an error as below:
Error using symengine
The variable 'diff(x(t), t)' is invalid.
The result should be:
2*diff(x,t)
I also think about name xd as a symbolic variable, then use diff(y,xd) but this way is not good for some situation. Do we have any method can directly compute the derivative of a differential function? Please suggest me some solutions. Thank in advance!
version
of Matlab are you using? - horchlerfunctionalDerivative(y,xd);
line that throws the error, not your first three lines. @TroyHaskin's approach is the way to go. - horchler