Skip to content

Double oscillator ​

  • 4 state
  • 1 control
  • Lagrange cost
  • fixed final time
  • 1 control box
  • 2 boundary
  • OptimalControl valid
  • OptimalControl, scalarized valid
  • JuMP valid
  • ModelingToolkit valid

The Double Oscillator problem is a benchmark in constrained optimal control illustrating the control of coupled mechanical systems with damping and stiffness effects. It consists of two masses connected by springs and a damper, with one mass directly influenced by an external periodic force and the other influenced indirectly through the coupling and a controlled damping term. Both the state trajectory   and the control   are decision variables. The aim is to minimise a quadratic cost that balances state deviations and control effort, subject to input constraints and the system dynamics.

Mathematical formulation ​

The problem can be stated as

where   is a prescribed periodic forcing term.

Qualitative behaviour ​

  • The system exhibits coupled oscillatory dynamics due to interaction between the two masses through springs and damper.

  • The control input modulates the damping of the second mass, affecting the amplitude and phase of oscillations.

  • The quadratic cost penalises both deviations of the masses and the control effort, balancing tracking and energy usage.

  • Optimal trajectories often exhibit bang–bang behaviour on , consistent with theoretical results for mechanical oscillators under bounded control.

Characteristics ​

  • Coupled linear–nonlinear dynamics with external periodic forcing.

  • Control input enters through a damping term, introducing nonlinearity in the system response.

  • Widely used to benchmark numerical methods for constrained optimal control in mechanical systems.

  • Serves as a testbed for averaging methods and bang–bang control design.

References ​

  • Coudurier, C., Lepreux, O., & Petit, N. (2018). Optimal bang-bang control of a mechanical double oscillator using averaging methods. IFAC-PapersOnLine, 51(2), 49–54. Investigates bang-bang control strategies for the double oscillator system using averaging methods to analyse optimal trajectories.

  • Graichen, K., & Petit, N. (2009). Incorporating a class of constraints into the dynamics of optimal control problems. Optim. Control Appl. Methods, 30(5), 397–415. Explores methods for integrating constraints directly into the dynamics of optimal control problems, relevant to double oscillator systems with constrained damping.

  • Petit, N. (2018). MathMod 2018: Examples on coupled mechanical systems and damping control. PDF Provides practical examples on coupled mechanical systems, including double oscillators, focusing on damping control and optimal control formulation.

Parameters ​

ParameterDefault valueUnitMeaning
t00sinitial time
tf6.283185307179586sfinal time, one period of the force F
m1100kgmass of the first body, driven by the force F
m22kgmass of the second body, damped by the control
c0.5N·s/mdamping coefficient of the second body
k1100N/mstiffness of the spring between the first body and the frame
k23N/mstiffness of the spring between the two bodies
u_l-1–lower bound of the control u
u_u1–upper bound of the control u
x₁_t00minitial position x₁ of the first body
x₂_t00minitial position x₂ of the second body

Every modeling takes other values with the keyword parameters, merged with these: double_oscillator(backend; parameters=(t0=…,)).

Reference objective ​

The best objective among the solves that converged, in each modeling, on the default grid of the modeling: the modelings are independent, each has its own reference. See how the references are computed.

ModelingSchemeGridReference objectiveSolvesDistinct solutionsConfigurations agree
JuMP:trapeze5000.000910923033281yes, within 6.2e-12
OptimalControl:trapeze5000.0009109230332181yes, within 6.2e-12
OptimalControl, scalarized:trapeze5000.000910923033231yes, within 0