Tweak ham() function to return results in nested list
This commit is contained in:
1 parent
b471f7f70b
commit
8aff3754e0
1 file changed
+4
-4
@@ -9,7 +9,7 @@ ham(L, qs) := block([ps, qdots, H],
|
||||
H: subst(solve(maplist(lambda([p,qdot], p = diff(L, qdot)), ps, qdots),
|
||||
qdots),
|
||||
apply("+", maplist("*", ps, qdots)) - L),
|
||||
maplist(trigsimp, flatten(maplist(lambda([q], [
|
||||
'diff(q,t) = diff(H, concat(p_, q)),
|
||||
'diff(concat(p_, q),t) = -diff(H, q)
|
||||
]), qs))));
|
||||
maplist(trigsimp, maplist(lambda([q], [
|
||||
diff(H, concat(p_, q)),
|
||||
-diff(H, q)
|
||||
]), qs)));
|
||||
Reference in new issue
Block a user