Sergey Moiseev

Sergey Moiseev

398 Reputation

13 Badges

15 years, 238 days
Sergey N. Moiseev received M.S., Ph.D. and Dr.Sc. degrees in radio physics from the Voronezh State University, Voronezh, Russia in 1986, 1993 and 2003, respectively. From 1984 to 2003 the topics of his research have included theory and methods of signal processing, nonlinear optimization, decision-making theory, time series prediction, statistical radio physics, ionosphere sporadic channel models. He is currently a principal scientist in the JSC Kodofon, Voronezh, Russia. His current research interests are wide spread in the area of the communications.

MaplePrimes Activity

These are answers submitted by Sergey Moiseev

You can also use command SolveEquations from DirectSearch package to solve the problem.


You can disable all warnings by command: interface(warnlevel=0);

@Markiyan Hirnyk Because objective function has many local minimums we can use global optimizers GlobalOptima and (or) GlobalSearch from DirectSearch package. These optimizers take very long time to optimize, but they solve the problems:




The sum of the squared residuals being about 0.00006 for both global optimizers.

The objective function (that optimized) has many local minimums. So we need a good initial point. For example:

startpoint:=initialpoint=[a =3,b=2,c=3,d=5,e=0.7];

Try OrthogonalExpansions package to approximate univariate and multivariate functions.

First variant.
    1. Find the directory where your Maple installed.
    2. Find the subdirectory \lib\
    3. Copy the following two files into this subdirectory:
        DirectSearch.mla – Maple Archive File,
        DirectSearch.hdb – Maple Help file.

Second variant.
    1. Create the directory, for example, C:\DirectSearchLib\
    2. Copy the following two files into this directory:
        DirectSearch.mla – Maple Archive File,
        DirectSearch.hdb – Maple Help file.
    3. In current Maple session execute the command:
        > libname:=”C:\\DirectSearchLib”, libname;

Since the objective function ObjFn depends on 6 variables and the constraints ModCons depend on 14 variables we must set all variables explicitly. So the local solution:



eval(ModCons, [seq(var[i]=sol[2][i],i=1..nops(var))]);

Try local solution several times because I obtain each time different solutions - due to deterministic chaos, I think.

The multimodal solutions:


eval(ModCons, [seq(var[i]=sol2[1][2][i],i=1..nops(var))]);

The global solution (very very slow):


eval(ModCons, [seq(var[i]=sol3[2][i],i=1..nops(var))]);

It is hard root to find by numerical methods. For example, how to find real root of the following equation:
      piecewise(x<> Pi, 1+x^2, 0)=0
by pure numerical methods ? The pure numerical methods must fail even if time of computation is infinity, because the set of real numbers is continuum. Remedy is symbolic or mixed symbolic-numeric methods:

solve(piecewise(x<> Pi, 1+x^2, 0)=0);


velocity:=piecewise(t<=6, 3*sin(t*Pi/6), t>6, 0);
n:=10; # number of fourier series terms

plot([piecewise(t<=6, 3*sin(t*Pi/6), t>6, 0),9/(5*Pi)+(45/16)*(-cos((2/5)*Pi)+1)*cos((1/10)*t*Pi)/Pi+(45/16)*sin((2/5)*Pi)*sin((1/10)*t*Pi)/Pi-(45/11)*(-cos((1/5)*Pi)+1)*cos((1/5)*t*Pi)/Pi+(45/11)*sin((1/5)*Pi)*sin((1/5)*t*Pi)/Pi-(45/56)*(cos((1/5)*Pi)+1)*cos((3/10)*t*Pi)/Pi+(45/56)*sin((1/5)*Pi)*sin((3/10)*t*Pi)/Pi-(45/119)*(cos((2/5)*Pi)+1)*cos((2/5)*t*Pi)/Pi-(45/119)*sin((2/5)*Pi)*sin((2/5)*t*Pi)/Pi-(45/299)*(cos((2/5)*Pi)+1)*cos((3/5)*t*Pi)/Pi+(45/299)*sin((2/5)*Pi)*sin((3/5)*t*Pi)/Pi-(45/416)*(cos((1/5)*Pi)+1)*cos((7/10)*t*Pi)/Pi-(45/416)*sin((1/5)*Pi)*sin((7/10)*t*Pi)/Pi-(45/551)*(-cos((1/5)*Pi)+1)*cos((4/5)*t*Pi)/Pi-(45/551)*sin((1/5)*Pi)*sin((4/5)*t*Pi)/Pi-(45/704)*(-cos((2/5)*Pi)+1)*cos((9/10)*t*Pi)/Pi+(45/704)*sin((2/5)*Pi)*sin((9/10)*t*Pi)/Pi-(18/175)*cos(t*Pi)/Pi],t=0..20)

fsolve command gives infinity number of solutions for various b:


{a = 2.32 - 1. b, b = b, pa = 1.000000000 - 0.4310344828 b, pb = 0.4310344828 b }

I try solve problem by DirectSearch package v.2. I cannot find any problem to maximize function f and to solve equation df=0.




SolveEquations command from DirectSearch package finds all four solutions in one step:

DirectSearch:-SolveEquations(x^3-3*2^x+3=0, AllSolutions);

The DirectSearch package finds two solutions:



sol:=GlobalSearch(T1, tolerances=10^(-14), distance=10^(-6));


sol:=SolveEquations(T1, AllSolutions, distance=10^(-6));


It seems there are only two solutions, see plot:


Firstly, when your model function is procedure the first parameters must be independent variables followed by function parameters (see Help for DataFit). So procedure FuncH:=proc(p,pi,d,ttt) ... you should replace by FuncH:=proc(ttt,p,pi,d)...

Secondly, in the first variant, when function F is used, the procedure H := PDE(p, pi, d) is computed ONE TIMES for all 80 points pkt. In the second variant, when function FuncH is used, the procedure H := PDE(p, pi, d) is computed 80 times for all 80 points pkt.

Therefore, the second variant must be approximately 80 times slowler than the first variant.

Increase Digits to round(evalhf(Digits)).

1 2 3 4 Page 2 of 4