Csound Csound-dev Csound-tekno Search About

Re: harmonic oscillator blues

Date1998-03-31 12:12
FromHans Timmermans
SubjectRe: harmonic oscillator blues
>This is supposed to be a mass attached to a spring:
>        _________________
>                |
>                S
>                |
>                M
>
>This little system can be described by this equation:
>
>        F + kx = 0  (Hookes law)
>
>Below is an orchestra+score that realizes the equation.
>If you pull the mass(im) it starts to swing.
>As expected, the orc produces a sine wave. Now the problem:
>the wave fades!! Even though there's now damper!!
>Now this shouldn't happen!!
>
>In the orc, there's a derivation. I put
>
>a(n)=(v(n)-v(n-1))/(t(n)-t(n-1)=(v(n)-v(n-1))

the expression: v(v)-v(n-1) introduces a low-pass filter which causes the
fading-out.
(supposed the frequency of your oscillating system is well below f-Nyquist.

>
>because (t(n)-(t(n-1)) is 1 (sample), and similar with v(n).
>What's going on here?
>

This is always the problem in simulating physical systems.
You should correct for the low-pass thing.

Good luck,

Hans Timmermans                          e-mail: hans.timmermans@kmt.hku.nl
Utrecht School of the Arts              phone: (+31) 35 6836464
dep: Music Technology                    fax: (+31) 35 6836480
senior lecturer computer music

PO-BOX 2471
1200 CL HILVERSUM
the NETHERLANDS