Hi, I am new to Julia and am trying to tackle a non linear 2nd order coupled DE. The differential equations are given below.
In particular I am having trouble with the first term on the RHS of the last equation (the one with the theta double dot). The first 2 equations are separable in the double derivatives, but the last one is not.
I have tried the DifferentialEquations.jl package by itself (converting the problem into first order) and have solved it, but I rather liked the ModelingToolkit package and was wondering if there was a way to solve this using that.
MWE:
eqns = [∂(∂(θ)) ~ -1*(mgθ + m₂gϕ + k*(θ - ϕ)r)/(m₁l₁)
∂(∂(ϕ)) ~ ((1+μ)gθ + (k/m₁)(θ - ϕ)r + (μ - 1)gϕ - 2∂(ϕ)∂(r))/(l₂+r)
∂(∂(r)) ~ - wr + l₁∂(θ)^2 + l₂∂(ϕ)^2 + 0.5gϕ^2 + l₁(θ - ϕ)*∂(∂(θ))]@named system = ODESystem(eqns)
model = ode_order_lowering(system)
(Please note that I have defined m = m_1 + m_2 and \mu = m_2/m_1)
I used ode_order_lowering on my initial system, but this converts the problematic term to \theta_{tt}(t), which runs into this error: UndefVarError: θˍtt not defined
If I do not use the order lowering technique, then the error that crops up is this:
InvalidSystemException: The derivative variable must be isolated to the left-hand side of the equation like Differential(t)(r(t)) ~ ...
. You may want to use structural_simplify
or the DAE form.
I have tried defining a new variable U(t) by myself and setting it to d\theta, but to no avail, the error message tells me that \theta is not unique.
Any help would be appreciated. Thanks in advance!