Out of memory. Type HELP MEMORY for your options


(zhangQK) #1
cvx_begin quiet
%length(y1)=19710
variable PEGU(length(y1));
variable PB(length(y1));    
variable SOC(length(y1));
% variable Tt(length(y1));
variable E(length(y1))
minimize(sum(cf*(pppp(1)*PEGU.^2+pppp(2)*PEGU+pppp(3)).*et)+ce*(SOC(1)-SOC(length(y1)))*Qb*Ueding*nb/1000);
subject to
     0.3<=SOC<=0.9;
     Pr+Pmloss<=PB+PEGU;
     0<=PEGU<=87;
    Imin*sqrt(2*E/C*nb)-R*Imin^2*nb<=PB<=E/2/R/C; 
    C/2*nb*(pp(1)*SOCf+pp(2))^2<=E<=C/2*nb*(pp(1)*SOC0+pp(2))^2;
    E(1)==C/2*nb*(pp(1)*SOC0+pp(2));
    E(length(y1))==C/2*nb*(pp(1)*SOCf+pp(2));
cvx_end

Error using reshape
Out of memory. Type HELP MEMORY for your options.

Error in cvx_sdpt3>solve (line 268)
Avec{end}{end+1} = reshape( ( str_3 * str_2 ) * reshape( At(ti,:), nt, nv * m ), nt2 * nv, m );

Error in cvxprob/solve (line 422)
[ x, status, tprec, iters, y ] = shim.solve(At, b, c, cones, quiet, prec, solv.settings, eargs{:} );

Error in cvx_end (line 87)
solve( prob );

Error in chengxu (line 46)
cvx_end

What should I do? Is the length(y1) (length(y1)=19710) too large?
Thank you.


(Mark L. Stone) #2

Sis you try another solver? Can you start with a smaller size problem and see how much memory it takes?

An option which I have mixed feeling about recommending it to install CVX 3.0beta and uses SCS, which is a first order solver, and so should require less memory than second order solvers. However, CVX 3.0beta is very buggy, so it may not work at all, or even it claims to find the optimal solution, it could be wrong.


#3

It looks like building the model exhausts the memory, so switching solver would likely not help.

For models this large, I concur with Mark’s suggestion of prototyping on smaller model. Then use a native solver API for the large models. It is not uncommon that the modeling time in CVX dominates the actual solution time (by MOSEK) by several orders of magnitude.


(zhangQK) #4

Thank you Mark.I have re-ran the program by using CVX 3.0beta,but the result is as follows:
number of iterations = 30
residual of primal infeasibility
certificate (y,Z) = 7.87e-29
reldist to infeas. <= 5.04e-20
Total CPU time (secs) = 39.31
CPU time per iteration = 1.31
termination code = 1
DIMACS: 2.8e+01 0.0e+00 8.6e-01 0.0e+00 -1.0e+00 1.6e-04


Status: Infeasible
Optimal value (cvx_optval): +Inf

So I want to know why cvx_optval is ‘+Inf’ and cvx_status is ‘Infeasible’.Is that because constraints are not enough?
Thank you.


Running time of cvx problem
Running time of cvx problem
(Mark L. Stone) #5

That means the solver determined the problem is infeasible. I.e., there is no value of the CVX variabes which simultaneously satisfies all the constraints. Perhaps @Joachim_Dahl can comment on the reliability of that determination based on the displayed certificate. I will warn again though that due to the bugginess of CVX 3.0beta, it us possible that the solver was not even provided the correct constraints for the problem.


#6

Provided that CVX 3.0 solves the correct problem, I would also think that the certificate is very week. The problem is probably ill-posed, in the sense that very small changes of the data will change the solution status between feasible and infeasible.

If you rerun you problem in MOSEK and provide log-output, we can tell you more.


(zhangQK) #7

Hi,Mark.I want to know how I can install the SCS.


(Mark L. Stone) #8

https://github.com/cvxgrp/scs Then reinstall CVX 3.0beta.

But if you are able to get your program to run without running out of memory, there may be no need to. You may want to consiider following @Joachim_Dahl’s advice about trying MOSK.


(zhangQK) #9

Thank you very much.


(zhangQK) #10

Thank you,Joachim_Dahl.I have some questions when I install license for using mosek.

Installation info:
Path: G:\matlab\1\cvx
MATLAB version: 8.6 (R2015b)
OS: Windows 7 amd64 version 6.1
Java version: 1.7.0_60
Verfying CVX directory contents:
No missing files.
Preferences:
Path: C:\Users\Administrator.AB-201810261518\AppData\Roaming\MathWorks\MATLAB\cvx_prefs.mat
License host:
Username: Administrator
Host ID: d053498da2d3 (eth4)
Installed license:
No license installed.
No valid licenses found.
Click here to fill out an academic license request
for the username and first hostid listed above.

When I conduct academic license request,I meet the condition that Licenses cannot be issued for root or administrator usernames. Please use a different username.

So I want to know how I should do.
Thank you.


#11

That seems like a CVX specific issue. You will have to ask CVX support for help.