Looking for TVM contributions
|
06-20-2024, 04:30 PM
(This post was last modified: 06-23-2024 01:15 PM by robve.)
Post: #75
|
|||
|
|||
RE: Looking for TVM contributions
(06-19-2024 09:08 PM)Albert Chan Wrote: Technically this setup should never encounter overshoot (f sign flip) Well, try this example with Newton. The curve is parabolic with f''>0. We stop at sign change and take the last i%: ./tvm 10 '?' 50 -12.8277219567 80 1/0 i%= 3.08778325056 y= 0.0103695628259 2/0 i%= 3.59460137697 y= 0.00259881409493 3/0 i%= 3.8488202702 y= 0.00064807442555 4/0 i%= 3.97517959151 y= 0.000159382918897 5/0 i%= 4.03630943599 y= 3.72170552208e-05 6/0 i%= 4.06308588579 y= 7.13292596899e-06 7/0 i%= 4.07140713916 y= 6.88560398032e-07 8/0 i%= 4.07240259392 y= 9.85261117137e-09 9/0 i%= 4.07241725752 y= 2.14050999148e-12 10/0 i%= 4.07241726071 y= -3.5527136788e-15 10, i%=4.07241726070281285%, FVerr=2e-10 This is not a winning strategy IMHO. Newton stopping at non-monotonicity is better with previous i% when the last step wasn't monotonically decreasing: ./tvm 10 '?' 50 -12.8277219567 80 1/0 i%= 3.08778325056 y= 0.0103695628259 2/0 i%= 3.59460137697 y= 0.00259881409493 3/0 i%= 3.8488202702 y= 0.00064807442555 4/0 i%= 3.97517959151 y= 0.000159382918897 5/0 i%= 4.03630943599 y= 3.72170552208e-05 6/0 i%= 4.06308588579 y= 7.13292596899e-06 7/0 i%= 4.07140713916 y= 6.88560398032e-07 8/0 i%= 4.07240259392 y= 9.85261117137e-09 9/0 i%= 4.07241725752 y= 2.14050999148e-12 10/0 i%= 4.07241726071 y= -3.5527136788e-15 11/0 i%= 4.0724172607 y= 1.7763568394e-15 12, i%=4.07241726070545784%, FVerr=2.8e-14 With the Hybrid method we have no sign change and we hit the root even closer: ./tvm 10 '?' 50 -12.8277219567 80 3/0 i%= 3.7640993412 y= 0.00115435116452 4/0 i%= 3.89955465008 y= 0.000413574938126 5/0 i%= 3.97517927056 y= 0.000159383755689 6/0 i%= 4.02259765825 y= 5.81463133074e-05 7/0 i%= 4.04983268476 y= 2.02404140044e-05 8/0 i%= 4.06437522885 y= 6.04424116091e-06 9/0 i%= 4.07056694296 y= 1.27674678296e-06 10/0 i%= 4.0722250993 y= 1.29426121376e-07 11/0 i%= 4.07241215141 y= 3.43175443618e-09 12/0 i%= 4.07241724621 y= 9.73088276623e-12 13/0 i%= 4.0724172607 y= 1.7763568394e-15 14/0 i%= 4.0724172607 y= 1.7763568394e-15 14, i%=4.07241726070100896%, FVerr=1.4e-14 Note how many trailing digits of i% are actually irrelevant. This is an example why comparing decimal places of i% is just wrong in general, the point I made earlier. The reason for this is the flat curvature, hence more iterations are needed than usual to get to the root for this example. It depends on the TVM problem how many places are relevant. The relationship is nonlinear. When we increase PMT a little bit then there is one root numerically (two roots very very close numerically indistinguishable) on the x-axis: ./tvm 10 '?' 50 -12.8277106125 80 For this specific case we can stop at a sign change without losing precision. IMPORTANT: all such examples are anecdotal. Anecdotal examples are fine as counter examples to prove claims are incorrect (counter to a proof), but shall never be solely used to offer a general proof. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 19 Guest(s)