Using the symbolic toolbox, how do you take a derivative with respect to a derivative?

5 views (last 30 days)
So I have a function F, which is in terms of time, t, distance, x(t), and velocity, dx/dt = diff(x(t), t). x is defined in terms of time using
syms x(t)
And the function F is, for example,
F = 0.5*x + sqrt(diff(x, t))
But now I need the partial derivative of F in terms of dx/dt. I tried using
derivative = diff(F, diff(x, t))
which results in an error. I tried substituting a letter for dx/dt but differentiation still yields an error.
What is the proper way of taking this derivative? Thanks for the help!
  6 Comments
Andrew Newell
Andrew Newell on 21 Apr 2017
There is a book on classical mechanics that argues the usual notation for Lagrangian mechanics is ambiguous. They replace it with a functional notation and provide a language called Scheme to implement it. Maple can do something similar using the D operator. But I'm not sure you can do much better in MATLAB.

Sign in to comment.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!