Skip to content

Commit 7202a60

Browse files
committed
add comment
1 parent 368d085 commit 7202a60

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

docs/src/tutorial-symbolics.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ D = Differential(t)
130130
@variables x(t) θ(t)
131131
132132
q = [x, θ]
133-
134133
nothing # hide
135134
```
136135

@@ -156,8 +155,8 @@ nothing # hide
156155
Starting from ``\mathcal{L} = T - V``, `Symbolics.jl` computes the terms of the Euler–Lagrange equations. To isolate the accelerations, we substitute the symbolic time derivatives with algebraic variables. This allows us to identify the **standard manipulator form** components: the mass matrix is the Jacobian of the residual with respect to the accelerations ``\ddot{q}``, and the bias vector contains the remaining terms.
157156

158157
```@example main
159-
A = D.(Symbolics.gradient(L, D.(q)))
160-
B = Symbolics.gradient(L, q)
158+
A = D.(Symbolics.gradient(L, D.(q))) # d/dt(∂L/∂q̇)
159+
B = Symbolics.gradient(L, q) # ∂L/∂q
161160
Q = Symbolics.gradient(P_non_conservative, D.(q))
162161
163162
# Euler-Lagrange residual: d/dt(∂L/∂q̇) - ∂L/∂q - Q = 0

0 commit comments

Comments
 (0)