Expressions and Dampening wave

Is there a way to do this with an expression or even a python script?(see attached image)
I am trying to figure out some sort of ‘controlled dynamic’ that overshoots the original path of action.
Ultimately i would like to be able to control the Amplitude of reaction, the frequency and the exponential dampening , im not quite sure what to look for.


http://postimg.org/image/xhwvilbw1/

This waveform is pretty characteristic of a Proportional Integral Differential controller. If you google around you’ll see that’s a basic, history-retaining controller that adjusts a value based on a weighted combination of ‘match a target value’, ‘how far am i away from the target value’ and ‘am I getting close to the target value fast or slow’

Unfortunately I don’t have a Maya example right now, but here’s a Unity one which shows a simple example:
https://gist.github.com/theodox/3c956ccffd3d5d060b15.js

You can ignore the Unity stuff and just look at the PIDController class at the bottom, which takes a target value and tries to get there on every update (where ‘e’ is the amount of ‘error’ – ie, how far off from the target value the controller is).

I have a longer writeup somewhere in the form of a half-finised blog post, I can dig it up if this isn’t enough to go on.