📄 steepest_descent.m
字号:
function [v, w]= steepest_descent(rp)
% function [v, w]= steepest_descent(rp)
%
% computes trajectories of the steepest descent algorithm
% it requires the passing of a structure that contains all
% of the run parameters (mkrp.m generates this structure)
mu=rp.mu; Nn=rp.Nn;
a1=rp.a1; a2=rp.a2; lam1=rp.lam1; lam2=rp.lam2;
disp(['a1: ', num2str(a1), ' a2: ', num2str(a2), ' lam1: ', ...
num2str(lam1), ' lam2: ', num2str(lam2)]);
v(1:2, 1) = (-1/sqrt(2)) * [a1 + a2; a1 - a2]; % initial case
v(1, 2:Nn) = ((1 - mu*lam1).^(2:Nn)) * v(1,1);
v(2, 2:Nn) = ((1 - mu*lam2).^(2:Nn)) * v(2,1);
w(1,:) = -a1 + (v(1,:) + v(2,:)) / sqrt(2);
w(2,:) = -a2 + (v(1,:) - v(2,:)) / sqrt(2);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -