unconstrained nonlinear optimization problem
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Heborvi
el 16 de Oct. de 2020
Hello,
Kindly I have a question concerning nonlinear optimization problem. I have the following problem:

How I can define this objective function in matlab?
Thank you
5 comentarios
Respuesta aceptada
Matt J
el 16 de Oct. de 2020
Editada: Matt J
el 16 de Oct. de 2020
Still, there are no constraints, so I think you should be using fminunc. Also, your revised objective function is not differentiable near theta=X, so you'll have to hope that the optimizer doesn't search there.
N=nchoosek(n,2);
I=1:N;
J=nchoosek(1:n,2);
C=(sparse(I,J(:,1),1,N,n)+sparse(I,J(:,2),-1,N,n)).';
thetaOptimal=fminunc(@(theta) P(theta,X,C,d), theta0);
function fval=P(theta,X,C,d)
%theta - pxn matrix of unknowns
% X - known pxn matrix
% d - column vector of length nchoosek(n,2)
V=vecnorm((X-theta)*C,2,1);
fval=norm(d-V(:)).^2;
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!