log

log overloads the natural logarithm. In addition to the natural logarithm, YALMIP also overloads log2 and log10.

Logarithms easily causes numerical issues in nonlinear solvers, so to avoid some problems YALMIP also has a special construction \( \log(1+x)\) (shifted log) which automatically is extracted from models.

YALMIP automatically detects so called perspective logarithms \(x\log(y/x)\) and entropy \(-x\log(x)\)

Syntax

y = log(x)
y = log2(x)
y = log10(x)
y = slog(x) % Shifted log, typically not used manually
y = log(1+x)
y = log(1+x)

Comments

Logarithmic functions are implemented as convexity aware callback operators, except when Mosek 9, SCS or ECOS are used and the exponential cone description is exploited in a graph representation.