Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 343 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

What is sFunction? If you wanted to plot sBox, then plots[listplot](sBox) can be used, with style=point or without, or Statistics:-BarChart(sBox), or Statistics:-PointPlot(sBox), or Statistics:-LineChart(sBox), or Statistics:-ColumnGraph(sBox), or Statistics:-AreaChart(sBox).

Alec

Printer driver might correct some of these things. I described what can be seen in GSview (in Windows). Perhaps, Linux is using different converter to eps.

Now, I printed it using my laser printer. Lines are still too thin. The difference between x-axis and y-axis width is not noticable though. The varying width of the curve is still noticable, especially from the left hand side. 0 is still positioned higher and more to the left than it should. It's definitely not camera-ready - lines are too thin and shifted 0.

I remember posting some ways of making plot of publishable quality about 3 years ago on this site - draw axes manually etc. It can be done (for 2D plots), but requires a lot of typing :)

Edit: Just uploaded both plot.ps and how it looks - plot.pdf.

Edit 2: Found a link to my post 3 years ago.

Alec

PS An interesting thing is that it would take just few lines in PostScript, or MetaPost to draw a perfect picture of this particular graph -Alec

Some simple 2D plots are more or less OK. But 3D plots are not. Well - maybe if they use CURVES - I didn't try that. That seems to depend on the plot structures used.

Edit. Just checked that particular example with x^2. Unfortunately - it isn't OK as well. Lines are too thin. The y-axis is wider than x-axis. The width of the x-axis decreases from the left hand side to the right hand side. The curve width is thinner than the axes width. The curve is visibly not smooth, a lot of short segments are seen, with color varying from dark grey to light grey. Text font is not very good. Minus touches 0 in -0.5 and is too long in -1 as well. 0 is positioned higher than other numbers on the x-axis, and is shifted to the left comparing with numbers on the y-axis. The eps file contains DSC errors (wrong %%Pages, for instance).

Alec

PS if you have an older Maple version, say Maple V or Maple 6, the difference can be clearly seen. -Alec

As far as I recall, eps export produced good quality plots (if they didn't include text) in old Maple versions, something like Maple V and Maple 6. However, there were still some bugs in it - in particular, with the bounding box. They could be easily corrected manually though.

Sometime around Maple 8 or Maple 9 eps export was changed to produce the same poor quality plots as in other graphics formats, so it seems to be not usable at the moment.

Some people print plot structures to a file (if possible) and then use some other graphics tools to produce publishing quality plots. But it is more simple just use other CAS - such as SAGE (which is free), or Mathematica, or Matlab.

Alec

The following works in all examples above,

fas := (f, h) -> evalindets(f,
    'function',
    proc (F) 
        local a; 
        _Env_FunctionAdvisor_verbose := false; 
        a := op([1, 2],
            FunctionAdvisor('specialize',F,h)); 
        if a = (1, 2) then F else a end if 
    end proc
);

For example,

fas(HeunB(alpha,0,0,0,z)+HeunB(alpha,1,2,3,z),BesselI);
                                         /alpha\
                   2                     |-----|       2
          alpha   z              alpha   \  4  /      z
  BesselI(-----, ----) GAMMA(1 + -----) 2        exp(----)
            4     2                4                  2
  --------------------------------------------------------
                             /alpha\
                             |-----|
                             \  4  /
                       /  2 \
                       | z  |
                       |----|
                       \ 2  /

         + HeunB(alpha, 1, 2, 3, z)

Alec

PS Probably, it is also a good idea to add an option 'avoid', so for some specific conversions, such as to hypergeom, prevent converting such things as exponents, for example, to hypergeom. -Alec

It also doesn't work in Alejandro Jakubi's example.

I just tried the following,

fas:=(f,g,h)->evalindets(f,specfunc(anything,g),
    F->op([1,2],FunctionAdvisor(specialize, F,h))):

It works in Alejandro Jakubi's example,

fas(ln(4*HeunB(alpha,0,0,0,2*z)+5),HeunB,WhittakerM);

                               alpha     2         2
               4 WhittakerM(0, -----, 4 z ) exp(2 z )
                                 4
            ln(-------------------------------------- + 5)
                              /      alpha\
                              |1/2 + -----|
                              \        4  /
                            2
                        (4 z )

and it also works with sin,

fas(sin(x) + Si(x), sin, cos);

                                  Pi
                        -cos(x + ----) + Si(x)
                                  2

However, it still doesn't work right if an expression contains 2 functions of the same type, one of them not convertable by FunctionAdvisor, as in

fas(HeunB(alpha,0,0,0,z)+HeunB(alpha,1,2,3,z),HeunB,BesselI);
BesselI form for HeunB(alpha,1,2,3,z) is unknown to the system

                                         /alpha\
                   2                     |-----|       2
          alpha   z              alpha   \  4  /      z
  BesselI(-----, ----) GAMMA(1 + -----) 2        exp(----)
            4     2                4                  2
  -------------------------------------------------------- + (1, 2)
                             /alpha\
                             |-----|
                             \  4  /
                       /  2 \
                       | z  |
                       |----|
                       \ 2  /

Alec

The following works in all 3 examples,

fas:=(f,g)->evalindets(f,'function',
    F->op([1,2],FunctionAdvisor(specialize, F,g))):

fas(2*sin(x), cos);
                                       Pi
                           -2 cos(x + ----)
                                       2

Alec

I often do rounding (or evalfing) to Digits/2 digits. That seems to be working OK with procedures in the Optimization package.

Alec

Set twice as many digits as necessary and then round to half of them. That usually good enough.

Alec

Set twice as many digits as necessary and then round to half of them. That usually good enough.

Alec

As usual in such cases, the answers should be rounded, and after that will satisfy the constraints.

Alec

What do you mean by maximizing the two distances AC and BC? Maximizing of their sum? Would maximizing of the distance between A and B be good enough?

With the given description, A can be any point on the first surface, B can be any point on the second surface, and C can be found in the triangle ABT - it belongs to this triangle because the sum of angles is 360 degrees.

For example, one can choose A=Q and B=S - in this case C can be found as

T:=<-1/2,-sqrt(3)/2,0>:
C:=simplify(Student:-LinearAlgebra:-Normalize(T)*sqrt(6)/3);
                                 [   1/2]
                                 [  6   ]
                                 [- ----]
                                 [   6  ]
                                 [      ]
                            C := [   1/2]
                                 [  2   ]
                                 [- ----]
                                 [   2  ]
                                 [      ]
                                 [  0   ]

but that doesn't give the maximal possible distance between A and B, which can be found numerically as

Digits:=50;
Optimization:-Maximize(
(x^2-2*x*x1+x1^2+y^2-2*y*y1+y1^2+z^2-2*z*z1+z1^2),
[((x-1)*x+y^2+z*(z-2^(1/2)))<=
    (x^2-2*x+1+y^2+z^2)^(1/2)*(x^2+y^2+(z-2^(1/2))^2)^(1/2)*(-1/2),
((x1+.5)*x1+(y1-1/2*3^(1/2))*y1+z1*(z1+2^(1/2)))<=
    ((x1+.5)^2+(y1-1/2*3^(1/2))^2+z1^2)^(1/2)*(x1^2+y1^2+(z1+2^(1/2))^2)^(1/2)* (-1/2)] ,
initialpoint={x=0.,y=0.,z=1.4,x1=0.,y1=0.,z1=-1.4},
iterationlimit=10000);

  [8.1068573568932429948450711882419848469456512046164, [

        x = 0.20900828721929509855749372290032000436215101169524,

        x1 = -0.11909928245049037658422077838848462671859967267401,

        y = -0.016853014677241137784700532294613882145324480264344,

        y1 = 0.17257997899476339620053756605330815264740462412371,

        z = 1.4109675687739151713428845085848428410846956205996,

        z1 = -1.4109675687739151713428848374439038731027167230894]]

with A=<x,y,z> and B=<x1,y1,z1>, and few last digits should be discharged. In this case,

C:=evalf((A+B)/2+Normalize(T-(A+B)/2)*Norm(A-B)/2/sqrt(3));

  C :=

        [-0.36601126456211906471370215142443360835944093368602]

        [-0.63395010636412432525211006390698263585743961460865]

        [                                                       -25]
        [-0.4042852158498854283239052002723336497270506172655 10   ]

with

Norm(A-C);
         1.6438630677860857028013503100457476963688872976097

Norm(B-C);
         1.6438630677860857028013522804687256238377757565536

which is greater than in the first example with A=Q and B=S with AC=BC=2*sqrt(6)/3,

evalf(2*sqrt(6)/3);
         1.6329931618554520654648560498039275946439649871045

Alec

What do you mean by maximizing the two distances AC and BC? Maximizing of their sum? Would maximizing of the distance between A and B be good enough?

With the given description, A can be any point on the first surface, B can be any point on the second surface, and C can be found in the triangle ABT - it belongs to this triangle because the sum of angles is 360 degrees.

For example, one can choose A=Q and B=S - in this case C can be found as

T:=<-1/2,-sqrt(3)/2,0>:
C:=simplify(Student:-LinearAlgebra:-Normalize(T)*sqrt(6)/3);
                                 [   1/2]
                                 [  6   ]
                                 [- ----]
                                 [   6  ]
                                 [      ]
                            C := [   1/2]
                                 [  2   ]
                                 [- ----]
                                 [   2  ]
                                 [      ]
                                 [  0   ]

but that doesn't give the maximal possible distance between A and B, which can be found numerically as

Digits:=50;
Optimization:-Maximize(
(x^2-2*x*x1+x1^2+y^2-2*y*y1+y1^2+z^2-2*z*z1+z1^2),
[((x-1)*x+y^2+z*(z-2^(1/2)))<=
    (x^2-2*x+1+y^2+z^2)^(1/2)*(x^2+y^2+(z-2^(1/2))^2)^(1/2)*(-1/2),
((x1+.5)*x1+(y1-1/2*3^(1/2))*y1+z1*(z1+2^(1/2)))<=
    ((x1+.5)^2+(y1-1/2*3^(1/2))^2+z1^2)^(1/2)*(x1^2+y1^2+(z1+2^(1/2))^2)^(1/2)* (-1/2)] ,
initialpoint={x=0.,y=0.,z=1.4,x1=0.,y1=0.,z1=-1.4},
iterationlimit=10000);

  [8.1068573568932429948450711882419848469456512046164, [

        x = 0.20900828721929509855749372290032000436215101169524,

        x1 = -0.11909928245049037658422077838848462671859967267401,

        y = -0.016853014677241137784700532294613882145324480264344,

        y1 = 0.17257997899476339620053756605330815264740462412371,

        z = 1.4109675687739151713428845085848428410846956205996,

        z1 = -1.4109675687739151713428848374439038731027167230894]]

with A=<x,y,z> and B=<x1,y1,z1>, and few last digits should be discharged. In this case,

C:=evalf((A+B)/2+Normalize(T-(A+B)/2)*Norm(A-B)/2/sqrt(3));

  C :=

        [-0.36601126456211906471370215142443360835944093368602]

        [-0.63395010636412432525211006390698263585743961460865]

        [                                                       -25]
        [-0.4042852158498854283239052002723336497270506172655 10   ]

with

Norm(A-C);
         1.6438630677860857028013503100457476963688872976097

Norm(B-C);
         1.6438630677860857028013522804687256238377757565536

which is greater than in the first example with A=Q and B=S with AC=BC=2*sqrt(6)/3,

evalf(2*sqrt(6)/3);
         1.6329931618554520654648560498039275946439649871045

Alec

Yes.

Both of them are very good.

Alec

 

Yes.

Both of them are very good.

Alec

 

First 107 108 109 110 111 112 113 Last Page 109 of 180