bertini: Evaluate Bertini Code

Description Usage Arguments Value Examples

View source: R/bertini.r

Description

Write a Bertini file, evaluate it through a back-end connection to Bertini, and bring the output back into R.

Usage

1
bertini(code, dir = tempdir(), opts = "", quiet = TRUE)

Arguments

code

Bertini code as either a character string or function; see examples

dir

directory to place the files in, without an ending /

opts

options for bertini

quiet

show bertini output

Value

an object of class 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
## Not run: 

# where does the circle intersect the line y = x?
code <- "
INPUT

variable_group x, y;
function f, g;

f = x^2 + y^2 - 1;
g = y - x;

END;
"
bertini(code)

c(sqrt(2)/2, sqrt(2)/2)




# where do the surfaces
#  x^2 - y^2 - z^2 - 1/2
#  x^2 + y^2 + z^2 - 9
#  x^2/4 + y^2/4 - z^2
# intersect?
#
code <- "
INPUT

variable_group x, y, z;
function f, g, h;

f = x^2 - y^2 - z^2 - 1/2;
g = x^2 + y^2 + z^2 - 9;
h = x^2/4 + y^2/4 - z^2;

END;
"
bertini(code)

# algebraic solution :
c(sqrt(19)/2, 7/(2*sqrt(5)), 3/sqrt(5)) # +/- each ordinate




# example from bertini manual
code <- "
INPUT

variable_group x, y;
function f, g;

f = x^2 - 1;
g = x + y - 1;

END;
"
out <- bertini(code)
summary(out)





# non zero-dimensional example
code <- "
CONFIG
  TRACKTYPE: 1;
END;

INPUT
  variable_group x, y, z;
  function f1, f2;
  f1 = x^2-y;
  f2 = x^3-z;
END;
"
out <- bertini(code)
# bertini(code, quiet = FALSE) # print broken here

















## End(Not run)

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

Related to bertini in algstat...