There are two problems with (2). First, Rootof is misspelled, it should be RootOf. Second, y is an expression, not a function (procedure); to evaluate it you should use eval.
Now I have another problem. I don't understand how maximize works. WARNING, the last line of the following Maple worksheet runs forever (at least on my PC):
y := 3*cos(4*Pi*x-1.3)+5*cos(2*Pi*x+0.5);
maximize(y, x=0..1);
I don't think a faster computer will help much. To see this, you could do the following with command line maple (I wouldn't do this in the Standard GUI, since its output bogs down)
printlevel := 100:
maximize(y, x=0..1);
On a linux box, or with cygwin on Windows, you might try, from a shell
$ cat << EOF | maple -q | sed -n '/enter\|exit/p' | more
> y := 3*cos(4*Pi*x-1.3)+5*cos(2*Pi*x+0.5);
> printlevel := 100:
> maximize(y, x=0..1);
> EOF
Changing periodics to 2*Pi and taking the derivative one wants the zeros of
-6*sin(2*xi-13/10)-5*sin(xi+1/2), where the first zero stands for the maximum.
The following is a symbolic solution for it (but my Maple falls into agony
if trying to convert that to Reals only), check it by numerical evaluation.
May be I say a bit more about that later.
I find it interesting that method=branchandbound works here. I would never have found that from reading the help page for Optimization[Maximize]. The Optimization,Options help page doesn't suggest that this option is available for Minimize/Maximize, but imply it is for LPSolve and NLPSolve.
You are correct, as mention in the last bullet of the Description section:
- The Minimize and Maximize commands call one of the Optimization[LPSolve],
Optimization[QPSolve] or Optimization[NLPSolve] commands, depending on the
form of the input.
I should read the entire help page before complaining.
Comments
typo and use eval
There are two problems with (2). First, Rootof is misspelled, it should be RootOf. Second, y is an expression, not a function (procedure); to evaluate it you should use eval.
Maximize
Joe,
Thank you.
Now I have another problem. I don't understand how maximize works. WARNING, the last line of the following Maple worksheet runs forever (at least on my PC):
View 4937_Page 2 Joe Riel.mw on MapleNet or Download 4937_Page 2 Joe Riel.mw
View file details
The offending line is:
Can anybody help me understand how maximize works or do I need a faster PC?
"The Cray-3 is so fast it can execute an infinite loop in under 2 seconds!"
Try Optimization:-Maximize
The statements in question are
I don't think a faster computer will help much. To see this, you could do the following with command line maple (I wouldn't do this in the Standard GUI, since its output bogs down)
On a linux box, or with cygwin on Windows, you might try, from a shell
To solve this problem you can do
local or global optimum
The value x=0.68 returned from Optimization:-Maximize(y,x=0..1) is a local optimum. The graph of y, plot(y, x=0..1), shows that.
acer
manually
splitting the periodics manually also works Optimization:-Maximize(y,x=0..1/2); [5.78110318870717600, [x = 0.0512129818925790292]]a symbolic solution
Symbolic Solution
How did you make that?
Can you upload a Maple worksheet that I can download?
I don't understand "changing periodics".
Global
Acer,
You make it look easy. Thank you.
curious
I find it interesting that method=branchandbound works here. I would never have found that from reading the help page for Optimization[Maximize]. The Optimization,Options help page doesn't suggest that this option is available for Minimize/Maximize, but imply it is for LPSolve and NLPSolve.
options passed through
I thought that Maximize/Minimize passed options through (here, to NLPSolve).
acer
yes
You are correct, as mention in the last bullet of the Description section:
I should read the entire help page before complaining.