bertiniteam / b2

Bertini 2.0: The redevelopment of Bertini in C++.
88 stars 34 forks source link

Failing to solve simple polynomial equation #163

Closed derandomization closed 2 years ago

derandomization commented 2 years ago

Hello again, I am now trying to solve simple examples before putting my real input, to learn the right settings.

Currently I copied the settings from https://doc.bertini2.org/pybertini/tutorials/tracking_nonsingular.html

I have kept it exactly the same except for changing the equation to be: f = x^2+y^2-1 g = x^2 -y^2

Once I do this, the program fails (result is empty) and tracking shows it goes off to infinity. I thought this is maybe because (0,0) is singular so I tried g= x^2-y^2+x, but this still happens.

(My attempted usage of the program is to find ALL solutions of a set of polynomial equations; now I see in usage that tracker seems to take an initial point, how do you recommend I do that?)

Thank you!!

derandomization commented 2 years ago

Also, if I get desperate, how do I use the C version (the core that is)? On the website ( https://bertini.nd.edu/download.html ) they say to run ./bertini but I only have compiled C files I think (In the documentation the sentence no useful executable is available appears, which suggests what I'm asking is impossible but I'm not sure)

derandomization commented 2 years ago

Also python doesn't work well with floats, how do you recommend handling it?

For my short term current needs after rethinking GeoGebra does the trick, it plots and intersects two curves for me, but I'd love to be able to use Bertini since it'd help a lot with checking conjectures.

ofloveandhate commented 2 years ago

I don't think I can properly train you to formulate start systems and do the tracking routines in B2. I think you'll do much better with either Bertini 1 or another program.

For Bertini 1, did you compile and then make install? That should produce a symlink in /usr/local/bin or in whatever you set prefix / DESTDIR.

ofloveandhate commented 2 years ago

Floats are a poor choice for formulating your system. Prefer exact expressions that generate the floats you're using to approximate them when working with adaptive-precision software like B1 and B2. Bertini 1 will readily accept any floats you give to it (and turn them into rational numbers), while Bertini 2 makes it harder. I think you should use Bertini 1.

ofloveandhate commented 2 years ago

I think that geogebra will do fine for some simple systems, but I bet it struggles with singular, near-singular, or high-degree systems. It's also severely limited in the number of variables you can use. I don't know what kind of problems you're hoping to solve, but B1 is very competent at a variety of challenging numerical problems.

If you're looking for exact solutions, which it doesn't sound like since you asked about using floats, there are a number of routines available in Singular and Macaulay 2 which may also prove useful.

derandomization commented 2 years ago

@ofloveandhate Thank you for all your comments.

In /usr/local/bin I only have bertini2 (And not bertini1), am I correct to assume that the core is bertini1 (so they are the same), and the changes are in the pythonwrap? If this is wrong- is a way to download it via git (it is safer than downloading from the site directly).

If I am correct (And I feel like such an idiot asking I'm so sorry), then anytime I type bertini2 it opens an information about the developers, even when I make an input file (as described here https://bertini.nd.edu/book.html ) and type bertini2 inputfile (it just prints

` [10/1889] Bertini(TM) 2 The Bertini Trademark is owned by D.J. Bates, S. Amethyst, J.D. Hauenstein, A.J. Sommese, C.W. Wampler The code is primarily authored by S. Amethyst, J. Collins, T. Hodges
Source available online at http://github.com/bertiniteam/b2

Wiki online at https://github.com/bertiniteam/b2/wiki

This is version 2.0-alpha6 Bertini2 is GPL3 Free/Libre Open Source Software, please contribute!`

Am I missing something stupid? Is the usage of bertini2 different than the one on the site?

Thank you!

ofloveandhate commented 2 years ago

Is the usage of bertini2 different than the one on the site?

Yes. The Bertini 2 core is distinct from Bertini 1, and do not provide identical functionality, despite aspirations to make it so.

You should just use Bertini 1. It will do what you want, as described in the bertini book's input file description. I can help you build it from source if you need (in a different thread, please, as that would be significantly off-topic). If you succeeded at building bertini 2, you probably already have all the tools you need installed, maybe except flex and bison.

derandomization commented 2 years ago

Okay, thank you :)