realRankBoundary(n,i)
Define ${\mathcal{R}}_{n,i}$ as the interior of the set $\{F\in Sym^n(\mathbb{R}^2) : realrank(F) = i\}$. Then ${\mathcal{R}}_{n,i}$ is a semialgebraic set which is nonempty exactly when $(n+1)/2 \leq i\leq n$ (in this case we say that $i$ is a typical rank); see the paper by G. Blekherman  Typical real ranks of binary forms  Found. Comput. Math. 15, 793798, 2015. The topological boundary $\partial({\mathcal{R}}_{n,i})$ is the settheoretic difference of the closure of ${\mathcal{R}}_{n,i}$ minus the interior of the closure of ${\mathcal{R}}_{n,i}$. In the range $(n+1)/2 \leq i\leq n1$, it is a semialgebraic set of pure codimension one. The (real) algebraic boundary $\partial_{alg}({\mathcal{R}}_{n,i})$ is defined as the Zariski closure of the topological boundary $\partial({\mathcal{R}}_{n,i})$. This is viewed as a hypersurface in $\mathbb{P}(Sym^n(\mathbb{R}^2))$ and the method returns its irreducible components over $\mathbb{C}$.
In the case $i = n$, the algebraic boundary $\partial_{alg}({\mathcal{R}}_{n,n})$ is the discriminant hypersurface; see the paper by A. Causa and R. Re  On the maximum rank of a real binary form  Ann. Mat. Pura Appl. 190, 5559, 2011; see also the paper by P. Comon, G. Ottaviani  On the typical rank of real binary forms  Linear Multilinear Algebra 60, 657667, 2012.


In the opposite extreme case, $i = ceiling((n+1)/2)$, the algebraic boundary $\partial_{alg}({\mathcal{R}}_{n,i})$ has been described in the paper by H. Lee and B. Sturmfels  Duality of multiple root loci  J. Algebra 446, 499526, 2016. It is irreducible if $n$ is odd, and has two irreducible components if $n$ is even.





In the next example, we compute the irreducible components of the algebraic boundaries $\partial_{alg}({\mathcal{R}}_{7,5})$ and $\partial_{alg}({\mathcal{R}}_{7,6})$.








The object realRankBoundary is a method function with options.