How can i get the model computed more accurately?

(wangrq) #1

The important code is listed here:

cvx_begin sdp
cvx_solver mosek
cvx_precision best
variable G(48,48) hermitian ;
dual variables y{262}
E_ph= 0.5+0.5*(trace(G’*H_1))/4.0/P_pass;
maximize( E_ph)
subject to
G >= 0;
for k=1:262,
trace(G’*matcell{k}) == vecb(k) : y{k};
end

cvx_end
Now,i wang to compute this problem more accurately,But nomattaer how I adjust the options of “cvx_precison”, it always give me a tolrence of “1e-8”

(Mark L. Stone) #2

You can use cvx_solver_settings http://cvxr.com/cvx/doc/solver.html#advanced-solver-settings to set Mosek parameters listed at https://docs.mosek.com/9.0/toolbox/parameters.html exactly as you want. Whether a tighter tolerance can actually be achieved ion your problem s a matter I won’t address.

(wangrq) #3

Thanks ,Do you mean that I can change the value of “cvx_percison”,Now,I have changed it to “best”,but ,it can not be computed accurately

(wangrq) #4

cvx of matlab just give me several options of tolerance: cvx_percision: best ,high,medium,default

(Mark L. Stone) #6

I mean, don’t try to use cvx_precision. Instead, directly set the Mosek parameters you want to the values you want, using cvx_solver_settings. This gives you the best control. However, if you set the Mosek parameters to “unreasonable” values, things may not work out as you hope.

(wangrq) #7

okay,Thank you very much

(wangrq) #8

This is a sentence from cvx_manual:“Upon solution of your model, the tolerance level the solver has achieved is returned in the cvx_slvtol variable. Attempts to interpret this tolerance level in any absolute sense are not recommended. For one thing, each solver computes it differently. For another, it depends heavily on the considerable transformations that CVX applies to your model before delivering it to the solver.”
when I compute my model ,i often get a cvx_slvtol ,its value is about 1e-8,Does it mean that the finally result i get is computed in a accuraty of 1e-8?

(Mark L. Stone) #9

I believe that is the “accuracy” (optimality tolerance) of the transformed problem which CVX sent to the solver. That might not be the accuracy of the problem as you entered it into CVX, becasuse CVX transforms the problem before sending it to the solver… If you need to directly control accuracy for your problem, you may have to use a (more) direct, but perhaps less user-friendly interface to the solver

If you want more specific guidance about tolerances in Mosek, i suggest you ask at https://groups.google.com/forum/#!forum/mosek .