Shock Wave Scope

This project was developed in January, 2011 as result of my interests in Physics. It is absolutely my own work.


Get it

General

This application generates a running waves real-time simulation based on advanced physical models (the harmonic oscillator model). Then these waves are drawn on the screen.

Using multiple threads, the wave logic and the manipulation of the graphical user interface (GUI) is divided. This provides real-time full control over the parameters of the wave.

Introduction

The harmonic oscillator could be met almost everywhere. Using it, we could describe the oscillations of a body hanging on a spring, the oscillations of charges in an AC voltage circuit, the oscillations of the pitchfork, the light itself. Many spheres of the human knowledge – physics, chemistry, biology – could use this model in their theoretical explanation. We can use this application to simulate to understand what means this abstract model. The engine could be easily extended to simulate even more complex wave generators.

Process

An important moment is that the application uses a separate thread to draw the waves. The other thread is used to set the parameters of the wave generator at real time. The process repeats simple steps in a period about 50ms, which makes the simulation. The steps are as follows:

  1. Initialization of an array of particles, which stores the coordinates which should be drawn.
  2. Calculation of the displacement of the particles, using the model of the selected wave type.
  3. Drawing of the particles on the screen

Settings

The oscillation simulation could be regulated using the settings:

  • Amplitude: 0px to 150px
  • Frequency: 0.00Hz to 10.00Hz
  • Wave Speed: 0px/s to 1000px/s
  • Duty Cycle (Rectangle Waves only!): 0% to 100%
  • Signal type: Sine, Triangle, Rectangle
  • Draw mode: lines, dots, squares, xes, hidden