Skip to content

Numerical Examples

Torbjørn Cunis edited this page Apr 25, 2025 · 4 revisions

Nonnegativity of scalar polynomial

With sossol, CaΣoS can verify nonnegativity of a polynomial. Consider for example

$$ f(x) = x^4 + 10x. $$

For which $\gamma>0$ is $f(x)+\gamma$ nonnegative? This can be checked using polynomial optimization:

% Polynomial optimization.

% indeterminate variable
x = casos.Indeterminates('x');
% some polynomial
f = x^4 + 10*x;
% scalar decision variable
g = casos.PS.sym('g');

% define SOS problem:
%   min g s.t. (f + g) is SOS
sos = struct('x',g,'f',g,'g',f+g);
% constraint is scalar SOS cone
opts = struct('Kc',struct('sos',1));

% solve by relaxation to SDP
S = casos.sossol('S','sedumi',sos,opts);
% evaluate
sol = S();

fprintf('Minimum is %g.\n', full(sol.f))

Quasiconvex sum-of-squares programming

TODO: add example (ROA)

Quick links

Cite us

If you use CaΣoS, please cite us.

CaΣoS logo

Clone this wiki locally