# Contents¶

This notebook covers the pre-defined spectral models available for light curve simulation. Specifically, the notebook describes the meaning of different parameters that describe these models.

# Setup¶

Import relevant stingray libraries.

:

from stingray.simulator import simulator, models


Import pyplot from matplotlib for plotting light curves.

:

from matplotlib import pyplot as plt
%matplotlib inline


## Spectral Models¶

Currently, stingray has two spectral models namely generalized lorenzian function and smooth broken power law function. More models will be added in future.

### Generalized Lorenzian Function¶

Apart from the frequencies, the lorenzian function needs the following parameters specified.

p: iterable
p = peak centeral frequency
p = FWHM of the peak (gamma)
p = peak value at x=x0
p = power coefficient [n]


### Smooth Broken Power Law Model¶

Apart from the frequencies which need to be passed as a numpy array, smooth broken power law needs the following parameters specified.

p: iterable
p = normalization frequency
p = power law index for f --> zero
p = power law index for f --> infinity
p = break frequency


## Light Curve Simulation¶

These models can be imported while simulating lightcurve(s).

:

sim = simulator.Simulator(N=1024, mean=0.5, dt=0.125)

:

lc = sim.simulate('lorenzian', [1.5, .2, 1.2, 1.4])
plt.plot(lc.counts[1:400])

:

[<matplotlib.lines.Line2D at 0x11479cf90>] :

lc = sim.simulate('smoothbknpo', [.6, 0.9, .2, 4])
plt.plot(lc.counts[1:400])

:

[<matplotlib.lines.Line2D at 0x114941490>] 