sursumCorda

1219 Reputation

15 Badges

2 years, 137 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@Carl Love Thanks. But I find a strange thing:

[PolynomialReduce](2*x^4 + y^3 - x^2 + y^2, [x^3 - x, y^3 - y], [x, y]);
 = 
                    [           2    2    ]
                    [[2 x, 1], x  + y  + y]

[PolynomialReduce](2*x^4 + y^3 - x^2 + y^2, [x^3 - x, y^3 - y], [y, x]);
Error, (in quo/polynom) division by zero


@Carl Love Thanks. The only regret is that this does not output the other term "[x + y, 2*(y - a)]" (although Maple may have found it in the internal).

Besides, I think that the origional function is also an extension of solve(identity(…, ...), ...) and PDEtools:-Solve(…, ..., 'independentof' = ...) when working with polynomials, since those coefficients in the second example can be easily obtained by them when a=0. But if the remainder is not zero, these two commands will not work.

@Rouben Rostamian  Six years have passed; regretfully, such convenient syntax is still not built into Maple. What is the reason?

@sand15 Thanks. Strangely, the older Eigenvals function will return the newer default LinearAlgebra:-Eigenvectors form (instead of the linalg:-eigenvectors form).

@Preben Alsholm I read it in 

showstat(`evalf/matrixexp`, 66);

`evalf/matrixexp` := proc(A)
local a, t, ss, s, i, i1, bk, p, z, n, m, j, k, l, M, N, oldD, islist, tmp;
       ...
  66   if _EnvLinalg95 = true and islist then
           ...
       else
           ...
       end if
end proc


I believe that it is similar to: 

  1. MTM:-expm
  2. `linalg/matrixexp`
  3. linalg:-matrixexp
  4. linalg:-exponential
  5. Student:-LinearAlgebra:-MatrixExponential, and 
  6. LinearAlgebra:-MatrixExponential.

@Preben Alsholm Thanks. The problem is: If I understand right, in theory, shouldn'd setting “_EnvLinalg95 := true:” only impact on the obsolete `linalg` package (without influencing the most recent `LinearAlgebra` package)? 

The modern `LinearAlgebra` package was originally introduced in Maple 6, which was released in 2000. Twenty-three years have passed; while `LinearAlgebra:-Eigenvalues` and `LinearAlgebra:-EigenConditionNumbers` work well, the relevant `LinearAlgebra:-Eigenvectors` still has a cryptic dependency upon `_EnvLinalg95` (even if I do not “with(linalg):”). This is really weird.

I am not very familiar with signal processing, but the spline option in the new SignalProcessing:-SavitzkyGolayFilter command seems to be explained in SignalProcessing:-DifferentiateData's documentation: 

• … the savitzkygolay method … use extrapolation on the left and right ends to lengthen data container X so that the derivative of order n is of the same size as X. This extrapolation can be performed in three ways:
    • extrapolation=periodic: The data is assumed to be periodic, so that Xi + m = Xi for each integer i with m being the size of X.
    • extrapolation=polynomial: Using the CurveFitting['PolynomialInterpolation'] command, interpolating polynomials of degree (at most) d are used to extend X on the left and right.
    • extrapolation=spline: Using the CurveFitting['ArrayInterpolation'] command, splines of degree (at most) d are used to extend X on the left and right.

(The Wikipedia article says that this method "has been extended for the treatment of 2- and 3-dimensional data". Can Maple's SignalProcessing['SavitzkyGolayFilter'] be generalized?)

@awass Even if ordinary users read the help page, they can be still confused.
For instance, the documentation of `convert/Vector` mentions: 

• copy : truefalse
Indicates whether a new rtable should be allocated when converting from other rtable types such as Array or Matrix. The default is false, meaning that convert will attempt to provide a reference to the existing rtable instead of allocating a new one.

However, 

Sv := <1, 2>:
Tv := convert(Sv, Vector, copy = false):
evalb(Sv = Tv);
 = 
                             false

Will this not confuse users? I think it will.

@nm Sorry, there is a typo; I have edited my reply. Thanks. 

 

@nm Thanks. There are also other less nice things in Maple. While I believe that somebody has noticed them before, I cannot find such questions/posts in this forum. For example,

subs[eval](x = 1, '1 - x'):
(subs[eval](x = 1, '1 - x')):
1 - subs[eval](x = 1, 'x'):
1 - (subs[eval](x = 1, 'x')):
use x = 1 in 1 - x end:

 are all allowed, but strangely, 

(use x = 1 in 1 - x end):
1 - use x = 1 in x end:
1 - (use x = 1 in x end):

 is invalid. This is just a trivial example, yet it is still typical. If I wish to do so, I shall have to use 

1 - if true then use x = 1 in x end fi:

or

1 - (to 1 do use x = 1 in x end od):

which is quite awkward.

@vv Thanks. In this example, although I can use "output=..." for LinearAlgebra:-Eigenvectors, this is not valid for MTM:-eig. 

The major problem is: if someone sends me an encrypted procedure that uses built-in keyword `_nresults` but do not provide any output option, when I only request the second output and he/she rejects modifying the source code, shall I have to assign a worthless variable (and then clear it) instead of simply ignoring it at the beginnibg in the syntax level?

@nm I change some options such that the plot looks more attractive, yet I also do not know how to translate Mma's StreamPoints (that is, closeness of streamlines) back into Maple. 

Here is the same thing in Mathematica

According to How to | Plot a Vector Field, Mma's StreamPlot is not identical to Maple's DEtools:-phaseportrait/DEtools:-DEplot; the equivalent seems to be VectorPlot

Unfortunately, I do not know how to explicitly draw streamlines (in other words, flow paths, instead of field vectors) in Maple.

@ider I do not know how to fix it. (Though you can use a until-loop, this will be somewhat clumsy.) But the reason is written in the documentation: 

The environment variable Order … does not necessarily represent the order of the error term ….

@mmcdara Oops, I recently found that ArrayTools:-Partition almost perfectly meets my needs (though its name appeared to be irrelevant to “sorting”). When I searched the help system for partial sorting, the second item in the "Search Results" was linked to this command in fact, but unfortunately, I just neglected it since it seemed to be used to partition or split an array into several sub-arrays …. 

@Carl Love Thanks. The documentation of Procedures says: 

Within a procedure, during the execution of its statementSequence, local variables have single level evaluation. This means that using a variable in an expression will yield the current value of that variable, rather than first evaluating that value. … 
The use statement causes a syntactic transform of its body, according to the substitutions specified in the sequence of binding forms. It is unlike simple substitution, however, in that it behaves properly with respect to the static scoping rules of the Maple language. 

One may infer that a variable declared local is visible in a nested scope (provided that no (conflicting) re-declaration exists) and any inner namesake will be in agreement with it in surrounding procedures. However, the experiment seems to mean that proc/use inserts local symbols (in this example, CompSeq) only into the actual statement body and does not insert such symbols into code (in this example, `convert/CompSeq`) that is called from body but does not explicitly appear in body.
As a result, even if CompSeq has already been localized before invoking `convert/CompSeq` in the environment, the CompSeq on line 45 of `convert/CompSeq` is still unable to access and inherit definitions from the outer local CompSeq

Ming-Ho Yee wrote that line 4 does not update the mapping created on line 1, so in your translation, the “:-” prefix (in other words, setting a global variable) should not be alowed to be used. In the next post, Ming-Ho Yee additionally wrote that: if your definition of dynamic scope is “a variable is bound to the most recent assignment during the program’s execution”, then it is not correct to say R is dynamically scoped. Moreover, running the program provided by this blog post in Maple returns 1. Accordingly, in my view, the core of Maple kernel only implements lexical scoping (proc) and read‐only lexical variables (use). 

First 6 7 8 9 10 11 12 Last Page 8 of 23