functionsqrtReg

Symmetric square root approximation with finite derivative in zero

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

Information

This function approximates sqrt(x)*sign(x), such that the derivative is finite and smooth in x=0.

FunctionApproximationRange
y = sqrtReg(x)y ~= sqrt(abs(x))*sign(x)abs(x) >> delta
y = sqrtReg(x)y ~= x/sqrt(delta)abs(x) << delta

With the default value of delta=0.01, the difference between sqrt(x) and sqrtReg(x) is 16% around x=0.1, 0.25% around x=0.1 and 0.0025% around x=1.

Inputs

TypeNameDefaultDescription
Realx
Realdelta0.01Range of significant deviation from sqrt(x)

Outputs

TypeNameDefaultDescription
Realy

Revisions