In[]:=
(*DefinethefunctionT(x)basedonthegivenT(x)inExample4*)T[x_]:=(3/4)*(x+1/x)​​​​(*Definetheparameters*)​​m=1;​​a0=1;​​iterations=5;​​​​(*Initializeliststostoreiterationvalues*)​​a={N[a0]};​​b={};​​c={};​​​​(*Definetheimplicitequationforc_n*)​​implicitEquation[a_,c_]:=c==(m/(m+1))*a+(1/(m+1))*T[c]​​​​n=1;​​converged=True;​​​​While[n<=iterations&&converged,(*Solveforc_nimplicitly*)Print["Iteration: ",n];​​Print["Current a[[n]]: ",a[[n]]];​​c_n=Quiet[FindRoot[implicitEquation[a[[n]],c],{c,a[[n]]}]];​​If[NumericQ[c_n[[1,2]]],(*Appendthefoundc_ntothelist*)c=Append[c,N[c_n[[1,2]]]];​​(*Calculateb_n*)b_n=T[c[[-1]]];​​b=Append[b,N[b_n]];​​(*Calculatea_(n+1)*)a_n1=T[b_n];​​a=Append[a,N[a_n1]];​​Print["Computed c_n: ",c[[-1]]];​​Print["Computed b_n: ",b_n];​​Print["Computed a_(n+1): ",a_n1];,(*Handlenon-numericc_n*)converged=False;​​MessageDialog["Error: Non-numeric value encountered in iteration "<>ToString[n]];];​​n++;]​​​​(*Displaytheresultsinatable*)​​TableForm[Transpose[{Range[0,Length[a]-1],a}],TableHeadings->{None,{"Iteration","a"}}]​​​​(*Plottheresults*)​​ListLinePlot[a,PlotMarkers->Automatic,GridLines->Automatic,AxesLabel->{"Iteration","a"},PlotLabel->"Implicit Iterations of Example 4"]​​
Iteration: 1
Current a[[n]]: 1.
Set
:Tag Integer in c:Blank[1] is Protected.
Part
:Part specification (c:Blank[1])〚1,2〛 is longer than depth of object.
Out[]//TableForm=
Iteration
a
0
1.
Out[]=