folinmod.m
来自「基于matlab的约束非线性规划算法库」· M 代码 · 共 21 行
M
21 行
function [f, J] = fOlinMod(x, ctrl, t, u)
%Call: [f J]=fOlinMod(x,ctrl,t,u)
%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))
% where f(x,u)=x(1)/(1+x(2)*t)
%and t,u are given. No constraints are present!
%
if ctrl == 0
f=x(1)./(1+x(2).*t)-u;
f=f(:);
J = [];
else
%The Jacobian is computed analytically
f=[];
J=[1./(1+x(2).*t) -x(1).*t./(1+x(2).*t).^2];
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?