sursumCorda

1279 Reputation

15 Badges

2 years, 335 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@dharr Thanks! It's really surprising that Maple doesn't support this functionality perfectly. I hope there will be a unified function to handle them in the future.

@vv Many thanks. However, it seems like a coincidence that this command can be used for this problem, as it does not appear to work in some other cases. 
For example, let 

a := RootOf(4*_Z^3 - 12*_Z^2 - 24*_Z - 25, index = 1): # which actually equals “(b + 1)^2”, but assuming we do not know this beforehand
b := RootOf(2*_Z^3 - 3, index = 1):
c := convert((-1)^(1/4), RootOf):
d := convert((sqrt(2) - 1)*I, RootOf): # which actually equals “c*(c^2 - c + 1)”, but assuming we do not know this beforehand

Can Maple express `a` in the field generated by `b`, and vice versa? And can Maple express `d` in the field generated by `c`, and vice versa? The `evala/Primfield` command no longer works (that is, cannot find desired representations) in these cases. (In older versions of Maple, running “evala(Primfield({a, b}));” would raise an error message.)

@Carl Love Here is an example: 

m := Matrix([[2, -1, -1, 1, -(1/2), -(1/2), -3, 3/2, 3/2], [-1, 
     2, -1, -(1/2), 1, -(1/2), 3/2, -3, 3/2], [-1, -1, 
     2, -(1/2), -(1/2), 1, 3/2, 3/2, -3], [1, -(1/2), -(1/2), 
     5, -(5/2), -(5/2), 30, -15, -15], [-(1/2), 1, -(1/2), -(5/2), 
     5, -(5/2), -15, 30, -15], [-(1/2), -(1/2), 1, -(5/2), -(5/2), 
     5, -15, -15, 30], [-3, 3/2, 3/2, 30, -15, -15, 
     225, -(225/2), -(225/2)], [3/2, -3, 3/2, -15, 30, -15, -(225/2), 
     225, -(225/2)], [3/2, 3/2, -3, -15, -15, 30, -(225/2), -(225/2), 
     225]], 'shape' = 'symmetric', 'datatype' = float[8]):
Student:-NumericalAnalysis:-MatrixDecomposition(m, 'method' = 'LDLt'): # this works 
LDLT(m); # this does not work 
                              FAIL

Perhaps I misused the `LDLT` procedure? 

@Christopher2222 The latest review is: https://www.wolfram.com/mathematica/compare-mathematica/files/ReviewOfMaple2025.pdf. (See also https://www.wolfram.com/system-modeler/modeling-tools-comparison/index.php and https://www.wolfram.com/mathematica/compare-mathematica/compare-mathematica-and-maple.html.) 
It is worth noting that a member of staff of the WRI also adds some functions into Mma that have been added into new releases of Maple, e.g., CaterpillarTreeQ (28 March 2025). 

It seems that the conditioned `patmatch` does not recognize something like “a(b)(c)” (as well as D(f)(…) in this problem). 
Here is a minimal working example: 

patmatch(a(b)(c), conditional(d::anything, _has(d, b)));
Error, (in PatternMatching:-AlgStruct:-Match) string or symbol expected for substring

@TechnicalSupport Many thanks for not forgetting this issue! 

@Joe Riel Thanks. However, if the procedure does not return the specific argument, this workaround will no longer work. 
Besides, the coercion and structured types seem to be mutually exclusive; I cannot use something like coerce(set(posint), …). Is this another bug? 

@Carl Love Thanks for your concise improvement. The only disadvantage is that the `?()` operator is not easily searchable in the documentation. 

@Kitonum As a side note, “map(`[]`@f@op, L);” may be shortened to “map2(`?()`, [f], L);”. (I saw this question while searching for pre-allocation.) 

@C_R I don't think this is an easy job.  
In different interfaces, the outputs are distinct: 

But the common point is that in 1-D math Maple considers the Unicode character “λ” to be different from the Greek symbol “lambda”! 

I find that searching for the Unicode letter “λ” (instead of “lambda”) is enough. Unfortunately, this trick does not work for subscripted variable names (for example, “λ₁” does not match the 2D output of “lambda__1”…). 

@dharr Thanks for exploring. 
Strangely, `eliminate` works fine when I set a (redundant) dummy variable _Y

> expr := `~`([a, b, c]^2 = 4*[y*z/((x+y)*(x+z)), z*x/((y+z)*(y+x)), x*y/((z+x)*(z+y))]):
> eliminate([expr[], x+y+z = _Y, _Y <> 0], [x, y, z])[-1];
   /  / 2        2            2\ / 2        2            2\\ 
  { a \a  - 4 + b  + a b c + c / \a  - 4 + b  - a b c + c / }
   \                                                       / 

But if I use “[expr[], x+y+z = 0]”, the result will remains empty. (Note that xyz can be zero, for instance, [x, y, z] =~ [1, 2, -3].) 

@Axel Vogt Thanks. Strangely, if I write something like “p += …” and “f mod= …”, Maple will raise an error.

@acer Many thanks. This is a useful trick! 

@acer Thanks. After some search, I found that “irem((j - 1)!^2, j)” is just OEIS A010051 (1 if n is prime, else 0), yet the equivalent “ifelse(isprime(j), 1, 0)” cannot be compiled. (Maybe there is a mechanism to indicate operations that should be directly evaluated in the Maple kernel rather than being compiled into low-level code?)

1 2 3 4 5 6 7 Last Page 1 of 23