acer

32480 Reputation

29 Badges

20 years, 6 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

After assignment is done of a few values to some variables, this command is issued in your worksheet,

phi[2] := convert(SphericalY(lphi, mj+1/2, theta, phi), elementary);

Now, your Document had that in 2D Math input, so phi[2] appeared as typeset phi-subscript-2. But the important thing to notice is that, underneath that 2D Math typesetting, the subscripted object was really phi[2]. And since phi had not previously been assigned, then phi[2] is treated as a table reference.

So, the assignment to phi[2] creates a table phi, where the phi[2] table entry is an expression (radicals and trig) involving the name phi.

Then a repeated attempt is made, to convert that same SphericalY call, where phi is the last argument, to elementary functions. And the error is that too many levels of recursion happened.

Basically, a self-referencing of an entry of table phi to the table itself had been created. Some manipulation of this resulted in an infinite recursion (stopped when an internal limit was exceeded).

If one really needs to use both phi and subscripted phi in the same mathematical subcomputation, then the subscripted phi should be a distinct name and not a table reference. A subscripted but fully unique name can be inserted from the Layout palette, as a "subliteral". Or, a table reference can be converted in-place in the Document to a unique name using the right-click context menu, 2-D Math -> Convert To -> Atomic identifier.

acer

There used to be such a publication, named MapleTech. It was published by Birkhauser.

This and this link might help make some sense of it.

It seems like a decent idea, to petition Maplesoft to either resurrect that one, or start a new one.

acer

Both these plots worked for me,

> restart:

> with(plots):
> with(Units[Standard]):

> g2 := piecewise(t>0 and t<100, 10*Unit(m/s^2)*t*Unit(s),
>                 t>=100, 1000*Unit(m/s)-10*Unit(m/s^2)*(t-100)*Unit(s)):

> plot(unapply(g2, t), 0..200*Unit(s));
> plot(unapply(g2, t), 0..200*Unit(s), useunits=[Unit(s),Unit(m/s)]);

> kernelopts(version);
           Maple 13.00, X86 64 LINUX, Feb 18 2009 Build ID 388356

acer

Both these plots worked for me,

> restart:

> with(plots):
> with(Units[Standard]):

> g2 := piecewise(t>0 and t<100, 10*Unit(m/s^2)*t*Unit(s),
>                 t>=100, 1000*Unit(m/s)-10*Unit(m/s^2)*(t-100)*Unit(s)):

> plot(unapply(g2, t), 0..200*Unit(s));
> plot(unapply(g2, t), 0..200*Unit(s), useunits=[Unit(s),Unit(m/s)]);

> kernelopts(version);
           Maple 13.00, X86 64 LINUX, Feb 18 2009 Build ID 388356

acer

Use capitalized Matrix, not lowercase matrix.

acer

Use capitalized Matrix, not lowercase matrix.

acer

Alec's quick draw is faster than mine. :)

acer

Alec's quick draw is faster than mine. :)

acer

You're very welcome. (Sorry, too, if I sounded officious. Hadn't had my 2nd coffee by then.)

You might also find this useful.

acer

You're very welcome. (Sorry, too, if I sounded officious. Hadn't had my 2nd coffee by then.)

You might also find this useful.

acer

Sure. I had already found the paricular page I wanted, by editing the url for another known page. But the behaviour, to reject search keywords which are also common and important Maple help topics is an obvious flaw in the mechanism.

acer

I tried to use the Search facility in the Online Help to look up the help-page for the Maple command use. (Such a help-page exists inside Maple itself.)

But instead of showing a link to the appropriate online help, it showed a page saying,"Your search term contained only ignored words. Please enter a different keyword."

acer

The syntax I wrote might work in Maple 12 but not Maple 11, sorry.

Try it like this, in Maple 11 (or earlier),

> M:=ImportMatrix("foo.txt",source=Matlab):

> for i from 1 to 3 do
> p[i],n[i] := M[i,1..3]^%T, M[i,4..-1]^%T;
> od:
> p[1],n[1],p[2],n[2],p[3],n[3];
                        [1]  [4]  [2]  [ 8]  [3]  [12]
                        [ ]  [ ]  [ ]  [  ]  [ ]  [  ]
                        [2], [5], [4], [10], [6], [15]
                        [ ]  [ ]  [ ]  [  ]  [ ]  [  ]
                        [3]  [6]  [6]  [12]  [9]  [18]

> kernelopts(version);
           Maple 11.00, IBM INTEL LINUX, Feb 16 2007 Build ID 277223

The difference is between M[i][1..3] and M[i,1..3].

In Maple 12, M[1] yanks out the first row, but that was syntax new to that release. I ought to have remembered, sorry. (And the syntax M[i,1..3] would also be more efficient, as avoids an intermediary Vector construction.)

acer

The syntax I wrote might work in Maple 12 but not Maple 11, sorry.

Try it like this, in Maple 11 (or earlier),

> M:=ImportMatrix("foo.txt",source=Matlab):

> for i from 1 to 3 do
> p[i],n[i] := M[i,1..3]^%T, M[i,4..-1]^%T;
> od:
> p[1],n[1],p[2],n[2],p[3],n[3];
                        [1]  [4]  [2]  [ 8]  [3]  [12]
                        [ ]  [ ]  [ ]  [  ]  [ ]  [  ]
                        [2], [5], [4], [10], [6], [15]
                        [ ]  [ ]  [ ]  [  ]  [ ]  [  ]
                        [3]  [6]  [6]  [12]  [9]  [18]

> kernelopts(version);
           Maple 11.00, IBM INTEL LINUX, Feb 16 2007 Build ID 277223

The difference is between M[i][1..3] and M[i,1..3].

In Maple 12, M[1] yanks out the first row, but that was syntax new to that release. I ought to have remembered, sorry. (And the syntax M[i,1..3] would also be more efficient, as avoids an intermediary Vector construction.)

acer

Interesting suggestions.

Just for fun, the first can (sort of) be kludged.

> `&+=` := proc(x::uneval,y)
> x := eval(x)+y; # or maybe eval(x,2)
> end proc:

> x:=11: y:=13:

> x &+= y;
                                      24
> x;
                                      24

> x &+= x;
                                      48

> x;
                                      48

> X:=<6>: Y:=<a>:

> X &+= Y;
                                    [6 + a]

> X;
                                    [6 + a]

However, with such operations inside procs some protection against recursive assignment is removed.

> `4`:=`4`+11;
Error, recursive assignment

> `4` &+= 11; # shoort self in foot
                                    4 + 11

> `4`; # don't do this! crash session or OS

acer

First 495 496 497 498 499 500 501 Last Page 497 of 594