Items tagged with directsearch directsearch Tagged Items Feed

 

How to prove the inequality x^(4*y)+y^(4*x) <= 2 provided x^2+y^2 = 2, 0 <= x, 0 <= y? That problem was posed  by Israeli mathematician nicked by himself as arqady in Russian math forum and was not answered there.I know how to prove that with Maple and don't know how to prove that without Maple. Neither LagrangeMultipliers nor extrema work here. The difficulty consists in the nonlinearity both the target function and the main constraint. The first step is to linearize the main constraint and the second step is to reduce the number of variables to one.

restart; A := eval(x^(4*y)+y^(4*x), [x = sqrt(u), y = sqrt(v)]);

(u^(1/2))^(4*v^(1/2))+(v^(1/2))^(4*u^(1/2))

(1)

 

B := expand(A);

u^(2*v^(1/2))+v^(2*u^(1/2))

(2)

C := eval(B, u = 2-v);

(2-v)^(2*v^(1/2))+v^(2*(2-v)^(1/2))

(3)

It is more or less clear that the plot of F is symmetric wrt  the straight line v=1. This motivates the following change of variable  to obtain an even function.

F := simplify(expand(eval(C, v = z+1)), symbolic, power);

(1-z)^(2*(z+1)^(1/2))+(z+1)^(2*(1-z)^(1/2))

(4)

NULL

The plots suggest the only maximim of F at z=0 and its concavity.

Student[Calculus1]:-FunctionPlot(F, z = -1 .. 1);

 

Student[Calculus1]:-FunctionPlot(diff(F, z, z), z = -1 .. 1);

 

As usually, numeric global solvers cannot prove certain inequalities. However, the GlobalSearch command of the DirectSearch package indicates the only local maximum of  F and F''.NULL

Digits := 25; DirectSearch:-GlobalSearch(F, {z = -1 .. 1}, maximize, solutions = 3, tolerances = 10^(-15)); DirectSearch:-GlobalSearch(diff(F, z, z), {z = -1 .. 1}, maximize, solutions = 3, tolerances = 10^(-15));

Array([[0.8e-23, [z = -0.1980181305884928531875965e-12], 36]])

(5)

The series command confirms a local maximum of F at z=0.

series(F, z, 6);

series(2-(2/3)*z^4+O(z^6),z,6)

(6)

The extrema command indicates only the value of F at a critical point, not outputting its position.

extrema(F, z); extrema(F, z, 's');

{2}

(7)

solve(F = 2);

RootOf((1-_Z)^(2*(_Z+1)^(1/2))+(_Z+1)^(2*(1-_Z)^(1/2))-2)

(8)

DirectSearch:-SolveEquations(F = 2, {z = -1 .. 1}, AllSolutions, solutions = 3);

Matrix(1, 4, {(1, 1) = 0., (1, 2) = Vector(1, {(1) = 0.}), (1, 3) = [z = -0.5463886313e-6], (1, 4) = 27})

(9)

DirectSearch:-SolveEquations(F = 2, {z = -1 .. 1}, AllSolutions, solutions = 3, assume = integer);

Matrix(1, 4, {(1, 1) = 0., (1, 2) = Vector(1, {(1) = 0.}), (1, 3) = [z = 0], (1, 4) = 30})

(10)

NULL

 PS. I see my proof needs an additional explanation. The DirectSearch command establishes the only both local and global  maximum of F is located at z= -1.98*10^(-13) up to default error 10^(-9). After that  the series command confirms a local maximum at z=0. Combining these, one draws the conclusion that the global maximum is placed exactly at z=0 and equals 2. In order to confirm that the only real root of F=2 at z=0  is found approximately and exactly by the DirectSearch.

Download maxi.mw

Let us consider the maximum value of the polynomial

x^4+c*x^2+x^3+d*x-c-1

on the interval x=-1..1 as a function g of the parameters c and d. General considerations suggest its continuity. However, a plot3d of g does not  confirm it.  Also the question arises "Is the function g(c,d) bounded from below?". Here is my try with the DirectSearch and NLPSolve:

 

restart;
``

g(10, -10)

9.

(1)

plot(x^4+x^3+10*x^2-10*x-10-1, x = -1 .. 1)

 

plot3d(g, -5 .. 5, -5 .. 5, grid = [100, 100], style = surface, color = "DarkOliveGreen")

 

DirectSearch:-GlobalOptima(proc (a, b) options operator, arrow; g(a, b) end proc, {a = -1000 .. 1000, b = -1000 .. 1000}, variables = [a, b])

[-167.208333252089, Vector(2, {(1) = 999.9999999975528, (2) = 166.20833325208952}, datatype = float[8]), 815]

(2)

DirectSearch:-GlobalOptima( (a, b) -> g(a, b), variables = [a, b])

DirectSearch:-GlobalOptima(proc (a, b) options operator, arrow; g(a, b) end proc, variables = [a, b])

Error, (in Optimization:-NLPSolve) invalid input: PolynomialTools:-CoefficientVector expects its 1st argument, poly, to be of type polynom(anything, x), but received HFloat(HFloat(undefined))*x^4+HFloat(HFloat(undefined))*x^3+HFloat(HFloat(undefined))*x^2+HFloat(HFloat(undefined))*x+HFloat(HFloat(undefined))

 

``

 

Download bound.mw

 

Executing HelpTools:-Database:-ConvertAll(): produced file DirectSearch.help apparently without content. How can all content within DirectSearch.hdb be converted to a .help file accessible through help in Maple 2016?

So I installed copied DirectSearch.hdp and DirectSearch.mla into my Maple2015\lib directory and the program works (all the functions are there) but I cant get help menu by querying ?DirectSearch.

I'm running win7 64bit btw

so under

?hdb

i put this into maple:

HelpTools:-Database:-ConvertAll();

but i get error....

"Converting C:\\Program Files\\Maple 2015\\lib\\DirectSearch.hdb to C:\\Program Files\\Maple 2015\\lib\\DirectSearch.help"
Warning, .hdb help databases are deprecated, 'C:\Program Files\Maple 2015\lib\DirectSearch.hdb' will not be used, see ?HelpTools,Migrate help page for more information
Error, (in HelpTools:-HelpCallUI) cannot create help database: 'unable to open database file'

any clue?

ps I asked the same question for M18 but I managed to get the help to work in that instance.

http://www.mapleprimes.com/questions/204423-Help-Build-For-GlobalSearch-Package

(i also copied DirectSearch.hdp and DirectSearch.mla to Maple2015\bin.X86_64_WINDOWS directory but no joy, there is no .help file created in either bin or lib directories)

@Markiyan Hirnyk   I try not to use this package, as I think the results are not reliable enough. Here is the example, where instead of the three real roots it finds only one, despite the hint to look for the three roots:

restart;

DirectSearch:-SolveEquations(100^x=x^100, AllSolutions, solutions=3);

 

There are many other examples, particularly in discrete optimization in which it returns false results. Here is one example (well-known to you).

hi, the equations read as 

eq:=[2*x-0.2e-1*y-2.04*sqrt(-v^2+1)*v, 2*y-0.2e-1*x-2.16*sqrt(-u^2+1)*u, 2*u+2.16*u^2*y/sqrt(-u^2+1)-2.16*sqrt(-u^2+1)*y, 2*v+2.04*v^2*x/sqrt(-v^2+1)-2.04*sqrt(-v^2+1)*x] ;

i do as follows using DirectSearch package v.2

i find the solutions not the same,some time the results not much difference,but another,sols1 have one solution,sols2 have three solutions.in some time,some solutions are lost,the result show  me  random.may i have run the command serveral times? regards.

hello

I have a system of equation. to solve i using DirectSearch pakage. i think in answer DirectSearch use rounding number but in answer it's second and third digit after the decimal point is important. please help me. bbw.mw

if b and c increase 0.01 and -0.01 it's ok. another main question is why by increasing the intensity answer don't change.

hi

i want to use Direct Search Package for solve system of equation but i have an error:

Error, SolveEquations is not a command in the DirectSearch package.

please help me. code is attached.boltmohasebe.mw

I solve the problem on computational geometry: "A cube of side one contains two cubes of sides a and b having non-overlapping interiors. How to prove the inequality a+b≤1?" To this end I use the DirectSearch package , namely,

Here are some comments to it. The cube of side a is centered at (x_1,y_1,z_1) and rotated by the angles phi_1, psi_1, theta_1 (see http://uk.wikipedia.org/wiki/%D0%95%D0%B9%D0%BB%D0%B5%D1%80%D0%BE%D0%B2%D1%96_%D0%BA%D1%83%D1%82%D0%B8 ) and the cube of side b is centered at (x_2,y_2,z_2) and rotated by the angles phi_2, psi_2, theta_2. The procedure

calculates the distance between these cubes, for example,

st := time(); dist(.2, .9, .2, .2, .2, .7, .7, .7, 0, 0, 0, 0, 0, 0); time()-st;

[HFloat(5.453016092898238e-11), [s1 = HFloat(0.2646161775314957),

  s2 = HFloat(0.2828503247068887),

  s3 = HFloat(0.29444713116943216),

  t1 = HFloat(0.2646161774916062),

  t2 = HFloat(0.28285032471998384),

  t3 = HFloat(0.2944471311346344)], 2527]
                            191.133
Unfortunately, my code (which is syntactically correct) is spinning on my wondercomp during 10 hours without any output. I don't understand it at all. Your advices are welcome.

twocubes.mw

I want to find the greatest value of this expression 

f:=(x,y,z)->sqrt((x+1)*(y^2+2)*(z^3+3))+sqrt((y+1)*(z^2+2)*(x^3+3))+sqrt((z+1)*(x^2+2)*(y^3+3));

with x>0, y>0 , z>0,x+y+z=3.

I tried

restart:

 f:=(x,y,z)->sqrt((x+1)*(y^2+2)*(z^3+3))+sqrt((y+1)*(z^2+2)*(x^3+3))+sqrt((z+1)*(x^2+2)*(y^3+3));

DirectSearch[GlobalOptima](f(x,y,z), {x>0, y>0 , z>0,x+y+z=3},maximize);

I got the output

[HFloat(infinity), [x = .591166078050740e52, y = .183647204560715e52, z = .786638021216969e52], 1249]

 

 

hi

DirectSearch answer has confused me. How to reduce the residual.
See the program.Direct.mw

in maple 15

https://drive.google.com/file/d/0B8F2D27rfQWgVXE1alN0V3JWU1U/edit?usp=sharing

there are 3 equation to be minimized

and i limit x between x + 5 and x - 5 as constraints

 

though f1 got a error in first line of command,

later i type a correct command for f1 in later part of script

hello

please compare result of DirectSearch and implicitplot. which of them is correct??

please help me.please......

resul.mw

 

 

how i can trust in DirectSearch solution result.is there any creteria?

my variable is intensity.

this is my code:

ep0 := 1/(4*3.14); el := 8.54*10^(-2); hbar := 1; vf := 1/300; kb := 1; tem := 2.586*10^(-2); ci := 1; p := 1.458*10^16; beta := 2; ai := 7.1*10^(-4); bi := ai/sqrt(3); enph := .196; d := enph/(kb*tem); n0 := 1/(exp(enph/(kb*tem))-1); gama := hbar*vf; intensity := 10000001; w := 1.55; impurity := 7.2*10^3;

g := hbar*beta/(bi^2*sqrt(2*p*enph)); aa := g^2*(n0+1)/(2*Pi*hbar*gama^2); bb := g^2*n0/(2*Pi*hbar*gama^2); cc := 2/(Pi*gama^2); l := (1*hbar)*w/(2*kb*tem);u := el^2*intensity/(32*w*hbar^2);

 

DirectSearch:-SolveEquations([op([((enph*ln(1+exp(c+enph/(kb*tem)))/(kb*tem)-polylog(2, -exp(c))+polylog(2, -exp(c+enph/(kb*tem))))*enph*(kb*tem)^2-(enph^2*ln(1+exp(c+enph/(kb*tem)))/(kb^2*tem^2)+2*enph*polylog(2, -exp(c+enph/(kb*tem)))/(kb*tem)+2*polylog(3, -exp(c))-2*polylog(3, -exp(c+enph/(kb*tem))))*(kb*tem)^3+(-exp(b)*enph*ln(1+exp(c+enph/(kb*tem)))+exp(c+d)*enph*ln(1+exp(b-d+enph/(kb*tem)))+exp(b)*kb*tem*polylog(2, -exp(c))-exp(c+d)*kb*tem*polylog(2, -exp(b-d))-exp(b)*kb*tem*polylog(2, -exp(c+enph/(kb*tem)))+exp(c+d)*kb*tem*polylog(2, -exp(b-d+enph/(kb*tem))))*enph*(kb*tem)^2/((exp(b)-exp(c+d))*kb*tem)+(exp(b)*enph^2*ln(1+exp(c+enph/(kb*tem)))-exp(c+d)*enph^2*ln(1+exp(b-d+enph/(kb*tem)))+2*exp(b)*enph*kb*tem*polylog(2, -exp(c+enph/(kb*tem)))-2*exp(c+d)*enph*kb*tem*polylog(2, -exp(b-d+enph/(kb*tem)))+2*exp(b)*kb^2*tem^2*polylog(3, -exp(c))-2*exp(c+d)*kb^2*tem^2*polylog(3, -exp(b-d))-2*exp(b)*kb^2*tem^2*polylog(3, -exp(c+enph/(kb*tem)))+2*exp(c+d)*kb^2*tem^2*polylog(3, -exp(b-d+enph/(kb*tem))))*(kb*tem)^3/((exp(b)-exp(c+d))*kb^2*tem^2))*bb+u*(1/(1+exp(-l-c))-1/((1+exp(-l-c))*(1+exp(l-b))))-(((1*enph)*(enph-2*kb*tem*ln(1+exp(-b+enph/(kb*tem))))/(2*kb^2*tem^2)+2*kb^2*tem^2*(-polylog(2, -exp(-b+enph/(kb*tem)))+polylog(2, -cosh(b)+sinh(b))))*enph*(kb*tem)^2-(enph^2*(enph-3*kb*tem*ln(1+exp(-b+enph/(kb*tem))))-6*kb^2*tem^2*(enph*polylog(2, -exp(-b+enph/(kb*tem)))+kb*tem*(-polylog(3, -exp(-b+enph/(kb*tem)))+polylog(3, -cosh(b)+sinh(b)))))*(kb*tem)^3/(3*kb^3*tem^3)-(-exp(b)*enph^2+exp(c+d)*enph^2-2*exp(c+d)*enph*kb*tem*ln(1+exp(-b+enph/(kb*tem)))+2*exp(b)*enph*kb*tem*ln(1+exp(-c-d+enph/(kb*tem)))+2*exp(c+d)*kb^2*tem^2*polylog(2, -exp(-b))-2*exp(b)*kb^2*tem^2*polylog(2, -exp(-c-d))-2*exp(c+d)*kb^2*tem^2*polylog(2, -exp(-b+enph/(kb*tem)))+2*exp(b)*kb^2*tem^2*polylog(2, -exp(-c-d+enph/(kb*tem))))*enph*(kb*tem)^2/((2*(-exp(b)+exp(c+d)))*kb^2*tem^2)-(exp(b)*enph^3-exp(c+d)*enph^3+3*exp(c+d)*enph^2*kb*tem*ln(1+exp(-b+enph/(kb*tem)))-3*exp(b)*enph^2*kb*tem*ln(1+exp(-c-d+enph/(kb*tem)))+6*exp(c+d)*enph*kb^2*tem^2*polylog(2, -exp(-b+enph/(kb*tem)))-6*exp(b)*enph*kb^2*tem^2*polylog(2, -exp(-c-d+enph/(kb*tem)))+6*exp(c+d)*kb^3*tem^3*polylog(3, -exp(-b))-6*exp(b)*kb^3*tem^3*polylog(3, -exp(-c-d))-6*exp(c+d)*kb^3*tem^3*polylog(3, -exp(-b+enph/(kb*tem)))+6*exp(b)*kb^3*tem^3*polylog(3, -exp(-c-d+enph/(kb*tem))))*(kb*tem)^3/((3*(-exp(b)+exp(c+d)))*kb^3*tem^3))*aa-u*(1/(1+exp(l-b))-1/((1+exp(-l-c))*(1+exp(l-b)))) = 0, -cc*polylog(2, -exp(b))+cc*polylog(2, -exp(-c))-impurity = 0])], tolerances = 10^(-8), evaluationlimit = 20000)

 

hello

1-DirectSearch results is like this:

[0.,[0.], [x = -.400000000000000], 11]


x=.4 is the answer of SolveEquations (code is in the second question) please interpret other terms.

2-how can i save only x?

this is my code:

restart;

a := Matrix([1, 2, 3, 4, 5]);

for k from 1 by 1 to 5 do

z = DirectSearch:-SolveEquations(a(1, k)*x+2 = 0)

end do

 

1 2 Page 1 of 2