acer

32490 Reputation

29 Badges

20 years, 8 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Christopher2222 The Standard GUI (since Maple 13 or so...) doesn't re-scan `libname` locations to update the Help path, when `libname` is altered in a open, running worksheet. Rather, it scans the locations when it launches, and that happens after it runs an initialization file (if present). So appending to `libname` in a valid personal initialization file ought to work.

But here's something else you could try. Put those three files in the location that this command returns. You may have to use an appropriate path separator (for adjusting the output, but not this input command which ought to work cross-platform).

cat(kernelopts(':-homedir'),"/maple/toolbox/Advisor/lib");
Then close the GUI entirely, including all open worksheets, and then relaunch that Maple version's GUI.

@leiniu The ordinate is x and the abscissa is r1 (I think).

I suppose that you could also use the following Maple command to see "axes".

plot([[0,0]], background=Bif,
     view=[-1.5 .. 5, -0.5 .. 4], axes=box );

Is this also interesting:

Bif2:=Bifurcation( [x,y], [eqs[2],eqs[1]],
                   ':-rvariable' = r1,
                   ':-xmin'=-0.05, ':-xmax'=0.3,
                   [0.5,0.5], -1.6, 6,
                   ':-height'=600, ':-width'=600 ):
ColouringProcedures:-HueToRGB( Bif2 ):
Embed( Bif2 );

The following may be a shorter, related example.

restart;
ee:={(exp(1))^(Y/(exp(Y)-1))+(exp(1))^(Y*exp(Y)/(exp(Y)-1))-1};
solve(ee,Y);

In Maple 15.01 the following produced just Warning, solutions may have been lost. But in later versions it produces error messages. And in my Maple 2016.1 it emits a long set of unexpected messages (and then takes a long time). In my Maple 2015.2 it generates the kind of error message you showed (quickly).

I have submitted a bug report.

acer

@leiniu You don't need me to send you a command for exporting an Image to a file, because Maple already has a command for that (as I mentioned above). It is called ImageTools:-Write, and you can read its Help Page.

The personal file folders on your machine will surely be different than they are on my machine. So you might not have a folder named "mapleprimes". You'll have to choose your own location.

You pass the file location to ImageTools:-Write as a string. For example, if the Image has been assigned to the name A in Maple,

ImageTools:-Write( "C:/Users/leiniu/My Documents/somename.bmp", A );

@vv Maple 18.02 and 2015.2 (64bit Linux) get that float value from symbolic `int` using either the ftoc or ftocms methods. But yes, in Maple 2016.0 that input generates this error message.

restart;
int((abs(sin(2.0*x))-abs(sin(x)))/x, x = 0 .. infinity);
Error, (in int) wrong number (or type) of arguments:
invalid options or option values passed to exact integration

Speaking of efficiency, I really ought to have pulled the FitIntensity(ToGrayscale(A)) out of that loop...

SetBackground:=proc(A::Array, C::string)
  local g,i,p,T;
  uses ImageTools;
  if not type(A,'Array(:-datatype=float[8])') then
    error "expecting an Image for the first argument";
  end if;
  if nops([op(2,A)])<>3 then
    error "expecting a color Image with exactly three layers";
  end if;
  p:=[ColorTools:-Color(C)[]];
  g:=FitIntensity(ToGrayscale(A));
  for i from 1 to 3 do
    T[i]:=Threshold(g,0.001,method=both,low=p[i],high=0.0);
    T[i]:=T[i]+GetLayer(A,i);
  end do;
  CombineLayers(T[1],T[2],T[3]);
end proc:

It would be neat to have a highly efficient color mapping command, to swap out pixels in an Image of a given color (or those "close enough" in some color space) with another color.

@itsme I submitted a bug report on the day it was posted.

@Joe Riel Since there is only one distinct instance of the particular SUM in the kernel's simplification table then it suffices here to sort the polynomial, which affects other references to it.

restart;

ee := sqrt(1+x+x^2);

                                             (1/2)
                                 / 2        \     
                           ee := \x  + x + 1/     

ff := tan(1+x+x^2);

                                     / 2        \
                            ff := tan\x  + x + 1/

sort( 1+x+x^2, [x], ascending ):

ee;

                                          (1/2)
                              /         2\     
                              \1 + x + x /     

ff;

                                  /         2\
                               tan\1 + x + x /
Whenever I see this trick I think of how it might be thread-unsafe.

@Christopher2222 In Maple 2016 a call to simplify(...) made from the top-level does a final step of (additonally) doing what simplify(...,size) does. But when called from within a procedure such a plain call to simplify(...) does not do that.

Either behaviour can be overridden by forcing an (undocumented) option in the call. Ie,

restart;
interface(prettyprint=0):

dint := proc (a, b, c, d)
  simplify(subs(b = d, int(a, b))-subs(b = c, int(a, b)),
           applysimplifysize = true):
end proc:

dint(exp(x^3),x,1,2);

    (1/6)*(I*3^(1/2)-1)*(GAMMA(1/3, -8)-GAMMA(1/3, -1))

restart;
interface(prettyprint=0):

dint := proc (a, b, c, d)
  simplify(subs(b = d, int(a, b))-subs(b = c, int(a, b))):
end proc:

dint(exp(x^3),x,1,2);

  -(1/6)*GAMMA(1/3, -8)+((1/6)*I)*GAMMA(1/3, -8)*3^(1/2)+
   (1/6)*GAMMA(1/3, -1)-((1/6)*I)*GAMMA(1/3, -1)*3^(1/2)

simplify(%, applysimplifysize = false);

  -(1/6)*GAMMA(1/3, -8)+((1/6)*I)*GAMMA(1/3, -8)*3^(1/2)+
   (1/6)*GAMMA(1/3, -1)-((1/6)*I)*GAMMA(1/3, -1)*3^(1/2)

This is a slightly tricky area, because it seems as if quite a few people seem to think that simplify(...,size) is designed to do everything that (non-top-level, or as in previous releases) plain simplify(...) does, yet with additional compactification. The help pages makes it clear that's not the case.

Under IntegrationTools:-Definite:-Integrators:-FTOC:-FindDisconts (after trying for an antiderivative) the call to discont fails hard because it doesn't know how to handle 2-argument GAMMA.

acer

@Kitonum Nicely done. I did this before I saw your response, but I may as well throw it in...

E_T := (2/mu-2/r)*exp(-r/mu)*Pi^2;

L1:=map(u->`if`(u::polynom,content(u),1),
        map(numer,[op(E_T)])):
new:=`*`(L1[])*`*`(zip(`/`,[op(E_T)],L1)[]);
Naturally, this is not general purpose. Don't take op of E_T if it's not of type `*`.

This is a good question. It's a shame that Maple offers a literal subscript (both via keyboard shortcuts and Layout palette) but no direct and easy way to get a literal superscript.

acer

You may not have to utilize lprint. You should be able to copy and paste the particular 2D Input for which you had done the conversion, for use later on.

Note that the fact that you converted one a particular instance of the 2D Input T[4]^0 does not mean that you can subsequently type in T[4]^0 as input (1D or 2D) any place afterwards and have it be valid as the LHS of a colon-equals assignment statement.


 

restart;

subsup:=proc(a,b,c)
  uses Typesetting;
  # Using the Typeset command below gets us nice upright
  # Roman integers, and a few other nice frills.
  nprintf(`#msubsup(%a,%a,%a)`,
          convert([Typeset(a),Typeset(b),Typeset(c)],`global`)[]);
end proc:

subsup(T,4,Int(f(x),x));

`#msubsup(mi("T"),mn("4"),mrow(mstyle(mo("&int;",msemantics = "inert"),mathcolor = "#909090"),mrow(mi("f"),mo("&ApplyFunction;"),mfenced(mi("x"))),mspace(width = "0.3em"),mstyle(mo("&DifferentialD;",msemantics = "inert"),mathcolor = "#909090"),mi("x")))`

subsup(T,4,0);

`#msubsup(mi("T"),mn("4"),mn("0"))`

`#msubsup(mi("T"),mn("4"),mn("0"))`

`#msubsup(mi("T"),mn("4"),mn("0"))`

`#msubsup(mi("T"),mn("4"),mn("0"))` := 99

99

`#msubsup(mi("T"),mn("4"),mn("0"))`

99

assign( subsup(T,4,0), 43.2 );

`#msubsup(mi("T"),mn("4"),mn("0"))`

43.2

K := '`#msubsup(mi("T"),mn("4"),mn("0"))`';

`#msubsup(mi("T"),mn("4"),mn("0"))`

assign(eval(K,1), 1000);

`#msubsup(mi("T"),mn("4"),mn("0"))`

1000

# Or cut and paste the 2D thing above
# (from any of the 2D Input or Output places, because
# of the way it was done). Here's what get's pasted:

`#msubsup(mi("T"),mn("4"),mn("0"))`;

1000

`#msubsup(mi("T"),mn("4"),mn("0"))` := 13;

13

`#msubsup(mi("T"),mn("4"),mn("0"))`

13

 


 

Download msubsup.mw

First 292 293 294 295 296 297 298 Last Page 294 of 594