Skip to content

DampedHarmonic

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/dot/blob/main/js/DampedHarmonic.ts for the most up-to-date information.

Overview

Solves for a specific solution of a damped harmonic oscillator (https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator), given the initial value and derivative.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class DampedHarmonic

import { DampedHarmonic } from 'scenerystack/dot';

Constructor

new DampedHarmonic( a : number, b : number, c : number, initialValue : number, initialDerivative : number )

Instance Methods

getValue( t : number ) : number

Returns the value of x(t) determined by the differential equation and initial conditions.

getDerivative( t : number ) : number

Returns the value of x'(t) determined by the differential equation and initial conditions.

Source Code

See the source for DampedHarmonic.ts in the dot repository.