substitute only first derivative in symbolic toolbox
1 view (last 30 days)
Antonio d'Aniello on 12 Oct 2020
I am considering a second order differential equation (mass - spring system), and I want to substitute the first derivative with another symbolic function.
syms x(t) v(t) m k
expr = m * diff(x, t, 2) + k * x(t) == 0;
expr2 = subs(expr, diff(x, t, 1), v(t));
Anyway, result of expr2 still containts the second derivative of x(t) and not the first derivative of v(t). Is there a way I can solve it and make it explicit?
m*diff(x(t), t, t) + k*x(t) == 0