摘要:
function [x_opt, f_opt, iter] = newton_method() % 定义目标函数 f = @(x) 100*(x(1)^2 - x(2))^2 + (x(1) - 1)^2; % 计算目标函数的梯度和Hessian矩阵 grad_f = @(x) [400*x(1)* 阅读全文
posted @ 2023-05-25 10:54
庞司令
阅读(23)
评论(0)
推荐(0)
摘要:
function [x_opt, f_opt, iter] = conjugate_gradient() % 定义目标函数 f = @(x) 100*(x(1)^2 - x(2))^2 + (x(1) - 1)^2; % 计算目标函数的梯度 grad_f = @(x) [400*x(1)*(x(1) 阅读全文
posted @ 2023-05-25 10:19
庞司令
阅读(42)
评论(0)
推荐(0)
摘要:
function [x_opt, f_opt, iter] = steepest_descent() % 定义目标函数 f = @(x) 100*(x(1)^2 - x(2))^2 + (x(1) - 1)^2; % 计算目标函数的梯度 grad_f = @(x) [400*x(1)*(x(1)^2 阅读全文
posted @ 2023-05-25 09:49
庞司令
阅读(12)
评论(0)
推荐(0)