sursumCorda

1169 Reputation

13 Badges

2 years, 42 days

MaplePrimes Activity


These are questions asked by sursumCorda

For instance, here is a worksheet where I have replaced 1 + 2; with 1 + 1; in advance: 
 

1+1 = 21+1 = 3

1 + 1;

2

(1)

1 + 1;

3

(2)


 

But without re-evaluations, how do I know the second input and the fourth input have been stealthily substituted?

In a Mma notebook, this can be displayed by shadowing the input label: 

But in order to detect changes, which method should be used in Maple?
(Note that I do not mean that no changes are allowed. So I don't think setting the “editable” property is a workaround.)

`lprint` is officially interpreted as “linear printing of expressions”, but in the most recent release, its output looks just like "left printing" (under the default zoom 100%), 

while in some legacy version, `lprint` printed expressions not only on the left but also on the right. 

How to render `lprint` print its arguments not only on the left half?
Although I believe that similar questions must have been asked before, I cannot find such a question. 

Code: 

lprint(_bigPi):
showstat(ellipsoid)

It seems that applyrule cannot handle variable numbers of arguments, and I cannot use something like 

applyrule(f(u::anything, v::seq(anything)) = g(v, u), [f(x, y, z), f(x, y, z, t)]);
 = 
                  [f(x, y, z), f(x, y, z, t)]

Strangely, Maple does support the identical patterns in parameter declarations: 

eval([f(x, y, z), f(x, y, z, t)], f = ((u::anything, v::seq(anything)) → g(v, u)));
 = 
                  [g(y, z, x), g(y, z, t, x)]

So the two designs do not appear coherent. Should this be regarded as a "bug" in a sense? 

Of course there is no need to use the  modifier; here it is enough to use 

evalindets([f(x,y,z),f(x,y,z,t)],'specfunc'(anything,f),w->g(op(2..(),w),op(1,w))):
use f = MakeFunction('g(args[2 .. ], args[1])') in [f(x, y, z), f(x, y, z, t)] end:
use f = unapply('g(_rest, _w)', [_w::anything]) in [f(x, y, z), f(x, y, z, t)] end:

But the problem is, why is there such inconsistency described above? 

Although I still prefer applyrule (as evalindets/subsindets is not as intuitive as applyrule),  I have heard that it is regarded as being more or less antiquated in modern Maple. I notice that a lot of (yet not all) examples given in the help pages of evalindets/subsindets can be reformulated by applyrule, but does any use of applyrule also correspond to using evalindets/subsindets? And if so, how to equivalently rewrite those transformation rules (especially complicated ones like nested function applications) in the syntax of evalindets/subsindets?

For example, I would like to draw the following figure in Maple.

 

(The above figure is taken from MatLab's documentation.) 
Here are these four graphics objects: 

use plottools, ColorTools in
	l0, l1 := line~([<1 | 0>, <1 | 1>], [<6 | 5>, <6 | 6>], 'color' =~ Color~(["#0072BD", "#D95319"]))[];
	r0, r1 := rectangle~([[2, 0], [4, 0]], [[3, 6], [5, 6]], 'color' =~ Color~([[.6, .7, .9], [.95, .7, .6]]))[]
end:

However, either 

`plots/display`([r1, l1, l0, r0], 'axes' = "boxed", 'size' = ["default", "golden"], 'style' = "patchnogrid")

or 

`plots/display`([r0, l0, l1, r1], 'axes' = "boxed", 'size' = ["default", "golden"], 'style' = "patchnogrid")

outputs the same graphical image where the lines are always rendered on top of each rectangles instead of the other way around.

plots:-display([plottools:-rectangle([2, 0], [3, 6], 'color' = ColorTools:-Color([.6, .7, .9])), plottools:-line([1, 0], [6, 5], 'color' = ColorTools:-Color( 

So how to superimpose the right rectangle over the two lines? To put it differently, how to handle the graphics hierarchy? I have read some similar questions like Order in plots:-display - MaplePrimes, yet I cannot find any workarounds. 

Note that in my opinion, the result should comprise two unbroken line segments rather than four subordinate line segments! 

4 5 6 7 8 9 10 Last Page 6 of 22