Substitute partial differential into symfun
Because my actual functions are very complex, I would like to calculate the derivative of nested functions first and then substitute the functions afterwards.
A minimal example looks like this:
syms G(h) h(t) t
Q = G(h)
dGdt = diff(Q,t) % -> D(G)(h(t)) occurs
% Now define G(h) and derive:
G = h^2;
dGdh = diff(G,h)
How is it possible, to insert the derivative of G with respect to h as the partial derivative?
I tried this, but it is not working:
% dQ_subs = subs(dGdt, D(G), dGdh)
% dQ_subs = subs(dGdt, D(G)(h(t)), dGdh)
I really appreciate any feedback!Because my actual functions are very complex, I would like to calculate the derivative of nested functions first and then substitute the functions afterwards.
A minimal example looks like this:
syms G(h) h(t) t
Q = G(h)
dGdt = diff(Q,t) % -> D(G)(h(t)) occurs
% Now define G(h) and derive:
G = h^2;
dGdh = diff(G,h)
How is it possible, to insert the derivative of G with respect to h as the partial derivative?
I tried this, but it is not working:
% dQ_subs = subs(dGdt, D(G), dGdh)
% dQ_subs = subs(dGdt, D(G)(h(t)), dGdh)
I really appreciate any feedback! Because my actual functions are very complex, I would like to calculate the derivative of nested functions first and then substitute the functions afterwards.
A minimal example looks like this:
syms G(h) h(t) t
Q = G(h)
dGdt = diff(Q,t) % -> D(G)(h(t)) occurs
% Now define G(h) and derive:
G = h^2;
dGdh = diff(G,h)
How is it possible, to insert the derivative of G with respect to h as the partial derivative?
I tried this, but it is not working:
% dQ_subs = subs(dGdt, D(G), dGdh)
% dQ_subs = subs(dGdt, D(G)(h(t)), dGdh)
I really appreciate any feedback! symbolic, differentiation, partial derivative MATLAB Answers — New Questions