📄 ftp65.m
字号:
function [f, J] = ftp65(x, ctrl)
%Call: [f J]=ftp65(x,ctrl)
%Evaluate the residuals corresponding
%to the objective in a nonlinear lsq problem.
%If ctrl>0 the Jacobian J should be computed.
%Objective: 0.5*norm2(f)
%The problem is defined as
% min 0.5*norm2(f(x))
% s.t. c(x)>=0
%where
%c=-x(1)^2-x(2)^2-x(3)^2+48;
%and -4.5<=x(i)<=4.5 for i=1,2
% -5<=x(3)<=5
%
if ctrl == 0
f(1)=x(1)-x(2);
f(2)=(x(1)+x(2)-10)/3;
f(3)=x(3)-5;
f=f(:);
J = [];
else
%The Jacobian is set to the empty matix to indicate that it should
%be computed using forward differences
f=[];
J=[];
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -