Why did I get two different results in nonlinear programing problems
clear,clc
A = [1 4 5
4 2 6
5 6 3];
prob = optimproblem;
x = optimvar(‘x’,3);
con = sum(x.^2) == 1;
prob.Constraints.con = con;
prob.Objective = x’*A*x;
x0.x = zeros(3,1);
% x0.x = rand(3,1);
show(prob)
[sol,fval,flag,out] = solve(prob,x0)
sol.x
when the initial point is zeres(0),fval is 0,sol.x is [0;0;0].
but when it is rand(3,1),fval is -3.66.
I can’t understand this reasonclear,clc
A = [1 4 5
4 2 6
5 6 3];
prob = optimproblem;
x = optimvar(‘x’,3);
con = sum(x.^2) == 1;
prob.Constraints.con = con;
prob.Objective = x’*A*x;
x0.x = zeros(3,1);
% x0.x = rand(3,1);
show(prob)
[sol,fval,flag,out] = solve(prob,x0)
sol.x
when the initial point is zeres(0),fval is 0,sol.x is [0;0;0].
but when it is rand(3,1),fval is -3.66.
I can’t understand this reason clear,clc
A = [1 4 5
4 2 6
5 6 3];
prob = optimproblem;
x = optimvar(‘x’,3);
con = sum(x.^2) == 1;
prob.Constraints.con = con;
prob.Objective = x’*A*x;
x0.x = zeros(3,1);
% x0.x = rand(3,1);
show(prob)
[sol,fval,flag,out] = solve(prob,x0)
sol.x
when the initial point is zeres(0),fval is 0,sol.x is [0;0;0].
but when it is rand(3,1),fval is -3.66.
I can’t understand this reason initial point MATLAB Answers — New Questions