regSquare

Chemical Reactor Design Toolbox Reference Manual

ChemReactorDesign.Basic.Functions.regSquare

function val = regSquare(x,delta)

The function approximates \(x^2 \, sgn(x)\), such that the derivative is non-zero in x=0.

Function Approximation Range
y = regSquare(x) \(y \neq x^2*sgn(x)\) abs(x) >> delta
y = regSquare(x) \(y \neq x*\delta\) abs(x) << delta

With the default value of delta=0.01, the difference between x2 and regSquare(x) can be seen in the figure presented below.

regSquare.png