The recent Fixes #570 and #568 leaves a strange behavior for derivatives (it sounds like there are some known issues, but I wanted to document a simple case here)
@variables t x[1:2](t) # independent and dependent variables
@parameters k # parameters
Dx1 = Differential(x[1])
Dx2 = Differential(x[2])
V = 1/2*k*(x[2]- x[1])^2
Symbolics.expand_derivatives(Dx1(L))
Result should be
-k*(x[2] - x[1])
but instead you receive
0
The problem seems to stem from the Differential
@variables t x[1:2](t) # independent and dependent variables
@parameters k # parameters
Dx1 = Differential(x[1])
Dx2 = Differential(x[2])
V = 1/2*k*x[2]^2 + 1/2*x[1]^2
Symbolics.expand_derivatives(Dx1(L))
The recent Fixes #570 and #568 leaves a strange behavior for derivatives (it sounds like there are some known issues, but I wanted to document a simple case here)
Result should be
-k*(x[2] - x[1])
but instead you receive
0
The problem seems to stem from the
Differential
returns
k*x_2 + k*x_1
instead of the correct
k*x_1