acer

32385 Reputation

29 Badges

19 years, 334 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

Try it with a call to `combine` around that problematic expression, ie,

combine( simplify( 2/Pi^2*zabt(n) + 4/Pi^2*dwabt(n) ) );

I am seeing this,

expr := (exp(-n*(cos(phi)+sin(phi)))
         *(-16*n^8+4*sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)*n^6+116*n^6
           -13*sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)*n^4-236*n^4
           -13*sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)*n^2+116*n^2
           +4*sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)-16))
        /(sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)
          *(sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)*n^4-4*n^6
            -3*sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)*n^2
            +13*n^4+sqrt(4*n^2+6*n-4)*sqrt(4*n^2-6*n-4)
            +13*n^2-4)):

combine(expr);

                       -exp(-n cos(phi) - n sin(phi))

acer

See here for an old post on this topic.

Altenatively, you could try it like this (and adjust the size as you wish),

Typesetting:-mo("Hello", mathcolor = "#00CC00", mathsize = "28");

acer

You could use the -c option twice. One to push in your single statement, and once more to push in a quit statement.

On MS-Windows the joy of this is often about getting quotes escaped properly.

(There is at least one old thread on this site about scripting with the CLI more generally, but which includes some comments about passing arbitrary input as if from a file.)

acer

I may not be properly understanding your question, but why can't you use square bracket indexing to both retrieve and assign to the exports of the Record?

restart:

q:=Record(a=sin(x),b=cos(x),c=(x+3.0)^2);

                        /                                     2\
             q := Record\a = sin(x), b = cos(x), c = (x + 3.0) /

exports(q);

                                   a, b, c

for e in exports(q) do
  q[e]:=limit(q[e],x=Pi);
end do:

a,b,c;

                                   a, b, c

eval(q);

                   Record(a = 0, b = -1, c = 37.71916033)

It could also be done above with,

  assign( eval(q[e],1), limit(q[e],x=Pi) );

for each export e of the Record.

acer

This is not good.

I merge execution groups (using the F4 key, say) often when programming in 1D mode. And prior to Maple 2015 I've relied on the fact that lines which begin with a prompt and those which don't are not treated differently, as far as multiple line statements go. And now in Maple 2015 this is broken.

This is a serious regression bug. Its cause is new behaviour in the Standard GUI of Maple 2015, in which a 1D Maple Notation input line need not be terminated with either colon or semicolon. I suppose this was intended as a convenience, implemented without giving adequate consideration to the fact that it introduces ambiguity to the language and breaks previously valid syntax.

Here is a simple example. This example of 1D Maple Notation code works in Maple 18 and earlier, but fails with a syntax error in the Standard GUI of Maple 2015. Note that these lines all occur within the same Execution Group.

for i from 1

  to 3 do

  i end do;

Error, `;` unexpected

Download multilineregression.mw

1D Maple Notation programming in an Execution Group of a Worksheet was one of the few (if only) adequately stable, reliable, and usable modes of programming in the Standard GUI.

The OP's plotting example is a good illustration of the kinds of things that are typical usage. Suppose you have three plot calls in three seeparate execution groups. You can merge the execution groups using just F4, with no need for cut & paste. And then remove a few terminators, and wrap in a `print` call, and the plotting's all combined. Easy. No need to mark out long lines wih the mouse cursor. And by having the print call on a separate line it's even easy to undo it, or toggle the merging on and off just by adding a few # symbols. Easy and useful. But now, a previously valid and straightforwardly natural way to accomplish this has been broken.

It might be ok to remove the need for a colon/semicolon terminator at the end of the last line of an Execution Group. But it's very much wrong to have the parser try and execute every line (lacking a colon/semicolon terminator) before the last line of an Execution Group.

acer

convert(BesselJ(0,x),FormalPowerSeries);

                          infinity
                           -----       k  (-k)  (2 k)
                            \      (-1)  4     x
                             )     ------------------
                            /                2
                           -----         (k!)
                           k = 0

acer

If instead of working with expressions you are ok working with procedures  (or operators, as `unapply` can give you) which each accept multiple arguments then you might look at this old post of mine. It is not written with a particular number of procedure arguments (or variables, if you will) hard-coded.

Note that one can find example problems which appear to converge to a point which is neither a root nor even close to a root, when using an implementation of Newton's method with only the iteration number and the norm-of-change-in-variables as its stopping criteria. A good rootfinding implementation should also offer a check on forward error (plugging the candidate solution back into the equations), to test if an actual root has been detected.

acer

The articles here and here, from the Maple Reporter Tips and Techniques series, might be of some use to you.

acer

@itsme The Explore "command" is an appliable module, not a procedure. When you call `Explore(...)` what you're actually invoking is the module local Explore:-ModuleApply. And so you'd need to change that local, not `Explore` itself. If you just assign some edited proc to the unprotected name `Explore` then you're blowing away the rest of the module.

The fact that the display shows only a summary has nothing to do with accessing the entries of the Matrix in the usual ways (other than crude cut & paste). Even with the displayed summary you can still assign the Matrix to a name and then access its rows, columns, or individual entries by using the usual square-bracket indexing. Or you can do further computation using other commands, including those available via the right-click context-menus.

If you really wish to see all the entries displayed explicitly then you can change the values of the interface(rtablesize) setting. See the interface help page for a description. Eg,

interface(rtablesize=50):

acer

Did you intend to write ``(1600) instead of (1600) ? And similarly for the (1500).

If so then can you not just switch the order in which you do those two eval calls?

param:= {mu[2] = ``(1600), mu[4] = ``(1500)}:
R := unapply(1/(1+exp((1/50)*x)), x):
evalf(eval(eval(R(abs(mu[4]-mu[2])), param), ``=(x->x)));

                          0.1192029220

acer

add( x*ln(x), x = X );

This uses the kernel builtin add for efficiency (not producing a temporary list as collectible garbage).

Your example data seems to be just integers. If you are expecting a float result then you might want to wrap evalf around the expression argument. Ie, evalf(x*ln(x)).

acer

On my 64bit Maple 18.02 running on Windows 7 I see the extra space added when exporting as a .pdf file.

On 64bit Maple 2015.0 on the same machine I am not seeing that extra space on such export.

So on my machine this seems to have been fixed in Maple 2015.0.

Perhaps someone with OS X can confirm.

acer

Where are your statement separators (colon or semicolon) between the statements within the loop? 

Why is lowercase letter o used as the lower index value for the j-loop? Did you intend the number 0 instead?

Why do try to use n (to form Arrays) before you actually assign a value to n?

Where you use N did you intend n?

acer

print(NCP);

acer

First 227 228 229 230 231 232 233 Last Page 229 of 336