A transformming ln in cvx

Uncategorized
Jul 19, 2024
F

How i write this code in cvx:
ln(a/xb_a/b)

M

You haven’t told is what are the CVX (optimization) variables. and what is the input data. In order to be enterable into CVX, it then needs to be either jointly convex or jointly concave in the CVX variables.

F
Replying to #2

X is variable; a,b is constant parameters

M

Please write it out clearly, using preformatted text icon, with all multiplication signs, and parameter and variable names exactly matching your description. There is nothing in your description called b_a or xb_a

M
cvx_begin
    variable a
    variable b
    variable x
    
    expression y
    y = log(a/(x * b^(a/b)))
    
    % Continue with your optimization problem here
    
cvx_end

M

@madonna33 That program violates multiple CVX rules. Moreover, it doesn’t correspond to any interpretation as to what the OP’s expression is, which is probably straightforward to express as a convex expression involving -log.