density

Density of uniform distribution

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Syntax

Uniform.density(u, u_min=0, u_max=1);

Description

This function computes the probability density function according to a uniform distribution in a band. Plot of the function:

For more details, see Wikipedia.

Example

  density(0.5)    // = 1
  density(0,-1,1) // = 0.5

See also

Uniform.cumulative, Uniform.quantile.

Syntax

y = density(u, u_min, u_max)

Inputs (3)

u

Type: Real

Description: Random number over the real axis (-inf < u < inf)

u_min

Default Value: 0

Type: Real

Description: Lower limit of u

u_max

Default Value: 1

Type: Real

Description: Upper limit of u

Outputs (1)

y

Type: Real

Description: Density of u