knitr::opts_chunk$set( collapse = TRUE, comment = "#", fig.path = "tools/" )
bertini is an R package that provides methods and data structures for numerical algebraic geometry, the numerical solution to (nonlinear) systems of polynomial equations using homotopy continuation.
It is still experimental, but the core functionality in the zero-dimensional case is quite stable.
Note: the following assumes you have Bertini and bertini recognizes its path. To do this properly, see ?set_bertini_path()
.
library("bertini")
code <- " INPUT variable_group x, y; function f, g; f = x^2 + y^2 - 1; g = y - x; END; " bertini(code)
poly_solve()
is the basic workhorse for solving systems of polynomial equations. For example, if we want to solve the system $y = x$ and $x^{2} + y^{2} = 1$, which corresponds geometrically to the points where the identity line intersects the unit circle, we can use:
poly_solve(c("y = x", "x^2 + y^2 = 1"), varorder = c("x", "y"))
poly_optim()
can be used to find the critical points of polynomials over varieties. For example, if we want to find the maximum value of the function $f(x,y) = x + y$ over the unit circle:
poly_optim("x + y", "x^2 + y^2 = 1")
if (!requireNamespace("devtools")) install.packages("devtools") devtools::install_github("dkahle/mpoly") devtools::install_github("dkahle/bertini")
This material is based upon work supported by the National Science Foundation under Grant Nos. 1622449 and 1622369.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.