matlab - How to define SPARSE matrices for linear constraints? -
i solving constrained optimization problem using fmincon
solver sqp
algorithm. linear equality , inequality matrices have, rather sparse. wonder how can define following aeq
, beq
matrices in sparse form in order speed calculation?
best regards
cons1=[eye(10),-eye(10),zeros(10,5*19),-eye(10),zeros(10,280)]; cons2=[zeros(19,20),eye(19),-eye(19),zeros(19,19*2),-eye(19),zeros(19,290)]; cons3=[zeros(19,96),diag(tan_fid),zeros(19,10),-eye(19),zeros(19,261)]; cons4=[zeros(19,58),-eye(19),-eye(19),eye(19),zeros(19,290)]; % #### linear_eq=aeq*x'-beq; #### aeq=[cons1;cons2;cons3;cons4]; beq=[-pga ; -pda ;zeros(19,1); zeros(19,1)];
Comments
Post a Comment