function [x,minf] = minDFP(f,x0,var,eps)
format long;
if nargin == 3
eps = 1.0e-6;
end
x0 = transpose(x0);
n = length(var);
syms l;
H = eye(n,n);
gradf = jacobian(f,var);
v0 = Funval(gradf,var,x0);
p = -H*transpose(v0);
k = 0;
while 1
v = Funval(gradf,var,x0);
tol = norm(v);
if tol<=eps
x = x0;
break;
end
y = x0 + l*p;
yf = Funval(f,var,y);
[a,b] = minJT(yf,0,0.1);
xm = minHJ(yf,a,b);
x1 = x0 + xm*p;
vk = Funval(gradf,var,x1);
tol = norm(vk);
if tol<=eps
x = x1;
break;
end
if k+1==n
x0 = x1;
continue;
else
dx = x1 - x0;
dgf = vk - v;
dgf = transpose(dgf);
dxT = transpose(dx);
dgfT = transpose(dgf);
mdx = dx*dxT;
mdgf = dgf*dgfT;
fz = H*(dgf*(dgfT*H));
H = H + mdx/(dxT*dgf)-inv(dgfT*(H*dgf))*fz;
p = -H*transpose(vk);
k = k+1;
x0 = x1;
end
end
minf = Funval(f,var,x);
format short;
阿里matlab建模师
- 粉丝: 4558
- 资源: 2866
最新资源
- 【岗位说明】销售主管岗位职责及任职资格.docx
- 【岗位说明】销售助理职能说明书.doc
- 【岗位说明】销售助理岗位职责.doc
- 【岗位说明】销售专员岗位说明书.docx
- 【岗位说明】销售总监岗位职责.doc
- 【岗位说明】销售总监职能说明书.doc
- 【岗位说明】业务管理部经理职位说明书.doc
- 【岗位说明】业务部门职能说明书.doc
- 【岗位说明】业务管理员职能说明书.xls
- 【岗位说明】业务管理员岗位职责.xls
- 【岗位说明】医疗器械销售员的岗位职责.docx
- 【岗位说明】营销部经理岗位说明书.doc
- 【岗位说明】营销部门职位描述.doc
- 【岗位说明】营销策划部门职能说明书.doc
- 【岗位说明】营销策划职能说明书.xls
- 【岗位说明】营销策划岗位职责.xls
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0