############################################################### # Building 'newt2' and sample output on SGIs # # Note how different roots are found depending on the initial # guess and how, in each case, convergence of both dx and # the residual is quadratic as the solution is approached. ############################################################### einstein% pwd /Public/Members/matt/Teaching/97Spring/Phy381C/Doc/nonlin/ex3 einstein% ls *.f Makefile Makefile newt2.f einstein% make -f Makefile newt2 touch newt2.f f77 -g -n32 -c newt2.f f77 -g -n32 -L/usr/localn32/lib -n32 newt2.o \ -lp329f -llapack -lblas -o newt2 einstein% newt2 usage: newt2 [] ############################################################### # Start with initial guess (1.0,1.0) and use default tolerance ############################################################### einstein% newt2 1.0 1.0 Iter x y log10(dx) log10(res) 1 -3.2999966453609808E-02 1.4010001006391706E+00 -0.11 0.70 2 3.7660093320946680E-01 2.2207017966697333E+00 -0.19 -0.40 3 2.6508349149835875E-01 1.9187667230923000E+00 -0.64 -0.30 4 2.7416951525985472E-01 1.9092166705387068E+00 -2.03 -1.19 5 2.7423631305849172E-01 1.9092977465351673E+00 -4.13 -3.95 6 2.7423631371214585E-01 1.9092977458408302E+00 -9.17 -8.33 0.2742363137121459 1.909297745840830 ############################################################### # Start with initial guess (10.0,10.0) ############################################################### einstein% newt2 10.0 10.0 Iter x y log10(dx) log10(res) 1 1.1551311217431483E+01 8.5653933652294452E+00 0.17 1.43 2 5.2821340061715780E+00 6.2494950887336298E+00 0.67 0.26 3 7.9156169067353002E+00 7.0845635565145253E+00 0.29 0.58 4 8.0553488920812182E+00 7.0945184792891158E+00 -1.00 -0.08 5 8.0478800970260274E+00 7.0913532277678391E+00 -2.24 -1.34 6 8.0480621354266528E+00 7.0914295327798591E+00 -3.86 -2.93 7 8.0480622340064549E+00 7.0914295740731097E+00 -7.12 -6.20 8.048062234006455 7.091429574073110 ############################################################### # Start with initial guess (100.0,100.0) ############################################################### einstein% newt2 100.0 100.0 Iter x y log10(dx) log10(res) 1 1.4561314470371522E+02 5.4378394341111452E+01 1.66 3.82 2 1.9021837653952525E+02 3.7701738714769547E+01 1.53 3.17 3 2.0349983567820649E+02 3.5070267397907138E+01 0.98 2.29 4 2.0392234856561163E+02 3.5007684984188494E+01 -0.52 0.70 5 2.0390326095147381E+02 3.5005993323580441E+01 -1.87 -0.53 6 2.0391023928640129E+02 3.5006591323292412E+01 -2.31 -0.59 7 2.0391061250942664E+02 3.5006623302706338E+01 -3.58 -1.92 8 2.0391061457091232E+02 3.5006623479357074E+01 -5.83 -4.18 9 2.0391061457097669E+02 3.5006623479362588E+01 -10.34 -8.68 203.9106145709767 35.00662347936259 ############################################################### # Start with initial guess (0.0,0.0), generates singular # Jacobian ############################################################### einstein% newt2 0.0 0.0 Iter x y log10(dx) log10(res) newt2: dgesv failed. ############################################################### # Start with initial guess (1.0,1.0) but use more stringent # tolerance ############################################################### einstein% newt2 1.0 1.0 1.0e-15 Iter x y log10(dx) log10(res) 1 -3.2999966453609808E-02 1.4010001006391704E+00 -0.11 0.70 2 3.7660093320946680E-01 2.2207017966697338E+00 -0.19 -0.40 3 2.6508349149835875E-01 1.9187667230922998E+00 -0.64 -0.30 4 2.7416951525985467E-01 1.9092166705387068E+00 -2.03 -1.19 5 2.7423631305849172E-01 1.9092977465351673E+00 -4.13 -3.95 6 2.7423631371214585E-01 1.9092977458408302E+00 -9.17 -8.33 7 2.7423631371214585E-01 1.9092977458408302E+00 -60.00 -60.00 0.2742363137121459 1.909297745840830