How to iterate so it will converge
19 views (last 30 days)
Hi so im trying to iterate this code so that it will converge, but Im not getting how to do it. I did it manually, but im not able to use any loops cause it wont work out...
Heres how I did it manually... just cant figure out how to soft code it... and the delta values must be> 0.0001. Like I belive is suppose to be like while> delta(i)>0.0001. And also, all variables shown below are vectors.
%Code shown below
w0=l_0-l; % Also this has to get updated
xhat=x_0+delta0; %This needs updating
w01=l_01-l; % Also this has to get updated
xhat1=xhat+delta01; %This needs updating
KALYAN ACHARJYA on 23 Sep 2019
Edited: KALYAN ACHARJYA on 23 Sep 2019
but im not able to use any loops cause it wont work out...
The convergence criteria is not related with loop (its do just repetition),its based mathematical modeling of the problem. As my undestanding, the requiremnt is xhat to be converge (no chage) after certain iterations, when xhat is converge, then loop must be terminated. Hints, you may think this way, but still you have to ensure that after certains times of iterations, xhat must be ramain same (unchanged)
Also requested you to check the @Walter's Answer on while loop convergence criteria