Question: Simply question

Today I have received this e-mail:

A MaplePrimes member has sent you a message on MaplePrimes.


Hi Mark,

You very kindly helped me out with an optimization type problem I had a few weeks back. Thanks for that! (http://www.mapleprimes.com/questions/146802-Global-Maximum-Of-Function-Over-Defined-Range?rid=460092)

However, I am a little stuck in using the same procedure with a different function. I think perhaps DirectSearch/maple does not like the integrals in the function.

I get the error message:
Error, (in evalf/int) invalid arguments

I would be very grateful if you could help. I would have posted this problem on maple primes except i thought you would probably know the answer straight away.

Cheeeers
Bob
------------------------------------------------
These are my commands:


y := proc (E) options operator, arrow; -_C4*MathieuS(-a, -q, E)*(Int(MathieuC(-a, -q, E)*(-a+2*q*cos(2*E)), E))+_C4*(Int(MathieuS(-a, -q, E)*(-a+2*q*cos(2*E)), E))*MathieuC(-a, -q, E)-_C2*MathieuC(-a, -q, E)-_C3*MathieuS(-a, -q, E)-_C4*MathieuS(-a, -q, E)*MathieuCPrime(-a, -q, E)+_C4*MathieuSPrime(-a, -q, E)*MathieuC(-a, -q, E) end proc


with(DirectSearch)


MAXforY := proc (consta, constb, constc, aa, qq, A, B) if A <= B then DirectSearch:-GlobalSearch(eval(y(E), [_C2 = consta, _C3 = constb, _C4 = constc, a = aa, q = qq]), {E <= B, A <= E}, maximize, solutions = 1) else print(Inconsistent*input) end if end proc

MAXforY(1, 0, -4911.05, .2, .7, 0, 300000)

I think that the question is of interest for entire MaplePrimes community.

Please Wait...