Info

์ด ์งˆ๋ฌธ์€ ๋งˆ๊ฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํŽธ์ง‘ํ•˜๊ฑฐ๋‚˜ ๋‹ต๋ณ€์„ ์˜ฌ๋ฆฌ๋ ค๋ฉด ์งˆ๋ฌธ์„ ๋‹ค์‹œ ์—ฌ์‹ญ์‹œ์˜ค.

Steepest descent method with newtons method

์กฐํšŒ ์ˆ˜: 2 (์ตœ๊ทผ 30์ผ)
Muthumari
Muthumari 2023๋…„ 5์›” 1์ผ
๋งˆ๊ฐ: Torsten 2023๋…„ 5์›” 1์ผ
My objective function is 2๐‘ฅ1 + 3๐‘ฅ2 ^2 + ๐‘’( 2๐‘ฅ1 ^2+๐‘ฅ2^ 2 )
I have tried this code but nothing worked
function s = newton_ls(y,d)
% initilaize lamba=0
s=0;
% let theta_d and theta_dd be the first and second dreivative of theta
while 1
theta_d = first_d(s);
theta_dd = second_d(s);
diff = - theta_d/theta_dd;
s= s+diff;
if abs(diff)<0.01
break;
end
end
%nested function to define my first derivative and second derivative of lamba
function t_d = first_d(s)
t_d= 2*d(1,1)+(6*(d(2,1)^2*s))+(6*(d(2,1)*y(2,1)))+(2*(d(2,1)*d(2,1)*s)+y(2,1))+(4*d(1,1)*(d(1,1)*s+y(1,1)))*exp(((d(2,1)*s+y(2,1))^2)+(2*(d(1,1)*s+y(1,1))^2));
end
function t_dd = second_d(s)
t_dd= 12*d(2,1)+2*d(2,1)^2+2*d(2,1)*d(1,2)*s+y(2,1)+4*d(1,1)*d(2,1)*s+y(1,1)^2*exp(d(2,1)*s+y(2,1)^2+2*d(1,1)*s+y(1,1)^2+2*d(2,1)^2+4*d(1,1)^2)*exp(d(2,1)*s+y(2,1)^2)+(2*d(1,1)*s+y(1,1)^2);
end
end
Kindly help me with suggestions

๋‹ต๋ณ€ (0๊ฐœ)

์ด ์งˆ๋ฌธ์€ ๋งˆ๊ฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by