## 4.12 `SIN`: Sinusoidal time dependent value

### 4.12.1 Syntax

`SIN` args
`SIN` offset amplitude frequency delay damping

### 4.12.2 Purpose

The component value is a sinusoidal function of time, with optional exponential decay.

### 4.12.3 Comments

For voltage and current sources, this is the same as the Spice `SIN` function, with some extensions.
It generates either a steady sinusoid, or a damped sinusoid.
If delay and damping are both zero, you get a steady sine wave at the specified frequency. Otherwise, you get a damped pulsed sine wave, starting after delay and damping out with a time constant of 1/damping.
The shape of the waveform is described by the following algorithm:

    reltime = time - _delay
    if (reltime > 0.){
      ev = _amplitude * sin(2*PI*_freq*reltime);
      if (_damping != 0.){
        ev *= exp(-reltime*_damping);
      }
      ev += _offset;
    }else{
      ev = _offset;
    }

### 4.12.4 Parameters

`Offset` = x
  DC offset. (Default = 0.)
`Amplitude` = x
  Peak amplitude. (Default = 1.)
`Frequency` = x
  Frequency, Hz. (required)
`Delay` = x
  Turn on delay, seconds. (Default = 0.)
`Damping` = x
  Damping factor, 1/seconds. (Default = 0.)