How do you take the partial derivative of a function relative to theta dot
Afficher commentaires plus anciens
Need to take the partial derivative of l with respect to theta 1 dot
clear; clc;
syms theta1(t) theta2(t) r1 r2 m1 m2 g
%theta1dot=diff(theta1)
%theta2dot=diff(theta2)
x1 = r1*sin(theta1);
y1 = -r1*cos(theta1);
x2 = x1+r2*sin(theta2+theta1);
y2 = y1-r2*cos(theta2+theta1);
x1dot=diff(x1)
y1dot=diff(y1);
x2dot=diff(x2);
y2dot=diff(y2);
pe=m1*g*y1+m2*g*y2;
ke=1/2*m1*(x1dot^2+y1dot^2)+1/2*m2*(x2dot^2+y2dot^2);
l=ke-pe
diff(l,theta1)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!