How to find the time and partial derivative?
Show older comments
Hello!
I have this:

How to represent the above in matlab in order to find the partial derivative w.r.t. q1_dot, that is the below

And after that i want to find the time derivative from the above.

Thanks in advance
8 Comments
Walter Roberson
on 22 Dec 2020
Is q1_dot the same as diff(q1) ? That is, are you trying to find a partial derivative with respect to a derivative? Or is q1_dot just an unusual variable name? Or is it an unusual function name ?
RoBoTBoY
on 22 Dec 2020
RoBoTBoY
on 22 Dec 2020
syms q1(t) q2(t) l1 l2 m I
K = 1/2*m*diff(q1(t),t)^2+1/2*(m*l2^2+I)*diff(q2(t),t)^2-m*diff(q1(t),t)*l2*sin(q2)*diff(q2(t),t)
That does seem to be the same as your equatiom
diff(K,t)
This is, however, not the same as diff(K,q1_dot)
syms Q1_dot
Ks = subs(K(t), diff(q1), Q1_dot)
diff(Ks, Q1_dot)
RoBoTBoY
on 22 Dec 2020
RoBoTBoY
on 22 Dec 2020
RoBoTBoY
on 22 Dec 2020
syms q1(t) q2(t) l1 l2 m I
K = 1/2*m*diff(q1(t),t)^2+1/2*(m*l2^2+I)*diff(q2(t),t)^2-m*diff(q1(t),t)*l2*sin(q2)*diff(q2(t),t)
syms Q1_dot
Ks = subs(K(t), diff(q1), Q1_dot)
dK_q1_dot = diff(Ks, Q1_dot)
dK_q1_dot_dt = diff(dK_q1_dot, t)
Accepted Answer
More Answers (0)
Categories
Find more on Assumptions 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!




