>> x[1] = 1; >> for i=1:4, x(i+1) = 5 + x(i) - x(i)^2; end I1 is not convergent >> x x = 1 5 -15 -235 -55455 >> for i=1:4, x(i+1) = 5/x(i); end I2 is not convergent >> x x = 1 5 1 5 1 >> for i=1:20, x(i+1) = 1 + x(i) - x(i)^2/5; end I3 is convergent >> x x = Columns 1 through 7 1.0000 1.8000 2.1520 2.2258 2.2350 2.2360 2.2361 Columns 8 through 14 2.2361 2.2361 2.2361 2.2361 2.2361 2.2361 2.2361 Columns 15 through 21 2.2361 2.2361 2.2361 2.2361 2.2361 2.2361 2.2361 I3 is converging to sqrt(5) >> err = sqrt(5) - x err = Columns 1 through 6 1.2361e+000 4.3607e-001 8.4068e-002 1.0289e-002 1.1074e-003 1.1716e-004 Columns 7 through 12 1.2371e-005 1.3061e-006 1.3789e-007 1.4557e-008 1.5368e-009 1.6225e-010 Columns 13 through 18 1.7129e-011 1.8083e-012 1.9096e-013 2.0428e-014 2.2204e-015 0 Columns 19 through 21 0 0 0 >> for i=1:19, ratio(i) = err(i+1)/err(i); end the ratio's bounded with n. So I3 is linearly convergent. The ratio is going to g'(sqrt(5)), as expected. >> ratio ratio = Columns 1 through 6 3.5279e-001 1.9279e-001 1.2239e-001 1.0763e-001 1.0579e-001 1.0560e-001 Columns 7 through 12 1.0558e-001 1.0557e-001 1.0557e-001 1.0557e-001 1.0557e-001 1.0557e-001 Columns 13 through 18 1.0557e-001 1.0560e-001 1.0698e-001 1.0870e-001 0 NaN Column 19 NaN >> 1 - 2*sqrt(5)/5 ans = 1.0557e-001 >> for i=1:10, ratio(i) = err(i+1)/err(i)^(1.2); end the ratio's growing with n. So I3 is not convergent with rate p=1.2. >> ratio ratio = Columns 1 through 6 3.3815e-001 2.2760e-001 2.0082e-001 2.6882e-001 4.1267e-001 6.4550e-001 Columns 7 through 10 1.0118e+000 1.5862e+000 2.4868e+000 3.8989e+000 >> for i=1:10, ratio(i) = err(i+1)/err(i)^2; end the ratio's growing with n. So I3 is not quadratically convergent. >> ratio ratio = Columns 1 through 6 2.8541e-001 4.4210e-001 1.4558e+000 1.0461e+001 9.5535e+001 9.0134e+002 Columns 7 through 10 8.5340e+003 8.0832e+004 7.6564e+005 7.2523e+006 now test I4. >> for i=1:10, x(i+1) = 1/2*(x(i) + 5/x(i)); end >> x x = Columns 1 through 6 1.0000e+000 3.0000e+000 2.3333e+000 2.2381e+000 2.2361e+000 2.2361e+000 Columns 7 through 11 2.2361e+000 2.2361e+000 2.2361e+000 2.2361e+000 2.2361e+000 >> err = sqrt(5) - x >> err = Columns 1 through 6 1.2361e+000 -7.6393e-001 -9.7265e-002 -2.0273e-003 -9.1814e-007 -1.8829e-013 Columns 7 through 11 0 0 0 0 0 >> for i=1:10, ratio(i) = err(i+1)/err(i); end the ratio's bounded with n. So I4 is linearly convergent. >> ratio ratio = Columns 1 through 6 -6.1803e-001 1.2732e-001 2.0843e-002 4.5290e-004 2.0508e-007 0 Columns 7 through 10 NaN NaN NaN NaN >> for i=1:10, ratio(i) = err(i+1)/abs(err(i))^(1.2); end the ratio's bounded with n. So I4 is convergent with rate p=1.2 >> ratio ratio = Columns 1 through 6 5.9238e-01 1.3437e-01 3.3217e-02 1.5654e-03 3.3063e-06 0 Columns 7 through 10 NaN NaN NaN NaN >> for i=1:10, ratio(i) = err(i+1)/err(i)^2; end the ratio's bounded with n. So I4 is quadratically convergent. >> ratio ratio = Columns 1 through 6 -5.0000e-001 -1.6667e-001 -2.1429e-001 -2.2340e-001 -2.2336e-001 0 Columns 7 through 10 NaN NaN NaN NaN