#*****************************************************************************80 # ## local_min_test() tests local_min(). # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 12 June 2021 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "local_min_test():\n" ) cat ( " ", version$version.string, "\n" ) cat ( " Test local_min(),\n" ) cat ( " a local minimizer of a function F(X)\n" ) cat ( " in an interval [A,B].\n" ) source ( "/home/burkardt/public_html/r_src/local_min_test/local_min_example.R" ) source ( "/home/burkardt/public_html/r_src/local_min_test/g_01.R" ) source ( "/home/burkardt/public_html/r_src/local_min_test/g_02.R" ) source ( "/home/burkardt/public_html/r_src/local_min_test/g_03.R" ) source ( "/home/burkardt/public_html/r_src/local_min_test/g_04.R" ) source ( "/home/burkardt/public_html/r_src/local_min_test/g_05.R" ) source ( "/home/burkardt/public_html/r_src/local_min_test/g_06.R" ) source ( "/home/burkardt/public_html/r_src/local_min_test/g_07.R" ) a <- 0.0 b <- 3.141592653589793 local_min_example ( a, b, g_01, "g_01(x) <- ( x - 2 ) * ( x - 2 ) + 1" ) a <- 0.0 b <- 1.0 local_min_example ( a, b, g_02, "g_02(x) <- x * x + exp ( - x )" ) a <- -2.0 b <- 2.0 local_min_example ( a, b, g_03, "g_03(x) <- x^4 + 2x^2 + x + 3" ) a <- 0.0001 b <- 1.0 local_min_example ( a, b, g_04, "g_04(x) <- exp ( x ) + 1 / ( 100 x )" ) a <- 0.0002 b <- 2.0 local_min_example ( a, b, g_05, "g_05(x) <- exp ( x ) - 2x + 1/(100x) - 1/(1000000x^2)" ) a <- 1.8 b <- 1.9 local_min_example ( a, b, g_06, "g_06(x) <- -x*sin(10*pi*x)-1.0" ) a <- -1.2 b <- 2.7 local_min_example ( a, b, g_07, "g_07(x) <- max(-2(x-1),8(x-1)) + 25*(x-1)^2" ) # # Terminate. # cat ( "\n" ) cat ( "local_min_test():\n" ) cat ( " Normal end of execution.\n" ) cat ( "\n" ) cat ( date ( ), "\n" ) quit ( )