Toolbox Questions and Posts Toolbox Questions and Posts Feed

These are Posts and Questions associated with the product, Toolbox




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.


Hi MaplePrimers,

I'm trying to solve a system of algebraic equations using 'solve' [float].  I'd prefer to use 'solve' over 'fsolve', as 'solve' solves my system in about 0.05s, whereas fsolve takes about 5 seconds.  I need to solve the system repeatedly at a different points, so time is important.  I don't know why there is such a large difference in time ... 

I have a few piecewise functions of order 3 to 5.  It solves fine with the other (piecewise) equations, but adding one piecewise function which gives me an error while trying to solve:

Error, (in RootOf) _Z occurs but is not the dependent variable.

I think this is due to solve finding multiple solutions.  Is there a way to limit solve to only real solutions?

Thanks in advance!

How would i go about integrating



I know it has to do something with arc tan but it doesnt match up completely what would I be able to do?

In this article I want to discuss the right way to store and build Maple code.

As mentioned in the Introducing the Maple IDE post, over 90 percent of the algorithms built into Maple are implemented using Maple language. The code of the algorithms is stored as Maple Libraries (.mla files).


Everyone knows that Maple combines a smart user interface with a highly sophisticated mathematical engine, where common tasks are performed quickly and seamlessly with point, click and drag operations. Of equal importance, however, is the fact that Maple is also backed by a comprehensive programming language. Also called "Maple", this language combines elements from procedural languages (like C), functional languages (like Lisp) as well as object oriented languages (like C++...


I've bought NAG C Library for my mac in order to use it in Maple.

However, it seems that Maple doesn't know where to search for it.
Indeed, it returns

Error, (in NAG:-h03abc) external linking: error loading external library libnagc_nag.dylib: dlopen(libnagc_nag.dylib, 129): image not found 

I've installed NAG C Library in usr/Library


Thank you very much for your help 

One of the most basic decisions a baseball manager has to make is how to arrange the batting order.  There are many heuristics and models for estimating the productivity of a given order.  My personal favourite is the use of simulation, but by far the most elegant solution from a mathematical perspective uses probability matrices and Markov chains.  An excellent treatment of this topic can be found in Dr. Joel S. Sokol's article,

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...


I have a model in MapleSim for which I've generated the optimized C code using the connector toolbox, and I'd like to work with it directly. I was wondering if there is any documentation or examples of how to do this? I haven't been able to find any online.


Hello everybody,

I' m trying to run completely The optmization template from a batch file (.bat) and wonder how to :

  1.  Make the buttons working automatically.
  2.  What  command should be used in a batch file to execute utterly a maple program
  3. What kind of script file can be perfect for Matlab / Maple.

The point is to run in parallel Matlab and Maple, using a script file(.bat) or another external script format.

i have a problem when i input this code in maple,..

how it can be error?

what the solve?

thanks for help me

the code:

> with(plots); with(DEtools); with(plottools); a := 0, 5; b := 0, 2; c := 0, 7; d := 0, 2; E := 0, 1;
                                    0, 5

Dear Readers,

Given an expression for e.g. x^n+ y^3.5, how to extract the symbolic/floating point exponent, I tried with degree method but it fails whenvever there is symbolic or floating point exponent. Is there any alternative ?




Regards, Satya

In the folders Maple 16: there is a file named MapleToolbox_Window.exe. What can I do with it?


if I have two partition Pi and Pi 'I want to know the decomposition of Pi' 

1 2 3 4 5 6 7 Last Page 2 of 11