fmukai.m
来自「基于matlab的约束非线性规划算法库」· M 代码 · 共 22 行
M
22 行
function [f, J] = fmukai(x, ctrl)
%Call: [f J]=fmukai(x,ctrl)
%Evaluate the residual f(i)=(x(i)-x(i+3) corresponding
%to the objective in a nonlinear lsq problem.
%If ctrl>0 the Jacobian J is computed analytically.
%Objective: 0.5*norm2(f)
%The problem is defined as
% min 0.5*norm2(f(x))
% s.t. h(x)>=0
%where
%h(1)=-x(1)^2-x(2)^2-x(3)^2+5;
%h(2)=-(x(4)-3)^2-x(5)^2+1;
%and 4 <= x(6) <= 8
%
for i=1:3
f(i)=x(i)-x(i+3);
end
f=f(:);
%The Jacobian is set to the empty matix to indicate that it should
%be computed using forward differences
J=[];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?