Skip to content

Commit

Permalink
eular lagrange formulation
Browse files Browse the repository at this point in the history
  • Loading branch information
prabinrath committed Mar 19, 2022
1 parent 76f8f91 commit 25279e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions Legged Robotics/eular_lagrange.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function qdd = eular_lagrange(L,q,qd,F)
syms acc [1 length(q)];
for k=1:length(q)
dL_dqd = diff(L,qd(k));
dL_dqd_dt = 0;
for m=1:length(q)
dL_dqd_dt = dL_dqd_dt + diff(dL_dqd,q(m))*qd(m);
end
for m=1:length(qd)
dL_dqd_dt = dL_dqd_dt + diff(dL_dqd,qd(m))*acc(m);
end
dL_dq = diff(L,q(k));
qdd(k) = solve(dL_dqd_dt - dL_dq - F(k), acc(k));
end
end
Binary file added Legged Robotics/symbolic_diff_example.mlx
Binary file not shown.

0 comments on commit 25279e7

Please sign in to comment.