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

Settings for BigFloat #105

Open
maxchendt opened this issue Dec 3, 2022 · 1 comment
Open

Settings for BigFloat #105

maxchendt opened this issue Dec 3, 2022 · 1 comment

Comments

@maxchendt
Copy link

using Clarabel
CSf = Clarabel.Settings()
CSb = Clarabel.Settings{BigFloat}()
println(CSf.tol_feas,"\n" ,CSb.tol_feas) 

It seems that the Settings for BigFloat are the same as those (tolerances etc) of Float64.

What sets of settings for BigFloat do you recommend? We need a stringent one as we have more digits involved

@goulart-paul
Copy link
Member

You are correct that the solver uses the same default settings regardless of the precision of the underlying data type. It is difficult to give numbers that will work in all cases, particularly given that the Julia BigFloat has user-definable precision.

That said, I can at least make some suggestions. All of the parameters are listed here: https://oxfordcontrol.github.io/ClarabelDocs/stable/api_settings/

As a starting point, I would suggest setting all of the parameters with names like tol_* to some tighter tolerance. What that would be is up to you of course, but maybe start with 10^-12 in the absence of any other information. The only one you may wish to leave the same would be tol_ktratio, which could either stay at 10^-7, or at least kept at a lower tolerance than the others.

A similar comment should hold for the reduced_tol_* parameter set. Those are only used when the solver can't reach the desired precision anyway, but probably reasonably to set them to something like 10*(sqrt(X)), where X is whatever you have for used the full accuracy settings. I suggest that only because it is roughly what we have there already.

I would start like that. If you don't get good convergence, the next tolerance to tighten would be iterative_refinement_reltol and iterative_refinement_abstol. Make this something like X*1e-4, i.e. try to maintain the same relative sizes as in the default settings.

Unless you get really weird behaviour for your problem, or your problem is very badly scaled or something, I would be inclined to leave everything else as it is.

You didn't ask this, but for anyone finding this in the future: for Float32 types, a reasonable starting point would be to take the square root of the default values for all parameters named above, leaving everything else unchanged.

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