Question: DirectSearch finds nonexisting roots

DirectSearch finds nonexisting roots....     DirectSearch_finds_nonexisting_roots.mw

 

restart

plot([cos(x), 0.001*x*x],x=-40..40,y=0..2)     ### test function plot

 

eq:= cos(x)= 0.001*x*x;     ###   float

cos(x) = 0.1e-2*x^2

(1)

use RealDomain in solve(eq,x,explicit) end use   ## lacking some of the roots

-7.793210110, 7.793210110, -11.11953559, 11.11953559, -4.734809278, 4.734809278, -1.568336644, 1.568336644

(2)

use RealDomain in solve(eq,x) end use

-7.793210110, 7.793210110, -11.11953559, 11.11953559, -4.734809278, 4.734809278, -1.568336644, 1.568336644

(3)

fsolve(eq,x=-30)

-31.17938383

(4)

plot([cos(x), 0.001*x*x],x=-32..-31,y=0.9..1)

 

fsolve(eq,x=-32..-30);  fsolve(eq,x=-31.7..-31.4)

-31.17938383

 

-31.52634294

(5)

with(DirectSearch)

[BoundedObjective, CompromiseProgramming, DataFit, ExponentialWeightedSum, GlobalOptima, GlobalSearch, Minimax, ModifiedTchebycheff, Search, SolveEquations, WeightedProduct, WeightedSum]

(6)

eq;
SolveEquations(eq,AllSolutions):

cos(x) = 0.1e-2*x^2

(7)

interface(rtablesize=90);
SolveEquations(eq, AllSolutions)

90

 

Matrix(%id = 4800942722)

(8)

DirectSearch finds nonexisting roots!!!

Dr. Ali GÜZEL

 

Download DirectSearch_finds_nonexisting_roots.mw

Please Wait...