Today had been two part work. Initially, I did some Data Structures lessons from Udacity course. Then, at night, I tried to implement the Single objective optimisation method called fibonacci method using Fortran. There is some mistake that I need to correct. I will share the updated code tmw. Here’s the faulty one!
|
|
The following output is obtained.
Fibonacci series 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946
The interval at k: 2 is 0.0000000000000000 3.0901699250867898 with L* 1.9098300749132102
The interval at k: 3 is 1.9098300749132102 3.0901699250867898 with L* 1.1803398501735793
The interval at k: 4 is 3.0901699250867898 3.0901699250867898 with L* 0.45084973468720563
The interval at k: 5 is 3.0901699250867898 2.6393201903995842 with L* 0.0000000000000000
The interval at k: 6 is 3.0901699250867898 2.6393201903995842 with L* -0.17220935388803721
The interval at k: 7 is 2.9179605711987526 2.6393201903995842 with L* -0.17220906785924670
The interval at k: 8 is 2.9179605711987526 2.8115292582588309 with L* -0.10643148971509220
The interval at k: 9 is 2.9179605711987526 2.9179607479739231 with L* -4.0652809186601392E-002
The interval at k: 10 is 2.9179605711987526 2.9586135571605245 with L* 6.7523562981351993E-008
The interval at k: 11 is 2.9179605711987526 2.9586134896369614 with L* 1.5527182138176773E-002
The interval at k: 12 is 2.9179605711987526 2.9430863074987847 with L* 1.5530328392124683E-002
The interval at k: 13 is 2.9334908995908773 2.9430863074987847 with L* 9.5934629509213543E-003
The interval at k: 14 is 2.9430843625417986 2.9430863074987847 with L* 3.6688324353763863E-003
The interval at k: 15 is 2.9467531949771750 2.9430863074987847 with L* 7.4093599471731461E-007
The interval at k: 16 is 2.9467539359131698 2.9430863074987847 with L* -1.4103413378424151E-003
The interval at k: 17 is 2.9453435945753275 2.9430863074987847 with L* -1.3753606553943976E-003
The interval at k: 18 is 2.9453435945753275 2.9444616681541791 with L* -9.0291483061708531E-004
The interval at k: 19 is 2.9453435945753275 2.9453645829847961 with L* -2.9397547371612376E-004
The interval at k: 20 is 2.9453435945753275 2.9456585584585122 with L* 1.0494204734312618E-005
The converging point is wrong. Because, for the function defined in code ($f=x^2 + 54/x$), the optima lies at 3. Hence, will try again tomorrow!