# Question:Global Optimization Toolbox sensitive to search ranges?

## Question:Global Optimization Toolbox sensitive to search ranges?

Maple Toolboxes

Hi

I'm trying to work out how the Global Optimization Toolbox works and I thought I got it working. However, when I increase the ranges of the parameters over which the Toolbox should look for the solution (but still including the previous range), the outcome of the optimization changes, i.e. the toolbox finds different optimal parameter values and a different, and often higher, Sum of Squares (which is my evaluation criterium). I don't understand what I'm doing wrong!

An example:

if I run the program with VarRanges: [r=0..10,a=0..100,k=0.0..10,s=0..0.1], the parameter values found are a=0, k=0.004, r=0.006, s=0.018 and the Sum of Squares=30.87

if I run the program with a broader range for s (s=0..1), the parameter values found are a=2.84, k=0.95, r=0.0026, s=0.80 and the Sum of Squares is much higher than found before (128.75)

I don't understand because the better solution found with the first VarRanges is included in the ranges set in the second part of the example. Still, the toolbox does not find that solution.

I've pasted my worksheet below. I hope somebody can help me!

Thanks, Marjet

restart:
with(GlobalOptimization):

Stime:=[0., 2.0, 4.0, 8.0, 12.0, 20.0]:
Sdata:=[5.703782474656201, 16.588099280204055, 15.201804919084164, 14.77102200299171, 16.300417207752275, 18.03501826314038]:

Tspline:=piecewise(v < 2.0, 859.4940801+614.505919899999980*v-242.505919900000009*(v-1.0)^3, v < 3.0, 2072.023679-113.011839699999996*v-727.517759814391980*(v-2.0)^2+374.529599700000006*(v-2.0)^3, v < 4.0, 2713.375682-444.458560499999976*v+396.071039257567974*(v-3.0)^2-117.612478800000006*(v-3.0)^3, v < 8.0, 1234.615674-5.15391840000000024*v+43.2336027841202011*(v-4.0)^2-4.39253079700000004*(v-4.0)^3, v < 12.0, 565.012594+129.873425700000012*v-9.47676677469249462*(v-8.0)^2-3.84164741000000020*(v-8.0)^3, v < 16.0, 3290.077410-130.339784199999997*v-55.5765356853502226*(v-12.0)^2+9.79037043299999964*(v-12.0)^3, v < 20.0, 2622.228621-105.014288800000002*v+61.9079095160933904*(v-16.0)^2-8.75733432700000058*(v-16.0)^3, 1554.061206-30.1030602999999992*v-43.1801023790233529*(v-20.0)^2+3.59834186699999980*(v-20.0)^3):

Espline:=piecewise(v < 2.0, 1353.868169-37.8681685999999972*v+85.8681686000000042*(v-1.0)^3, v < 3.0, 924.5273256+219.736337200000008*v+257.604505781836906*(v-2.0)^2-66.3408429699999971*(v-2.0)^3, v < 4.0, 167.231540+535.922819900000036*v+58.5819768726522838*(v-3.0)^2-63.5047967300000026*(v-3.0)^3, v < 8.0, 455.710466+462.572383500000001*v-131.932413272446070*(v-4.0)^2+13.8223293599999996*(v-4.0)^3, v < 12.0, 2365.320910+70.5848862100000076*v+33.9355389629520516*(v-8.0)^2-9.22356512700000053*(v-8.0)^3, v < 16.0, 4372.943140-100.661928300000000*v-76.7472425793621512*(v-12.0)^2+22.0094311699999992*(v-12.0)^3, v < 20.0, -2526.005227+341.812826700000016*v+187.365931354496582*(v-16.0)^2-37.1266595299999978*(v-16.0)^3, 3758.787586+58.6606207000000026*v-258.153982838624130*(v-20.0)^2+21.5128318999999984*(v-20.0)^3):

f:=(t)->(5.7 + r*(((evalf(int(Tspline,v=0..t)))+(evalf(int(abs(Tspline),v=0..t))))/2) - a*t - k*(((evalf(int(((Espline)*(max((1-s*t),0))),v=0..t)))+(evalf(int(((abs(Espline))*(max((1-s*t),0))),v=0..t))))/2) ):
Difference :=[seq((f(convert(Stime[p],float))-Sdata[p], p=1..6))]:
VarRanges:=[r=0..10,a=0..100,k=0.0..10,s=0..1]: 