Items tagged with directsearch directsearch Tagged Items Feed

@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

 

The DirectSearch package is a powerful Maple  tool. However, every soft has its advantages and disadvantages. In particular, the DS has problems in the case of a thin feasible set in higher dimensions. Recently a serious bug in the DS was detected by me. Solving an optimization problem, the DirectSearch produces the error communication

Warning, initial point [x1 = 1., x2 = 1., x4 = 2., y1 = 2., y2 = 3., y4 = 2.] does not satisfy the inequality constraints; trying to find a feasible initial point
Error, (in DirectSearch:-Search) cannot find feasible initial point; specify a new one
 while that initial point satisfies the constraints.

 

restart

DirectSearch:-Search(((x2-x1)^2+(y2-y1)^2)*((x4-x1)^2+(y4-y1)^2), {seq(parse(y || j) >= -(2/3)*parse(x || j)+2, j = 1 .. 4), seq(parse(y || j) >= (1/2)*parse(x || j)-3/2, j = 1 .. 4), seq(parse(y || j) <= 4, j = 1 .. 4), seq(parse(y || j) <= -3*parse(x || j)+16, j = 1 .. 4), seq(parse(y || j) <= 2*parse(x || j)+2, j = 1 .. 4), (x2-x1)*(x4-x1)+(y2-y1)*(y4-y1) = 0, (x3-x2)*(x2-x1)+(y3-y2)*(y2-y1) = 0, (x4-x1)*(x4-x3)+(y4-y1)*(y4-y3) = 0, (x4-x3)*(x3-x2)+(y4-y3)*(y3-y2) = 0}, maximize, initialpoint = [x1 = 1, x2 = 1, x3 = 2, x4 = 2, y1 = 2, y2 = 3, y3 = 3, y4 = 2])

Error, (in DirectSearch:-Search) cannot find feasible initial point; specify a new one

 

eval({seq(parse(y || j) >= -(2/3)*parse(x || j)+2, j = 1 .. 4), seq(parse(y || j) >= (1/2)*parse(x || j)-3/2, j = 1 .. 4), seq(parse(y || j) <= 4, j = 1 .. 4), seq(parse(y || j) <= -3*parse(x || j)+16, j = 1 .. 4), seq(parse(y || j) <= 2*parse(x || j)+2, j = 1 .. 4), (x2-x1)*(x4-x1)+(y2-y1)*(y4-y1) = 0, (x3-x2)*(x2-x1)+(y3-y2)*(y2-y1) = 0, (x4-x1)*(x4-x3)+(y4-y1)*(y4-y3) = 0, (x4-x3)*(x3-x2)+(y4-y3)*(y3-y2) = 0}, [x1 = 1, x2 = 1, x3 = 2, x4 = 2, y1 = 2, y2 = 3, y3 = 3, y4 = 2])

{0 = 0, -1 <= 2, -1 <= 3, 2 <= 4, 2 <= 6, 2 <= 10, 2 <= 13, 3 <= 4, 3 <= 6, 3 <= 10, 3 <= 13, -1/2 <= 2, -1/2 <= 3, 2/3 <= 2, 2/3 <= 3, 4/3 <= 2, 4/3 <= 3}

(1)

``

 

Download opti.mw

Hi,

Previously I got some great help from Markiyan Hirnyk who introduced me to the DirectSearch package. I am having a little trouble implementing it for this function:

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

Hi,

I'm using the DirectSearch package in a 10 periods model and in the first period i get this values:

"
> DirectSearch[SolveEquations](sys, assume = positive);
Warning, complex or non-numeric value encountered; trying to find a feasible point
[HFloat(1.1842542076623546e-32),

Vector[column](%id = 18446744078126621390), [

x1a = HFloat(4204.651582462925),

x1c = HFloat(4204.651582462925),

i'm using DirectSearch package to solve the following system of equations (in order to find x1a,x1c,x2a,x2c):

How can i limit the solutions just for positive values of x1a,x2a,x1c,x2c? (Currently, I'm just using  

Thanks

Gil

1 2 Page 1 of 2