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

Issue with mesh_radiosity_problem_nbody_convex::slow convergence #782

Open
amiszuda opened this issue Sep 19, 2023 · 6 comments
Open

Issue with mesh_radiosity_problem_nbody_convex::slow convergence #782

amiszuda opened this issue Sep 19, 2023 · 6 comments
Assignees

Comments

@amiszuda
Copy link

amiszuda commented Sep 19, 2023

Hi,

When trying to compute a model of double-contact system (semidetached=True), the following error pops out:

 81%|████████████████████████████████████████████████████████████████████████████████████████▏                    | 89/110 [01:13<00:17,  1.21it/s]
TypeError: mesh_radiosity_problem_nbody_convex::slow convergence

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/amiszuda/miniconda3/envs/phoebe_tmp/lib/python3.8/site-packages/phoebe/parameters/parameters.py", line 424, in _send_if_client
    return fctn(self, *args, **kwargs)
  File "/home/amiszuda/miniconda3/envs/phoebe_tmp/lib/python3.8/site-packages/phoebe/frontend/bundle.py", line 11943, in run_compute
    ml_params = compute_class().run(self, computeparams.compute,
  File "/home/amiszuda/miniconda3/envs/phoebe_tmp/lib/python3.8/site-packages/phoebe/backend/backends.py", line 518, in run
    rpacketlists_per_worker = [self._run_chunk(**packet)]
  File "/home/amiszuda/miniconda3/envs/phoebe_tmp/lib/python3.8/site-packages/phoebe/backend/backends.py", line 576, in _run_chunk
    packetlist = self._run_single_time(b, i, time, infolist, **worker_setup_kwargs)
  File "/home/amiszuda/miniconda3/envs/phoebe_tmp/lib/python3.8/site-packages/phoebe/backend/backends.py", line 1152, in _run_single_time
    system.populate_observables(time, populate_kinds, populate_datasets)
  File "/home/amiszuda/miniconda3/envs/phoebe_tmp/lib/python3.8/site-packages/phoebe/backend/universe.py", line 315, in populate_observables
    self.handle_reflection()
  File "/home/amiszuda/miniconda3/envs/phoebe_tmp/lib/python3.8/site-packages/phoebe/backend/universe.py", line 368, in handle_reflection
    fluxes_intrins_and_refl_per_body = libphoebe.mesh_radiosity_problem_nbody_convex(vertices_per_body,
SystemError: <built-in function mesh_radiosity_problem_nbody_convex> returned a result with an error set

A working example reproducing this error may be:

import phoebe
from phoebe import u
import numpy as np

logger = phoebe.logger(clevel='ERROR')

b=phoebe.default_binary(semidetached=True)

times=np.linspace(0,4,110)
b.add_dataset('lc', times=times, dataset='lc1', intens_weighting='photon',passband='TESS:T')

b.set_value('period', component='binary', value=3.923923923923924) 
b.set_value('incl', component='binary', value=72)
b.set_value('t0_supconj', component='binary', value=2366.1)
b.set_value('ecc', value=0.03)
b.set_value('per0', value=50)

b.set_value('vgamma', value=-37.3)
b.set_value('q', value=0.375)
b.set_value('sma@binary', value=25)

b.set_value('teff', component='primary', value=25000)
b.set_value('teff', component='secondary', value=15000)
b.set_value('atm', component='primary', value='blackbody')
b.set_value('atm', component='secondary', value='blackbody')
b.set_value(qualifier='ld_mode', dataset='lc1', component='primary', value='manual')
b.set_value(qualifier='ld_mode', dataset='lc1', component='secondary', value='manual')

b.set_value('l3_mode', 'fraction')
b.set_value('l3_frac', 0.0)

b.set_value('Av', value=1.862) 
b.set_value('distance', value=2217.30688000*u.pc)

b.run_compute()

This error comes from phoebe 2.4.11 with python 3.8.18 installed on Ubuntu. Different versions of phoebe were tested to give the same output. Has anyone had similar issues? Reducing times to smaller number, e.g. 10 points works just fine.

@kecnry
Copy link
Member

kecnry commented Sep 19, 2023

Thanks for the detailed report!

It seems that it crashes at time=3.302752293577982 specifically, even if that is the only time passed (times=[times[90]])... so is likely something to do with the geometry at that specific time/configuration.

@amiszuda
Copy link
Author

Actually, it crashes at phase around 0.8. Below that phase, the model runs successfully.

@kecnry
Copy link
Member

kecnry commented Sep 19, 2023

With 110 times between 0 and 4 (with a period of ~4), I think those are the same. Can you confirm though that replacing the times in your add_dataset with times=times[90] still crashes on your end?

@amiszuda
Copy link
Author

Yes, it does crash.

@amiszuda
Copy link
Author

any luck with this one?

@kecnry
Copy link
Member

kecnry commented Oct 12, 2023

It would be helpful to be able to reproduce this with a single call to libphoebe (outside of all the bundle-logic). There is already a debugging logger output immediately before the line that crashes that should say irradiation ld_func_and_coeffs: {}".format(ld_func_and_coeffs). Can you either update that logging message to include all inputs to the libphoebe function (depending on the size of the mesh, that might be a lot of output), or maybe do a try/except and export the inputs to a separate file when it fails?

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

3 participants