sursumCorda

1194 Reputation

15 Badges

2 years, 114 days

MaplePrimes Activity


These are questions asked by sursumCorda

The algebraic equation in four variables is: 

restart;
expr := (a^2 + b^2 + c^2 + d^2 - 4)*(a^2 + b^2 + c^2 + d^2) + 4*d*c*b*a - (a + b + c + d - 2)*(a + b + c + d) + 6:
solve(expr = 0, useassumptions, allsolutions) assuming nonnegative;

Unfortunately, I've been waiting for a long time, and I have no more time to wait; I have to interrupt the current session by hand. However, it appears that MMA can solve it within bearable time:

Did Maple miss something here?

The shortcut key Ctrl+Delete is used to clear a math region or delete a cell within a group, so I can delete some output manually. However, I find that there exists some long-standing functions like PrintTemporary and Monitor in Mathematica, which can be used to print intermediate values of variables temporarily (and dynamically, if possible). The term "temporarily" means that the printed output disappears at the end of a computation / when a computation is complete / when the evaluation finishes / before returning the result of an evaluation. For instance: 

(Note that certain operations require a front end.)

Is it possible to implement such functionalities in Maple? 

printf("%", [[]]);

Yeah, it is incompatible with the Maple syntax. But I don't know why this command actually causes a serious logic error here. Actually, this seems fairly trifling in my view. Can you produce it again? 

restart

printf("%", [[]]);

NULL

Download printfIssue.mws

Let us begin with few simulations: 
 

restart;

CodeTools:-Usage(plots['pointplot3d'](Matrix((proc (_) options operator, arrow; [_[() .. (), 1]-_[() .. (), 3], _[() .. (), 2]-_[() .. (), 4], _[() .. (), 5]] end proc)(convert(ssystem("wolframscript -code \"RandomPoint[Simplex[IdentityMatrix[5]], 2*^4]\"")[-1], FromMma)), scan = [rectangular, columns], datatype = float[4]), scaling = constrained))

memory used=0.57TiB, alloc change=91.51MiB, cpu time=18.77m, real time=15.86m, gc time=4.91m

 

CodeTools:-Usage(plots['pointplot3d'](Matrix((proc (_) options operator, arrow; [_[() .. (), 1]-_[() .. (), 3], _[() .. (), 2]-_[() .. (), 4], _[() .. (), 5]] end proc)(convert(ssystem("wolframscript -code \"RandomPoint[Sphere[5], 2*^4, ConstantArray[List[0, 1], 5]]\"")[-1], FromMma)), scan = columns, datatype = float[4]), scaling = constrained))

memory used=0.56TiB, alloc change=-12.08MiB, cpu time=18.70m, real time=15.11m, gc time=5.69m

 

NULL


 

Download iDistributionVector.mws

Well, I'd like to prove (through the use of Maple): 

transform((x1, x2, x3, x4, x5) -> [x1 - x3, x2 - x4, x5])(inequal(And((x || (1 .. 5)) >=~ 0, norm([x || (1 .. 5)], 1) = 1))) # not Maple syntax

is equivalent to a filled pyramid

ImplicitRegion((X, Y, Z), 0 <= Z <= 1 - abs(X) - abs(Y)) # not SymPy syntax

transform((x1, x2, x3, x4, x5) -> [x1 - x3, x2 - x4, x5])(inequal(And((x || (1 .. 5)) >=~ 0, norm([x || (1 .. 5)], 2) = 1))) # not Maple syntax

is equivalent to a hemi-ball

ImplicitRegion((X, Y, Z), 0 <= Z <= sqrt(1 - X**2 - Y**2)) # not SymPy syntax

, and 

transform((x1, x2, x3, x4, x5) -> [x1 - x3, x2 - x4, x5])(inequal(And((x || (1 .. 5)) >=~ 0, norm([x || (1 .. 5)], 'infinity') = 1))) # not Maple syntax

is equivalent to a solid cuboid

ImplicitRegion((X, Y, Z), -1 <= X <= 1 & -1 <= Y <= 1 & 0 <= Z <= 1) # not SymPy syntax

. (Here, for the convenience of the descriptions, I utilize some non-standard notation from .) 
Note that ”two regions are equal" is a two-way property, which means the following proof 

is(Z >= 0) and is(Z <= 1 - abs(X) - abs(Y)) assuming (X, Y, Z) =~ (x1 - x3, x2 - x4, x5), x || (1 .. 5) >=~ 0, add(x || (1 .. 5)) = 1;
                              true
(*Accordingly, the latter region is a subset of the former one.*) 

is incomplete (because it's hard to determine whether the is routine always performs equivalent transformations in internal evaluation). 

So, can I execute such eliminations in Maple?

After studying the plottools:-transform command, I intend to visualize the following regions with constrained parameters in 
 

(plottools[transform](proc (u, v) options operator, arrow; [u^3-v^2, u^2-v^3] end proc))(plots[inequal](`or`(u^2+4*v^2 <= 4, `and`(u^2+v^2 < 4, 4*v >= (u+2)^2+2*v^2)), nolines))

 

(plottools[transform](proc (s, t) options operator, arrow; [s^2*sqrt(t)*cos(t), s^2*sin(t)] end proc))(plots[inequal](`and`(`and`(s >= 1, 5*s <= 5+t), t < 5), s = 1 .. 2, t = 0 .. 5))

 

 

But Mma gives 

The first instance (with default settings) is the same, but as for the second instance, which graph is correct? 

restart;
with(plottools):
with(plots):
transform((u, v) -> [u^3 - v^2, u^2 - v^3])(inequal(Or(u^2 + 4*v^2 <= 4, And(u^2 + v^2 < 4, (u + 2)^2 + 2*(v - 1)^2 <= 2)), nolines));
transform((s, t) -> [s^2*sqrt(t)*cos(t), s^2*sin(t)])(inequal(`and`(1 <= s, 5*s <= 5 + t, t < 5), s = 1 .. 2, t = 0 .. 5));


Download TransformedRegion.mws

First 19 20 21 22 23 Page 21 of 23