polySolve: Solve a System of Polynomial Equations

Description Usage Arguments Value See Also Examples

View source: R/polySolve.r

Description

polySolve solves a system of polynomial equations, specifiable in any of several ways.

Usage

1
polySolve(lhs, rhs, varOrder, ...)

Arguments

lhs

a mpolyList or character vector of left hand sides

rhs

a mpolyList or character vector of right hand sides

varOrder

variable order (see examples)

...

stuff to pass to bertini

Value

an object of class bertini

See Also

variety, bertini

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## Not run: 

# it can solve linear systems
# (here where the line y = x intersects y = 2 - x)
polySolve(c("y", "y"), c("x", "2 - x"), c("x", "y"))

# or nonlinear systems
polySolve(c("y", "y"), c("x^2", "2 - x^2"), c("x", "y"))

# perhaps an easier specification is equations themselves
# with either the " = " or " == " specifications
# varOrder is used to order the solutions returned
polySolve(c("y = x^2", "y = 2 - x^2"), varOrder = c("x", "y"))
polySolve(c("y == x^2", "y == 2 - x^2"), varOrder = c("x", "y"))


# mpoly objects can be given instead of character strings
lhs <- mp(c("y - (2 - x)", "x y"))
rhs <- mp(c("0","0"))
polySolve(lhs, rhs, varOrder = c("x", "y"))

# if no default right hand side is given, and no "=" or "==" is found,
# rhs is taken to be 0's.
# below is where the lines y = x and y = -x intersect the unit circle
polySolve(c("(y - x) (y + x)", "x^2 + y^2 - 1"))

# the output object is a bertini object
out <- polySolve(c("(y - x) (y + x)", "x^2 + y^2 - 1"))
str(out,1)

# here is the code that was run :
cat(out$bertiniCode)

# the finite and real solutions:
out$finite_solutions
out$real_finite_solutions




# example from Riccomagno (2008), p. 399
polySolve(c(
  "x (x - 2) (x - 4) (x - 3)",
  "(y - 4) (y - 2) y",
  "(y - 2) (x + y - 4)",
  "(x - 3) (x + y - 4)"
))


## End(Not run)

algstat documentation built on May 29, 2017, 10:34 p.m.

Related to polySolve in algstat...