Hello @Thi_Oliveira,
Try this approach:
data want;
/* Provide initial values and derived quantities */
To=14; Tb=4; Tc=20;
h=0.05;
c=10; /* Replace 10 with the real value of c in your application. */
k=(Tc-To)/(To-Tb);
j=h**(1/c)*(To-Tb)*(Tc-To)**k; /* (use j to avoid name conflict with L) */
eps=1e-12; /* used in convergence criterion (see chk_conv below) */
maxiter=1000; /* maximum number of iterations */
retain i L U 0; /* use RETAIN also to define variable order */
link chk_conv;
format dL dU best8.;
label L='L[i]'
U='U[i]'
dL='L[i] - L[i-1]'
dU='U[i] - U[i-1]';
/* Perform iteration */
do i=0 to maxiter while(not conv);
output;
L=j/((Tc-Tb)**(k+1)*(1-L)**k);
U=(j/((Tc-Tb)**(k+1)*(1-U)))**(1/k);
link chk_conv;
end;
/* Compute final results (named Tb_ and Tc_) */
Tb_=Tb+L*(Tc-Tb);
Tc_=Tc-U*(Tc-Tb); /* Note the typo in the article! */
output;
return;
/* Check convergence criterion */
chk_conv:
dL=dif(L);
dU=dif(U);
if i then conv=(.<abs(dL)<eps & .<abs(dU)<eps);
return;
run;
proc print data=want label;
run;
... View more