functioninverseXRegularized

Function that approximates 1/x by a twice continuously differentiable function

Extends from Modelica.Icons.Function (Icon for functions).

Information

Function that approximates y=1 ⁄ x inside the interval -δ ≤ x ≤ δ. The approximation is twice continuously differentiable with a bounded derivative on the whole real line.

See the plot of Buildings.Utilities.Math.Functions.Examples.InverseXRegularized for the graph.

For efficiency, the polynomial coefficients a, b, c, d, e, f and the inverse of the smoothing parameter deltaInv are exposed as arguments to this function. Typically, these coefficients only depend on parameters and hence can be computed once. They must be equal to their default values, otherwise the function is not twice continuously differentiable. By exposing these coefficients as function arguments, models that call this function can compute them as parameters, and assign these parameter values in the function call. This avoids that the coefficients are evaluated for each time step, as they would otherwise be if they were to be computed inside the body of the function. However, assigning the values is optional as otherwise, at the expense of efficiency, the values will be computed each time the function is invoked. See Buildings.Utilities.Math.Functions.Examples.InverseXRegularized for how to efficiently call this function.

Inputs

TypeNameDefaultDescription
RealxAbscissa value
RealdeltaAbscissa value below which approximation occurs
RealdeltaInv1/deltaInverse value of delta
Reala-15*deltaInvPolynomial coefficient
Realb119*deltaInv^2Polynomial coefficient
Realc-361*deltaInv^3Polynomial coefficient
Reald534*deltaInv^4Polynomial coefficient
Reale-380*deltaInv^5Polynomial coefficient
Realf104*deltaInv^6Polynomial coefficient

Outputs

TypeNameDefaultDescription
RealyFunction value

Revisions

  • August 10, 2015, by Michael Wetter:
    Removed dublicate entry smoothOrder = 1 and reimplmented the function so it is twice continuously differentiable. This is for issue 302.
  • February 5, 2015, by Filip Jorissen:
    Added smoothOrder = 1.
  • May 10, 2013, by Michael Wetter:
    Reformulated implementation to avoid unrequired computations.
  • April 18, 2011, by Michael Wetter:
    First implementation.