acer

33188 Reputation

29 Badges

20 years, 206 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Honigmelone You may use applyrule across the elements of a Vector (or Matrix or Array) with the map2 command.

So, as an alternative to converting to and from list, and using your code above,

map2(applyrule,[rule,rule2],f_symbol);

What would you hope to see as the results for the following examples?

a:=.123456789:

1.0 * a;
1.00 * a;

0.10 * a;
0.100 * a;

acer

In such a numeric computation environment as you are envisioning what result would be produced for the calculation of 0.1 * 1/3 ? Note that the second multiplicand is the exact rational one-third.

How many decimal digits would you hope to see in the floating-point result of that, if it were not to simply use the current Digits value? To what would it dynamically adjust the working precision?

acer

@Markiyan Hirnyk 

1) It is nicer to get just the last result from those you obtained from solve. Your taking the last of the multiple solutions you obtained is very much only done "by hand". It is neater to add the n>0 assumption and get just the single, desired result.

2) actually what I showed works with the `abs` as well.

solve( {abs(1 - n^2/(n^2+31*n+228)) < eps}, n, useassumptions )
  assuming eps>0, eps<1, n>0;

                                               2                  1/2
                         -31 eps + 31 + (49 eps  - 1010 eps + 961)
                        {-------------------------------------------- < n}
                                            2 eps

 

@Markiyan Hirnyk  Perhaps that approach can work out, if modified somewhat. We can get rid of the `abs` since n^2/(n^2+31*n+228) is approaching 1 from below.

restart;

sol := solve( {1 - n^2/(n^2+31*n+228) < eps}, n, useassumptions )
         assuming eps>0, eps<1, n>0;

                                                      2                  1/2
                                -31 eps + 31 + (49 eps  - 1010 eps + 961)
                        sol := {-------------------------------------------- < n}
                                                   2 eps

eval(sol, eps=9*10.0^(-2));

                                            {320.6343580 < n}

eval( abs(1 - n^2/(n^2+31*n+228)), n=320.0);

                                              0.0901659736

eval( abs(1 - n^2/(n^2+31*n+228)), n=321.0);

                                               0.0899046105

[edit] I saw your followup only after I submitted this. I've given a looser restriction on positive epsilon, and the additional assumption n>0 gets only the single result from `solve` (ie. the one we want).

Have you tried the command kernelopts(numcpus=40) or used some other values? How does that affect the performance?

How much benefit (if any) do you see from your current use of Threads:-Seq over using just seq?

It sounds as if you might be expecting Maple to set numcpus (by default) according to the hyperthreading feature of your cores. That does not necessarily improve performance across applications, and success or detriment of that can vary with the particular chipset.

You haven't said much about the nature of the "complicated procedure". How expensive is each individual call to it? (If very expensive then perhaps a Grid package solution might help.) Do you know that the procedure is threadsafe? Is its computation symbolic or numeric?

acer

@Age Those single right-quotes are called uneval quotes. There is a help page with the topic uneval.

What you've called algebraic is usually referred to as an expression. You are figuring out that some commands like fsolve, plot, etc, accept the first argument in either opertor form or expression form.

This is a common stumbling block for new users, and you have done much better than most at figuring it out on your own.

Search for the colloquial term "premature evaluation" (alongside "Maple") for examples of others' difficulties with all this.

Why do you need to restart?

Is it because you want to undo the name bindings (to the package exports) of the earlier calls to with?

If so then instead of restart you could use unwith.

acer

Honigmelone, it's not entirely clear what your expectation and objections are here.

What parts in particular, if any, do you object to in the following. Please show your response explicitly.

restart;
assume(a(t),real);
getassumptions(a(t));
                                              {a(t~)::real}

assume(b(t),real);
getassumptions(a(t));
                                              {b(t~)::real}

restart;
alias(a=a(t),b=b(t)):
assume(a,real);
getassumptions(a);
                                              {a(t~)::real}

assume(b,real);
getassumptions(a);
                                              {b(t~)::real}

restart;
alias(a=a(t),b=b(t)):
assume(a,real);
getassumptions(a);
                                              {a(t~)::real}

additionally(b,real);
getassumptions(a);
                                        {a(t~)::real, b(t~)::real}

You seem to have saved your worksheet in Maple 18.00. Is that right?

acer

@vv I don't see why one would expect something different there.

restart;

alias(a=a(t)):

:-a(t)(t) - a(t);
                                                    0

a - :-a(t);
                                                    0

The thing you are trying to subtract is :-a(t)(t).

dismantle(a(t));

FUNCTION(3)
   FUNCTION(3)
      NAME(4): a
      EXPSEQ(2)
         NAME(4): t
   EXPSEQ(2)
      NAME(4): t

The behavior in question is in `assume`, and I don't see that `alias` has much to do with it (other than its use having obscured the details).

I'll note this too,

restart;
getassumptions(a(x))  assuming b()(x)::real;
                                              {b()(x)::real}

@gw_g It's not so much that "the author of the worksheet possibly could provide..." the ability to change paremeters and execute "...by his design". [emphasis mine]

Rather it relevant that achieving execution following changing of parameters is wholly intended to be done in the MaplePlayer via Embedded Components. That is what the Player is good for.

If you use the side panel in the Player and change its drop menu to "MathApps" and browse down (down arrow tip) you can find a variety of worksheets that provide various kinds of interactive computation.

The author of your .mws worksheets did not set up the worksheets to provide interactivity via Embedded Components. So the MaplePlayer is merely a viewer for such worksheets. And clearly the author of those worksheets which you possess had no intention of using Embedded Components since they were saved in the older .mws format which doesn't even support Embedded Components.

Complaining that the MaplePlayer does not provide any interactivity for worksheets that are not authored to provide interactivity via Embedded Components makes little sense, because Embedded Components is THE mechanism by which the Player offers interactivity and recomputation.

 

@terryma You are welcome.

Look at the long list of names that get printed when you execute with(MTM). All those names are then bound to various exports of the MTM package.

You can always call the original, global name using the colon-dash syntax, such as :-subs(...) for example, even if you have rebound the subs name by loading a package such as MTM.

You can also call the MTM export by using its long form name, such as MTM:-fourier(...) for example, even if you don't load the whole MTM package.

So, you can always force what you want, whether you load the package or not. The available syntax allows you to force things either way.

@Kitonum I mentioned it mostly because it affects whether the integral is -infinity for t<0, which happens with a factor of s^(5/2) in the numerator but not with a factor of s^(11/2).

Using Maple 2015.2, I get,

restart;
int((1/2)/(s^(1/2)*GAMMA(1/2)*(t^(1/2)-s^(1/2)))*(s^3),
    s = 0 .. t, AllSolutions);

                           { -infinity        t < 0
                           {
                           {     0            t = 0
                           {
                           { infinity         0 < t

restart;
int((1/2)/(s^(1/2)*GAMMA(1/2)*(t^(1/2)-s^(1/2)))*(s^6),
    s = 0 .. t, AllSolutions);

                                   infinity

@Kitonum Did you perhaps mistype that s^(5/2) subterm?

Your insistence in using floating-point coefficients before doing your symbolic integrations, even though it would be trivial and reasonable to turn them into very short exact rationals and the benefits have been demonstrated before, is four-alarm crazy.

acer

First 324 325 326 327 328 329 330 Last Page 326 of 607