%======================================================================= %To solve optimization problem: %Create a new subfolder in ...\PSG\MATLAB: %..\PSG\MATLAB\problem_MaxRet_Prob %Download and unpack the following zipped file from 'Data' to the created folder: %'Mat_data_problem_MaxRet_Prob.zip' %Run program 'problem_MaxRet_Prob.m' %======================================================================= clc; clear; addpath('..'); %Load data: load('.\problem_MaxRet_Prob_data.mat') %Define options for PSG solver: stroptions.Precision = 9; stroptions.Stages = 10; %Define input arguments: string2 = {'pr_pen'}; w2 = {0.02}; %Solve optimization problems: [xout, fval, status, output] = riskconstrprog([], string2, [], [], [], [], w2, H2, [], [], d, r, [], [], Aeq, beq, lb, ub, [], stroptions); %Display results: disp(' '); disp('Results: '); %Display status of optimization problem: disp(sprintf('status of optimization problem = %s', status)); %Display solving time: disp(sprintf('solving time = %g', output.solving_time)); %Display objective: disp(sprintf('objective = %g', fval)); %Display function: disp(sprintf('pr_pen= %g', output.frval2)) %Display linear component of objective: disp('linear component of objective:'); disp(output.fdval); %Display left hand sides of linear equality: disp(sprintf('linear equality = %g', output.fAeqval)); %Display residual of linear equality: disp(sprintf('residual of linear equality = %g', output.rAeqval)); %Display optimal point: disp('optimal point = '); disp(xout');