I'm working on an ODE system, and using the function Symbolics.expand_derivatives. This works fine when the system does not include rational equations. However, when the system is like:
using DifferentialEquations
using Symbolics
# create the differentiation equations
function derivat(e, H)
tmp = e
for h in 1:H
for i in 1:length(tmp)
println(D(tmp[i].rhs))
println()
tmp[i] = D(tmp[i].lhs) ~ Symbolics.expand_derivatives(D(tmp[i].rhs))
end
end
return eq
end
@parameters t k1 k2 k3 k4
@variables r(t) w(t)
D = Differential(t)
eqs = [D(r) ~ k1*r*w/(k2+w) - k3*r,
D(w) ~ (-k1/k4)*(k1*r*w/(k2+w))]
h = 4
eq1 = derivat(eqs, h)
Really don't know what happens here, Hope this can be solved.
I'm working on an ODE system, and using the function Symbolics.expand_derivatives. This works fine when the system does not include rational equations. However, when the system is like:
Symbolics.expand_derivatives only works when differentiation is under 3rd derivatives. When the order is higher, like 4. It returns the error:
The problematic equation is:
The code I use to generate the derivatives is:
Really don't know what happens here, Hope this can be solved.