Convert a Problem-based model to a Solver-based model using prob2struct in MATLAB

조회 수: 1 (최근 30일)
I'm trying to convert a problem-based model to a solver-based model so that I can use other solvers to solve my problem. The prob2struct function returns a structure which defines the model with some matrixes like Aeq and beq. I'm confused about what does matrix C and d in the returned structure mean. A demo code is attached below.
clc
clear
qprob = optimproblem;
var_x = optimvar('var_x',2);
constr = var_x >= 5;
qprob.Constraints.x_range = constr;
qprob.Constraints.xs = var_x(1) >= var_x(2) + 10;
qprob.Objective = sum((var_x - [2,3]').^2)+8;
opts = optimoptions('lsqlin','Algorithm','interior-point');
[sol,fval,exitflag,output,lambda] = solve(qprob,'options',opts);
problem = prob2struct(qprob);

답변 (1개)

Raunak Gupta
Raunak Gupta 2020년 6월 24일
Hi,
Since the problem is framed using ‘lsqlin’ the prob2struct is returning the problem structure as per lsqlin optimization problem setup. Here it is explained how the objective function is setup in terms of matrices. For detailed description about matrices you may look here.
Hope this clarifies doubt about matric C and d.

카테고리

Help CenterFile Exchange에서 Linear Least Squares에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by