Alejandro Jakubi

MaplePrimes Activity


These are answers submitted by Alejandro Jakubi

Setting the prettyprinter to line mode by interface(prettyprint=0) generates output that may be later reread as input.

The relevant difference here is that applyrule does not "map" over the operands of the equation, while algsubs does. So, you have to use it on its lhs only like:

> applyrule(-eta*(int(q[i], i = 0 .. M__n))-eta*q[k] = -eta*(int(q[i], i = 0 .. M__n)), 
> alpha-gamma*q[k]-eta*(int(q[i], i = 0 .. M__n))-eta*q[k] );
                           M__n
                          /
                         |
                   -eta  |      q[i] di - gamma q[k] + alpha
                         |
                        /
                          0

Note, on the other hand, that for symbolic computations like this one, it would be much better to use an inert form of the integral, with Int or %int. With the active form int, this command makes unnecessary computations trying to calculate the integral.

Automatic simplification makes the transformation u0(s)*u0(s) ==> u0(s)^2 before any evaluation/computation occurs. You can see it by enclosing the expression inside unevaluation quotes, and then evaluating it:

> 'u0(s)*u0(s)';
                                          2
                                     u0(s)
> %;
                                                 2
                             laplace(u0(t), t, s)

So, one way of bypassing it is postponing the identification to a later stage, like:

> eval(invlaplace(u0(s)*ul(s),s,t),ul=u0);
                            t
                           /
                          |
                          |   u0(_U1) u0(t - _U1) d_U1
                          |
                         /
                           0

The Standard GUI is not really designed for such demanding programming usage. If your source code becomes over 2000 lines, you would better begin thinking about using an editor and running your code in the CLI.

In case it was an error in the process, I would suggest to try download/installing again.

Just my approach. I use Maple's CLI mainly through an IDE like editor. So, I write code in the editor, launch Maple by pressing a configurable key, get the output in a separate window and if the session does not stop as in your example, just press the IDE stop button, which stops the mserver immediately (with high success rate). No restart of the IDE is needed, etc. Much more practical, in my opinion.

Something similar can be done, but by using parameters with the evaln modifier (see ?parameter_modifiers ), like here:

> M:=<<1,2>|<3,4>>:
> f:=proc(x::evaln)
> print(x=eval(x));
> end proc:
> f(M);
                                      [1    3]
                                  M = [      ]
                                      [2    4]

May be that there is no such command... Commands are basically executed by the (C) kernel. This is "historical Maple". Later, a second Java subsytem was added and the Standard GUI was implemented in it with its own "kernel". It has even its own parser (for the 2D language). Now, menues in the Standard GUI run basically on Java code, and a substantial part of this GUI (Java) functionality has no programatic (C) counterpart. For the specific case of the plots you are asking about, strong evidence exist that the menu way runs fully in Java code.

Probably, the simplest way to transform these boolean constructions into sets is "solving" them, like:

> solve(a1,{x});
                      {95 <= x, x < 100}, {x <= 5, 0 < x}
> solve(a2,{x});
                                {0 < x, x < 100}

About finding these undocumented features, well it is a bit of detectivesque work...The Maple system is, in a sense, like an iceberg, only a small fraction of its procedures are made visible and documented to the users. So, you need a map to explore this vast hidden land. A version of such map is provided by the "Edit" facility of the browser LibraryTools:-Browse. Note, however, that this browser is quite buggy and the information it provides is somewhat limited. Hence, nowadays, I am using mainly custom made library mapping facilities.

This rule is more generic:

> rule3:=a::integer*w[1]/(1+1/exp(mu[p]))^2+
a::integer*(-w[1]+1)/(1+1/(exp(mu[p])*exp(eta[p2])))^2 = a*s[3]: > map2(applyrule,rule3,tmp); [ 3 2 ] [1 + (2 s[3] - s[2] - s[4]) s[1] + (-s[2] + s[3]) s[1] - s[2] s[1]] [ ] [ 3 ] [ (-2 s[3] + s[2] + s[4]) s[1] ]

It may depend on the details of your calculation, whether this is generic enough.

The result is false for Arrays because their memory addresses are different. Compare:

> a:=[1,2,3]:
> b:=[1,2,3]:
> evalb(a=b);    #The result is true
                                      true
> addressof~([a,b]); #same address
                            [3035816778, 3035816778]
> c:=Array([1,2,3]):
> d:=Array([1,2,3]):
> evalb(c=d);    #The result is false
                                     false
> addressof~([c,d]); #different addresses
                            [3034218946, 3034219010]

Chances are that there was a download error. So, you may try downloading/installing again. A problem with the download pages is that they do not provide checksums (MD5, etc).

Not so simple as it should be. Nevertheless, one route is using some undocumented commands available in recent versions of the package MathematicalFunctions, as here:

> s1:= {0<x, x<100}:
> s2:= {5<x, x<95}:
> MathematicalFunctions:-`&Minus`(s1,s2);
                 Or(And(95 <= x, x < 100), And(x <= 5, 0 < x))
> MathematicalFunctions:-`&Union`(s1,s2);
                              And(0 < x, x < 100)

For some other workarounds, see e.g. these threads:

unions of ranges?

Union of two sets of solution

 

Actually, inspection of the code shows that this error message occurs all the same for any symbolic entries like here:

> alias(DS=DynamicSystems):
> A:=Matrix( [[2,a],[b,1]]):
> B:=Matrix([[0],[1]]):
> sys:=DS:-StateSpace(A,B); 
                        sys := State Space (continuous)
> m:=DS:-Grammians(sys);
Error, (in DynamicSystems:-Grammians) symbolic value(s) in model: a, b

Meaning that whether these symbolic entries are function calls of t, or something else, makes no difference.

Yes, there is nothing in the help page that says that symbolic entries, function calls included, are not supported. Actually, it is frequently the case that help pages do not specify or are ambiguous about the admisible input types.

You can use the command line interface (CLI) cmaple.exe for such batch processing. The Standard GUI maplew.exe does not seem to be designed for this purpose.

3 4 5 6 7 8 9 Last Page 5 of 29