Harmonic Oscillator Application

Project for Developing Data Products Coursera Course

Jason V

Overview

This application allows you to simulate a harmonic oscillator, an important physics model that is used to model many real-world processes:

  1. Masses on a spring, pendulums
  2. Vibrating objects - for instance a guitar string
  3. Electrical circuits

Model Details

The oscillator has a 'Natural Frequency' based on it's inherent properties (k and m below). It also possess a 'Damping' mechanism (B) that reduces vibration much like a shock absorber in a car. Finally, it is subjected to a 'Driving Force' (F) that pushes the oscillator with a strength and rate that can vary. This force results in displacements from equilibrium position (X).

How to use

Adjust the sliders to see the effect these variables have on the model's dynamics. You can control the Natural Frequency, Damping Amplitude, Driving Amplitude, and Driving Frequency. The plot will automatically update with your changes and show the displacement over time.

    qplot(time,displacement, xlab = "Time", ylab="Displacement",geom="line")

plot of chunk unnamed-chunk-2

How to Access