Parametric Oscillator

I sometimes ask collaborators for post ideas. At the end of our meeting this week, Prof. Mark Denavit suggested modeling a parametric oscillator in OpenSees and referred me to the following video.

OK, if you didn’t watch the video, the response of a parametric oscillator is modified by some frequency-dependent parameter of the system. In this case, the oscillator is a pendulum and the modifier is the frequency of spring vibration. If you did watch the video or read the Wikipedia page, you’ll see that pumping a playground swing is the classic example of a parametric oscillator.

Parametric resonance occurs when the frequency of the modifier is twice the natural frequency of the oscillator, i.e., when the natural frequency of the spring is twice the frequency of the pendulum.

A mass and a spring? No problem for OpenSees. But the displacements are too large, and the redundancy too low, for structural engineering comfort. Never deterred, a corotational truss model should fit the bill.

As you might recall from physics, the pendulum frequency is \omega_o=\sqrt{g/L}. In the OpenSees model shown below, the frequency of spring vibration is set to \omega=2\omega_o (to approximate the resonance condition), from which the spring stiffness is calculated as k=m\omega^2. In this way, the value of mass is not important for the model.

inch = 1.0
lb = 1.0
sec = 1.0

g = 386.4*inch/sec**2

# Length of pendulum
L = 10*inch

# Pendulum mass and weight
m = 1.0
W = m*g

# Frequency of pendulum
omega = (g/L)**0.5

# Frequency of oscillator
w = 2*omega

# Stiffness of spring
k = m*w**2

import openseespy.opensees as ops


ops.node(1,0,L); ops.fix(1,1,1)
ops.node(2,0,0); ops.mass(2,m,m)


# Initial displacements

# Pendulum weight



Tmax = 12*sec
dt = 0.01*sec
Nsteps = int(Tmax/dt)

Imposing initial conditions of a small horizontal displacement and a vertical displacement that stretches the spring by 1/3 of its deformed length under self-weight gives the response history shown below.

The spring oscillation drives the pendulum motion, i.e., the peaks of the X displacement response far exceed the magnitude of the initial X displacement.

And here is an animation, based on this tutorial for creating animated GIFs from matplotlib.

With the Python code shown in this post, play with the model parameters and check the following scenarios.

  • Non-resonance
    Change the spring frequency to three times the pendulum frequency and impose the same initial conditions as above. The magnitude of the X displacement response will not exceed the initial condition.
  • Pure pendulum
    Set the spring frequency to ten times the pendulum frequency (making the spring very stiff) and impose initial X and Y displacements equal to the pendulum length.

It’s not rigid body dynamics, which is way harder than deformable body mechanics, but still cool that OpenSees can model this type of system.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.