Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 339 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

You, probably, use one of earlier Maple versions. It works in Maple 10. Both typechecking constructions are equivalent in Maple 10 (inside if), with :: being slightly faster,
t:=RandomTools:-Generate(list(integer,1000000)):
f1:=proc() local n; if args::nonnegint then n:=1 else n:=0 fi end:
f2:=proc() local n; if type(args,nonnegint) then n:=1 else n:=0 fi end:
gc();
time(map(f2,t));

                                15.078
gc();
time(map(f1,t));

                                13.015
I did more time testing and the results are consistent. That's why and because it is also shorter, I prefer using :: __________ Alec Mihailovs http://mihailovs.com/Alec/
Check ?plot,option and links near the bottom of it. tickmarks is the option for doing that. title is another option. It should look like title="some string", with title in lower case - Maple is case sensitive, and with right hand side being a string, i.e. being included in double quotes. Also, values of y from -10 to 10 won't work great in this case, because your function values are near 100. __________ Alec Mihailovs http://mihailovs.com/Alec/
Check ?plot,option and links near the bottom of it. tickmarks is the option for doing that. title is another option. It should look like title="some string", with title in lower case - Maple is case sensitive, and with right hand side being a string, i.e. being included in double quotes. Also, values of y from -10 to 10 won't work great in this case, because your function values are near 100. __________ Alec Mihailovs http://mihailovs.com/Alec/
It is somewhat possible in Classic Maple using textplot, but "}" is too bold, so that doesn't look nice,
plots[display](
  plots[textplot]([[0,3,"x + 2 y = 0"], 
    [0,2,"x + 4y + 3z = 5"], [0,1,"x + y + z = 0"]],
    font=[TIMES,BOLDITALIC,12]),
  plots[textplot]([2.4,2.4,"}"],font=[TIMES,ROMAN,70]),
axes=none,view=[-6..9,-6..9]);
It doesn't work in Standard Maple because view option seems to be broken there. __________ Alec Mihailovs http://mihailovs.com/Alec/
It is somewhat possible in Classic Maple using textplot, but "}" is too bold, so that doesn't look nice,
plots[display](
  plots[textplot]([[0,3,"x + 2 y = 0"], 
    [0,2,"x + 4y + 3z = 5"], [0,1,"x + y + z = 0"]],
    font=[TIMES,BOLDITALIC,12]),
  plots[textplot]([2.4,2.4,"}"],font=[TIMES,ROMAN,70]),
axes=none,view=[-6..9,-6..9]);
It doesn't work in Standard Maple because view option seems to be broken there. __________ Alec Mihailovs http://mihailovs.com/Alec/
Yes, it works in Maple 10, but it doesn't work in earlier versions. I don't have Maple 9 on this computer, but I checked that the following works in Maple 9.5,
Calc:=proc()
  local t;
  global m,Timer;
   use Maplets, Maplets:-Elements in
    Timer:=proc() 
      t:=iolib(25);
      while iolib(25)-t<3 do od end;
    m:=Maplet(
      'onstartup'=Action(RunWindow('Splash'),
        Evaluate(function="Timer"), CloseWindow('Splash'), 
        RunWindow('Main')),      
      Window['Splash']('title'="Welcome",
        [Label(Image("E:\\image.jpg"))]),
      Window['Main']('title'="Calculator",
        'width'=640, 'height'=480, []));
    Display(m) end use end:

Calc();
One should replace E:\\image.jpg with a link to the image. __________ Alec Mihailovs http://mihailovs.com/Alec/
Yes, it works in Maple 10, but it doesn't work in earlier versions. I don't have Maple 9 on this computer, but I checked that the following works in Maple 9.5,
Calc:=proc()
  local t;
  global m,Timer;
   use Maplets, Maplets:-Elements in
    Timer:=proc() 
      t:=iolib(25);
      while iolib(25)-t<3 do od end;
    m:=Maplet(
      'onstartup'=Action(RunWindow('Splash'),
        Evaluate(function="Timer"), CloseWindow('Splash'), 
        RunWindow('Main')),      
      Window['Splash']('title'="Welcome",
        [Label(Image("E:\\image.jpg"))]),
      Window['Main']('title'="Calculator",
        'width'=640, 'height'=480, []));
    Display(m) end use end:

Calc();
One should replace E:\\image.jpg with a link to the image. __________ Alec Mihailovs http://mihailovs.com/Alec/
Georgios, What you get, can be done just as
x1+y1+z1;

                 [14, 15, 16, 13, 12, 11, 19, 18, 17]
I don't see how that related to his problem. Perhaps, you meant
Vector(x1).Vector(y1)+Vector(y1).Vector(z1)+Vector(z1).Vector(x1)+a;

                               615 + a
or
add(x1[i]*y1[i]+y1[i]*z1[i]+z1[i]*x1[i]+a,i=1..9);

                              615 + 9 a
__________ Alec Mihailovs http://mihailovs.com/Alec/
Georgios, What you get, can be done just as
x1+y1+z1;

                 [14, 15, 16, 13, 12, 11, 19, 18, 17]
I don't see how that related to his problem. Perhaps, you meant
Vector(x1).Vector(y1)+Vector(y1).Vector(z1)+Vector(z1).Vector(x1)+a;

                               615 + a
or
add(x1[i]*y1[i]+y1[i]*z1[i]+z1[i]*x1[i]+a,i=1..9);

                              615 + 9 a
__________ Alec Mihailovs http://mihailovs.com/Alec/
If func1 and func2 in fsolve are not equations (as in this example), then fsolve solves the system of equations {func1=0, func2=0). {x=a..b,y=c..d} tells that the solution should satisfy these conditions - x between a and b, and y between c and d. After some experimentations it should become clear that for the second value of k (close to 7.4) the tangent line to the curve is horisontal - that means that the first derivative is 0 at that point. Also, it is clear that it is an inflection point - that means that the second derivative is 0. For the first value of k (close to 4.5) the situation is slightly different - in that case the first, the second, and the third derivatives are 0. Since there are 2 unknowns, x, and k, the system good for solving should have 2 equations. I chose the second and the third derivatives because they change more rapidly at that point than the first derivative does, so it is easier for fsolve to find solutions. __________ Alec Mihailovs http://mihailovs.com/Alec/
If func1 and func2 in fsolve are not equations (as in this example), then fsolve solves the system of equations {func1=0, func2=0). {x=a..b,y=c..d} tells that the solution should satisfy these conditions - x between a and b, and y between c and d. After some experimentations it should become clear that for the second value of k (close to 7.4) the tangent line to the curve is horisontal - that means that the first derivative is 0 at that point. Also, it is clear that it is an inflection point - that means that the second derivative is 0. For the first value of k (close to 4.5) the situation is slightly different - in that case the first, the second, and the third derivatives are 0. Since there are 2 unknowns, x, and k, the system good for solving should have 2 equations. I chose the second and the third derivatives because they change more rapidly at that point than the first derivative does, so it is easier for fsolve to find solutions. __________ Alec Mihailovs http://mihailovs.com/Alec/
Another possibility is to use an option in a module. It doesn't provide such unique type checking, but it is easy to use,
demo1 := module()
  export New;
  local ModuleLoad;
    ModuleLoad := proc()
      TypeTools:-AddType('abcd', 
        x->type(eval(x,2),'And'('`module`','attributed(abcd)'))) end;
    New := proc()
      module() option abcd; end end;
    ModuleLoad();
end:

m2 := demo1:-New():
type( m2, abcd );
                                 true
__________ Alec Mihailovs http://mihailovs.com/Alec/
Well, I'll post here values with 100 digits, and you can easily get more :)
Digits:=100:

fsolve({diff(h3d(x,k),x),diff(h3d(x,k),x,x)},{x=0..40,k=3..9});

  {k = 7.400440848315302765167038232957419577297476432902563662056\
        490588253571383516334981890957252682040895, 
   x = 32.7118226\ 
        3298704917256466385867897726084231272381453699470095350128\
        590543972593666800386193671386922}

fsolve({diff(h3d(x,k),x,x),diff(h3d(x,k),x,x,x)},{x=0..40,k=3..9});

  {k = 4.486645549752612902368306021318062533435298382327812806814\
        665820760072631094645733641558565790506992, 
   x = 28.4423157\  
        2096965142579905499529202880216451551339048949143819162063\
        806982876568090045137372799412865}
__________ Alec Mihailovs http://mihailovs.com/Alec/
Well, I'll post here values with 100 digits, and you can easily get more :)
Digits:=100:

fsolve({diff(h3d(x,k),x),diff(h3d(x,k),x,x)},{x=0..40,k=3..9});

  {k = 7.400440848315302765167038232957419577297476432902563662056\
        490588253571383516334981890957252682040895, 
   x = 32.7118226\ 
        3298704917256466385867897726084231272381453699470095350128\
        590543972593666800386193671386922}

fsolve({diff(h3d(x,k),x,x),diff(h3d(x,k),x,x,x)},{x=0..40,k=3..9});

  {k = 4.486645549752612902368306021318062533435298382327812806814\
        665820760072631094645733641558565790506992, 
   x = 28.4423157\  
        2096965142579905499529202880216451551339048949143819162063\
        806982876568090045137372799412865}
__________ Alec Mihailovs http://mihailovs.com/Alec/
What variables? Post the result that you would like to get and I'll show how to get it. __________ Alec Mihailovs http://mihailovs.com/Alec/
First 150 151 152 153 154 155 156 Last Page 152 of 180