Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in 3D prism volume computation? #27

Closed
arbenede opened this issue Jun 12, 2019 · 2 comments
Closed

Error in 3D prism volume computation? #27

arbenede opened this issue Jun 12, 2019 · 2 comments

Comments

@arbenede
Copy link

I am trying to compute the volume of a simple 3D prism using vol (the .ine file is below). I know that the volume of the prism is approximately equal to 0.0118 (area of the polygonal base X height=1). I have run vol from the latest development branch with different values of the error tolerance:

$ ./vol --file1 prism.ine -e 0.1
Reading input from file...
Experiment 1 
3 8 1 -1 0.1 [-0.9,-1.1] 131833 10 0.02023386 [0.02023386,0.02023386] 0 1.020234 0 0.419022 0 
$ ./vol --file1 prism.ine -e 0.2
Reading input from file...
Experiment 1 
3 8 1 -1 0.2 [-0.8,-1.2] 32958 10 0.02025999 [0.02025999,0.02025999] 0 1.02026 0 0.129329 0 
$ ./vol --file1 prism.ine -e 0.01
Reading input from file...
Experiment 1 
3 8 1 -1 0.01 [-0.99,-1.01] 13183347 10 0.02038337 [0.02038337,0.02038337] 0 1.020383 0 44.884 0 

and from these runs it seems that the volume computed by vol might be off by a factor 2. Or is vol computing something different, like a signed volume?

H-representation
begin
8 4 real
0.008509755085097572 0.10187124277134102 0.08149699421707308 -0.0
0.008509755085097572 -0.10187124277134102 -0.08149699421707308 -0.0
0.013491075134910584 -0.05780634428435466 0.15375492457251516 -0.0
0.013491075134910584 0.05780634428435466 -0.15375492457251516 -0.0
0.015359070153590594 -0.15967758705569568 0.07225793035544206 -0.0
0.015359070153590596 0.15967758705569568 -0.07225793035544209 -0.0
0.5 -0.0 -0.0 -1.0
0.5 -0.0 -0.0 1.0
end


@arbenede arbenede changed the title Error in 3D prism volume computation Error in 3D prism volume computation? Jun 12, 2019
@arbenede
Copy link
Author

I made a few more tests:

  1. I run the same problem with the MATLAB code by Cousins and Vempala, obtaining a very similar value for the volume (0.0204) (???)
  2. I ran vol only on the base of the prism, getting as expected the same value (height=1)
  3. I ran vol in sampling mode on the base of the prism and verified that it is sampling correctly (at least in this 2D subproblem)
  4. I have re-scaled all the coordinates (this is easy to do since the base of the prism is the Voronoi cell of a lattice centered at the origin and the prism extends symmetrically in the Z dimension). The estimated volumes scales expected but the result is still off by a factor of 2.

It looks like sampling is working, so maybe there is some problem with the rounding/sandwiching steps of the algorithms?

@vissarion
Copy link
Member

You probably computed the exact volume incorrectly or you have some typo in you input file. Using vinci with your ine file I computed 2.037424855427e-02 with is pretty close to the numbers you computed above with our package. So if you agree I am closing the issue.

vissarion added a commit that referenced this issue Jul 20, 2021
* remove loadSdpaFormatFile function

* update the description file and the news_md file

* Make load_sdpa_format_file internal (#27)

* update the Rd files and the namespace

* update the description file

Co-authored-by: Vissarion Fisikopoulos <fisikop@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants