%This Example for using users m-function problem_ksmavg_cvar_equality_subroutine.m was created automatically by PSG Toolbox. %Function description: %problem_KSMavg_Cvar_equality, minimize %linearize = 1 %ksm_avg(matrix_xYi_norm_112, vector_Yi_norm, vector_qi) %constraint: = 1 %linear(matrix_sYi_112) %multiconstraint: = vector_cvars_Y, linearize = 1 %pcvar(vector_alp,matrix_xYi_norm_112) %box: >= 0, <= 1 %solver: car % % %Input variables: % %Inputs PSG Type PSG Object Location in Problem Statement Class %matrix_syi_112_data data matrix_syi_112 n/a double %matrix_syi_112_vars vars matrix_syi_112 n/a cell %matrix_xyi_norm_112_data data matrix_xyi_norm_112 n/a double %matrix_xyi_norm_112_vars vars matrix_xyi_norm_112 n/a cell %vector_qi_data data vector_qi ksm_avg(matrix_xYi_norm_112, vector_Yi_norm, vector_qi) double %vector_alp_data data vector_alp pcvar(vector_alp,matrix_xYi_norm_112) double %vector_cvars_y_data data vector_cvars_y n/a double %vector_yi_norm_data data vector_yi_norm n/a double % %Output variables: % %solution_str = string with solution of problem; %outargstruc_arr = array of output PSG data structures; %Load data from mat-file: load('D:\American Optimal Decisions\PSG\MATLAB\CS_KSM\data_problem_KSMavg_with_Cvar_equality\problem_ksmavg_cvar_equality_subroutine_data.mat') %Save variables from mat-file to Workspace: tbpsg_export_to_workspace(toolboxstruc_arr) %Run users m-function problem_ksmavg_cvar_equality_subroutine: [solution_str,outargstruc_arr] = problem_ksmavg_cvar_equality_subroutine(matrix_syi_112_data,matrix_syi_112_vars,matrix_xyi_norm_112_data,matrix_xyi_norm_112_vars,vector_qi_data,vector_alp_data,vector_cvars_y_data,vector_yi_norm_data); %Extract Objective: val_obj = tbpsg_objective(solution_str, outargstruc_arr); disp(' '); disp('Objective = '); disp(val_obj); %Extract optimal solution: point_data = tbpsg_optimal_point_data(solution_str, outargstruc_arr); disp(' '); disp('Optimal point = '); disp(point_data); %Extract structure containing PSG solution reports: output_structure = tbpsg_solution_struct(solution_str, outargstruc_arr); disp(' '); disp('Structure with PSG solution = '); disp(output_structure); %Uncomment the following lines to extract solutions details: %output = tbpsg_isoptimal(solution_str, outargstruc_arr); %output = tbpsg_function_data(solution_str, outargstruc_arr); %output = tbpsg_function_names(solution_str, outargstruc_arr); %output = tbpsg_time(solution_str, outargstruc_arr); %output = tbpsg_optimal_point_vars(solution_str, outargstruc_arr); %output = tbpsg_constraints_vars(solution_str, outargstruc_arr); %output = tbpsg_slack_data(solution_str, outargstruc_arr); %output = tbpsg_dual_data(solution_str, outargstruc_arr); %output = tbpsg_vector_constraint_data(solution_str, outargstruc_arr); %output = tbpsg_vector_dual_data(solution_str, outargstruc_arr); %output = tbpsg_vector_slack_data(solution_str, outargstruc_arr); %output = tbpsg_matrix_data(solution_str, outargstruc_arr); %output = tbpsg_matrix_vars(solution_str, outargstruc_arr); %output = tbpsg_vector_data(solution_str, outargstruc_arr); %=======================================================================| %American Optimal Decisions, Inc. Copyright | %Copyright ©American Optimal Decisions, Inc. 2007-2017. | %American Optimal Decisions (AOD) retains copyrights to this material. | % | %Permission to reproduce this document and to prepare derivative works | %from this document for internal use is granted, provided the copyright | %and “No Warranty” statements are included with all reproductions | %and derivative works. | % | %For information regarding external or commercial use of copyrighted | %materials owned by AOD, contact AOD at support@aorda.com. | %=======================================================================|