Learn R Programming

Sim.DiffProc (version 2.5)

Sharosc: Stochastic harmonic oscillator

Description

The simulation shows the oscillations of a mass suspended from a spring. The graphs show the time evolution and the phase portrait.

Usage

Sharosc(N, T, x0, v0, lambda, omega, sigma, Step = FALSE, Output = FALSE)

Arguments

N
size of process.
T
final time.
x0
Initial conditions, position (mm).
v0
Initial conditions, speed (mm/s).
lambda
Amortization (1/s).
omega
Angular frequency (rad/s).
sigma
Dark random excitation.
Step
if Step = TRUE ploting step by step.
Output
If Output = yes write a output to an Excel (.csv).

Value

  • data.frame(time,X(t)), plot of process X(t) in the phase portrait (2D) and temporal evolution of stochastic harmonic oscillator.

Details

Cursors used to vary the parameters of the oscillator (the damping lambda and natural frequency omega) and the initial conditions (position and velocity). To vary lambda and omega, sigma and observe the different regimes of the oscillator (pseudo-periodic, critical, supercritical). Stochastic perturbations of the harmonic oscillator equation, and random excitations force of such systems by White noise e(t), with delta-type correlation functions E(e(t)e(t+h))=sigma*deltat(h): $$x'' + 2*lambda*x' +omega^2 *x = e(t)$$ where lambda,sigma >= 0 and omega > 0.

References

Fima C Klebaner. Introduction to stochastic calculus with application (Second Edition), Imperial College Press (ICP), 2005.

See Also

Spendu stochastic pendulum, Svandp stochastic Van der Pol oscillator, Srayle stochastic Rayleigh oscillator, SSCPP stochastic system with a cylindric phase plane, Sosadd stochastic oscillator with additive noise.

Examples

Run this code
## lambda = 0.1, omega = 1.5, sigma = 2.
 Sharosc(N=5000, T=50, x0=100, v0=0, lambda=0.1, omega=1.5, sigma=2)

Run the code above in your browser using DataLab