Periodic solution to a forced oscillator ODE

I’m working with an ODE model. I’m looking for the periodic solution to a forced, non-conservative, non-linear and time-invariant oscillator.

For example, something like x''(t) = - k (x(t) + 0.1 x^3(t)) - a x'(t) + A sin(w t)

I was able to work with my model using DifferentialEquations: ODEProblem, solve. I can add a generic forced input function, simulate it and even fit the model using least-squares, what is super awesome. How can I enforce the periodic solution constraint, though? Are there any special methods I should be looking into, and are they available in Julia?

Caveats:

  • I’m assuming a drag term and forced input are sufficient conditions to one periodic solution of the same frequency. Perhaps more solutions are possible with strong non-linearities, in which case I’m happy obtaining just something close to an initial guess. I’m expecting I can set the model parameters, including the amplitude and frequency, and I’ll obtain different waveshapes for the solution as I play around with the values.
  • I’d love to find closed formula solutions but I wouldn’t be surprised to learn that’s impossible, and I’m happy obtaining just numerical solutions.
  • I have a feeling there must be some major theory I’m ignoring about solving this kind of problem and I’d love to hear any insights.
1 Like

For me, I would use spectral expansion in the time direction, and then it’s turned into a set of algebraic equations.

Do you mean I should just represent the solution as vectors (I actually have two variables), and treat it as a Taylor or Fourier series? Sounds good to me, how would I proceed to compute a solution then?

My non-linearities can be a little more complicated that just x^3, how can that interefere with this approach? And I guess my main question might be: can I actually approach this with some custom method, just solving a big non-linear system for instance, and not really relying on DifferentialEquations.jl at all?

BVProblem, since that’s a boundary value problem.

That can work in this specific case but it’s not generally stable.

That’s what a BVP solver will do, the MIRK methods in BoundaryValueDiffEq, plus a bit of adaptivity.

Of course Fourier expansion, which means your periodic constraints are automatically satisfied. I usually use Mathematica’s FindRoot to do that, no need to use DifferentialEquations.jl

1 Like

BifurcationKit is precisely done for this. Check 🟠 Periodic predator-prey model · Bifurcation Analysis in Julia

4 Likes

All right, I totally overlooked the BVP section. It seems to work fine. Thank you!

Cool, I’ll take a look at it. This forced example seems to be exactly what I needed. Am I correct to say it is required for the equations not to be dependent on time, that’s why you need these u and v variables to produce the sinusoid?

You are correct. This will be changed in the near future

1 Like

Does GitHub - NonlinearOscillations/HarmonicBalance.jl: A Julia package for solving nonlinear differential equations using the harmonic balance method. help here?

3 Likes

This looks very interesting, definitely will study in more detail, thanks!