Global Optimization Questions and Posts

These are Posts and Questions associated with the product, Global Optimization

Playing mini-golf recently, I realized that my protractor can only help me so far since it can't calculate the speed of the swing needed.  I decided a more sophisticated tool was needed and modeled a trick-shot in MapleSim.

To start, I laid out the obstacles, the ball and club, the ground, and some additional visualizations in the MapleSim environment.


When running the simulation, my first result wasn't even close to the hole (similar to when I play in real life!).


The model clearly needed to be optimized. I went to the Optimization app in MapleSim (this can be found under Add Apps or Templates  on the left hand side).


Inside the app I clicked "Load System" then selected the parameters I wanted to optimize.


For this case, I'm optimizing 's' (the speed of the club) and 'theta' (the angle of the club). For the Objective Function I added a Relative Translation Sensor to the model and attached a probe to the Vector Norm of the output.


Inside the app, I switched to the Objective Function section.  Selecting Probes, I added the new probe as the Objective Function by giving it a weight of 1.



Scrolling down to "Execute Parameter Optimization", I checked the "Use Global Optimization Toolbox" checkbox, and clicked Run Parameter Optimization.


Following a run time of 120 seconds, the app returns the graph of the objective function. 


Below the plot, optimal values for the parameters are given. Plugging these back into the parameter block for the simulation we see that the ball does in fact go into the hole. Success!




Does global optimization toolbox has randomization option it gives same value every time

Does globalsolve from global optimization toolbox thread safe or not

Does Maplesoft provide success percentage of this toolbox on benchmark functions?. I cannot see much options in the global solve command (from maple help page) other than population size etc. 

I would like to know whether a local optimizer is combined with the present global optimization toolbox?. I read that toolbox has differential evolution and surrogate optimization techniques etc. These methods guarantee near-optimal solutions and it is often recommended to use a local optimization technique in conjunction with global optimization techniques. 

first I define some constants (note I may change the constants later based on the context of the application)

p_l := 10^(-15);     
epsilon := 1.09*10^(-10);
p_B := 1.09*10^(-8);

n_A := 10^7;         
k_A := 0;
n_B := 10^8; 
k_B := 0;

then I define a function l(x,y):

l := (x, y) -> x^k_A*(1 - x)^(n_A - k_A)*y^k_B*(1 - y)^(n_B - k_B)

Now I use both with(GlobalOptimization) and with(Optimization) to maximize l(x,y) give some constraints and I get:

GlobalSolve(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, maximize, initialpoint = [x_1 = 0, y_1 = 0]);
  [-0., [x_1 = 1.09000000000000 10^(-10)   , y_1 = 0.633548870211381]]

Maximize(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, initialpoint = [x_1 = 0, y_1 = 0]);
 [0.33621648834727435318,  [x_1 = 1.00000000000000 10^(-15)   , y_1 = 1.0900000000000000000 10^(-8)  ] ]


Clearly the second answer is right and the first is wrong... I am not sure why the ``global optimazation'' is doing worse than the normal and free ``optimazation''.. Am I using the GlobalSolve in a wrong way??


I have some trouble using the GlobalOprimization Toolbox (GoT)
When used with some options GoT returns an error message indicating the option is not valid.
For instance options (just a few among some others) "numexperiments", "nugget", "optsearch", "goal", ... are not recognized.

I'm using Maple 2018.0 (I don't know how to recover the number of the GlobalOptimization Toolbox).

Is it an installation problem (GotT has been bought legally) or a problem with this Toolbox ?



Ive been trying to use the global optimization toolbox to optimize a model I extract from the maplesim environment.
It works fine with the regular Optimization toolbox. but when I run the optimization on the Global toolbox I get this error:

Warning, Error at t=0.0000000000000000e+000: index-1 and derivative evaluation failure

to explain a little,
I use the getCompiledProc command to turn the maplesim model into a module to be used in maple.


Dear Friends,

My present problem is to calculate the coefficients  

of ODES based on the experiment data. In order to simulate the actual experiment, a set of  is given with . Then the experiment data (yexp) can be calculated. Finally, the least-squares method (lsq) is used to calculate the coefficient values. Now the NLPSolve function can be used. However, the globalsolve cant run.


If it is convenient for you, wish you can solve it.




cdm_ode := diff(y1(t), t) = c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t)), diff(y2(t), t) = ks*y2(t)^(1/3)*(1-y2(t)), diff(y3(t), t) = h1*(1-y3(t)/h2)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(sigma*(1-y2(t))), diff(y4(t), t) = (1/3)*kp*(1-y4(t))^4, diff(y5(t), t) = A*B*y1(t)^(B-1)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t)), diff(y6(t), t) = y6(t)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t));


tol_t := 3600;
sol := dsolve([cdm_ode, y1(0) = 0, y2(0) = 0, y3(0) = 0, y4(0) = 0, y5(0) = 0, y6(0) = 175], numeric, range = 0 .. tol_t, output = listprocedure, parameters = [c0, n, sigma, s0, ks, h1, h2, kp, A, B]);

sol(parameters = [5.7*10^(-6), 10.186, 175, 200, 5*10^(-8), 10000, .269, 1.5*10^(-7), 1.5, 2]);

t := [seq(i^2, i = 0 .. 50, 1)];

y1data := subs(sol, y1(t));
y1exp := [seq(y1data(t[i]), i = 1 .. 51)];

err := proc (c0, n, s0, ks, h1, h2, kp, A, B) local y1cal, y1val, lsq; sol(parameters = [c0, n, 175, s0, ks, h1, h2, kp, A, B]); y1cal := subs(sol, y1(t)); y1val := [seq(y1cal(t[i]), i = 1 .. 51)]; lsq := add((y1val[i]-y1exp[i])^2, i = 1 .. 51); lsq end proc;

val := NLPSolve(err, 10^(-8) .. 10^(-4), 2 .. 20, 150 .. 250, 10^(-2) .. 1, 100 .. 20000, 10^(-5) .. .4, 10^(-5) .. 1, .5 .. 2, 1 .. 10);
GlobalSolve(err, 10^(-10) .. 10^(-4), 2 .. 20, 150 .. 250, 0 .. 1, 100 .. 15000, 0 .. .5, 0 .. 1, .5 .. 2, 1 .. 5);

Error, (in GlobalOptimization:-GlobalSolve) `InertForms` does not evaluate to a module









I'm using the Global Optimization Toolbox to solve some examples and fit equations to a given data, finding "unknown" parameters. I generated the data on Excel, and I already know the values of these parameters.

The XY case is (there is no problem here, I just put as a example I follow):

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "I5:I25");
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "J5:J25");

> XY := zip( (X, Y) -> [X, Y] , X, Y);
> fig1 := plot(XY, style = point, view = [.9 .. 3.1, 6 .. 40]);

> Model := A+B*x+C*x^2+D*cos(x)+E*exp(x):
> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = -10 .. 10, D = 0 .. 10, E = 0 .. 10];

> ModelSubs := proc (x, val)

    subs({x = val}, Model)

    end proc;

> SqEr := expand(add((ModelSubs(x, X(i))-Y(i))^2, i = 1 .. 21));
> CoefList := GlobalSolve(SqEr, op(VarInterv), timelimit = 5000);

> Model := subs(CoefList[2], Model):


I could find the right values of A, B, C, D and E. 


My problem is in the XYZ case, where I don't know how to "write" the right instruction. My last attempt was:

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "Q5:Q25"); X2 := convert(X, list);
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "R5:R25"); Y2 := convert(Y, list);
> Z := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "S5:S25"); Z2 := convert(Z, list);
> NElem := numelems(X);

> pointplot3d(X2, Y2, Z2, axes = normal, labels = ["X", "Y", "Z"], symbol = box, color = red);


> Model := A*x+B*y+C*sin(x*y)+D*exp(x/y);

> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = 0 .. 10, D = 0 .. 10];

> ModelSubs:=proc({x,y},val)


end proc:
Error, missing default value for option(s)

> SqEr := expand(add((ModelSubs(x, y, X(i), Y(i))-Z(i))^2, i = 1 .. NElem));
> CoefList := GlobalSolve(SqEr, op(Range), timelimit = 5000);
Error, (in GlobalOptimization:-GlobalSolve) finite bounds must be provided for all variables


My actual problem involves six equations, six parameters and four or five independent variables on each equation, but I alread developed a way to solve two or more equations simultaneously.


We have just released a new, more powerful version of the Maple Global Optimization Toolbox.  

For this new release, Maplesoft has partnered with Noesis Solutions to develop a new version of the Maple Global Optimization Toolbox that is powered by Optimus technology. Optimus, from Noesis Solutions, is a platform for simulation process integration and design optimization that includes powerful optimization algorithms. This advanced technology is now available...


   The error showed up whenever I tried to do the Maximum Likelihood Estimation with Global Optimization Toolbox.My objective (likelihood ) function f is defined as follows(A1 to A5 are intermediate variables; parameters  are x[1] to x[12]):

   f := 0;

   for j from 1 by 1 to 21 do

       A1 := exp(x[1]+x[2]*c[j]);

       A2 := exp(x[3]+x[4]*c[j]);

Yesterday was one of those remarkable days when everything seems just about right. The highlight was an email message I received from a Prof. Fang from Ryerson University notifying us that we had been both nominated and awarded the Omond Solandt Award by the Canadian Operational Research Society for ongoing and outstanding contribution to the field of Operations Research (OR). No, it’s not a Nobel Prize or an Oscar, but whenever a group of smart people publically recognize our work, the honor and pride are genuine.

Page 1 of 1