dd_cos

Raised-cosine distribution


Syntax

info = dd_cos()
P = dd_cos(r,param)
Parameters
  • r - Distance axis (N-array), in nanometers
  • param - Model parameters
Returns
  • P - Distance distribution (N-array)
  • info - Model information (struct)

Model

This provides a raised-cosine distribution, defined by P(r) = \frac{1}{2w}\cos\left(\frac{r-r_0}{w}\pi\right) for r_0-w \le r \le r_0+w, and zero otherwise.

Variable Symbol Default Lower bound Upper bound Description
param(1) r_0 3.0 0.1 20 center, in nm
param(2) w 0.5 0.1 5 fwhm, in nm

Example using default parameters:

../_images/model_dd_cos.png

Description

info = dd_cos()

Returns an info structure containing the specifics of the model:

  • info.model - Full name of the parametric model.
  • info.nparam - Total number of adjustable parameters.
  • info.parameters - Structure array with information on individual parameters.

P = dd_cos(r,[3 0.5]])

Computes the distance distribution model P from the axis r according to the parameters array param. The required parameters can also be found in the info structure.