Taking the intersection of Semialgebraic Sets for Sum of Squares Optimization

Hi,

I am trying to construct a semialgebraic set using package SumOfSquares, which involves a mixture of equality and inequality that would be easier to describe by a for loop. Is there an easy way for me to take the intersection of semialgebraic sets and algebraic sets?

For example, I’d like to achieve the following

using JuMP
using DynamicPolynomials
using SumOfSquares

@polyvar x y

S1 = @set x^2 - x == 0
S2 = @set x + y <= 1

intersect!(S1, S2)

Many thanks in advance!

Hi @Xifan_Yu welcome to the forum.

This is a question for @blegat

Welcome to the forum. We could implement intersect!, PR welcome ! (see this issue.
In the meantime, you can use algebraic_set and basic_semialgebraic_set functions to create these sets programmatically.
I just added explanation in the README

2 Likes

Thank you very much for the help! This is exactly what I need.