Carl Love

Carl Love

28035 Reputation

25 Badges

12 years, 318 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Just to clarify: If starting with 500 coluimns, you want to append new columns of all pairwise products for a total of 125250 columns?

@sursumCorda Okay, I understand what you were trying to highlight: The 1+ is to draw the attention of the human reader to a mathematical fact; you weren't intending for it to make any difference to Maple. If there were some situation where Maple treated 1+20230321 and 20230322 differently, that would be a much more serious bug. (I'm not saying that your reported bug isn't serious. I think it's serious.)

Vote Up. Your first algorithm had an innovative use of symbolic polynomial algebra, and this one has a very innovative use of matrix algebra.

What aspect, if any, of this bug are you trying to highlight by the weirdly specified coefficient (1 + ...)?

@dharr Vote Up. It's a great and surprisingly short (codewise) algorithm with an innovative use of symbolics. I haven't tried it yet, but from a quick read-through on my phone, I'd guess that the storage requirement is at least O(n^(k+2)), where k is the final output (and note that necessarily k >= n). Perhaps the procedure can be refactored to reduce this. Two things that might help:

  1. Carefully control the number of times expand is used.
  2. Send the result of any particular expand to the garbage collector as soon as it's known that it won't be needed later.

(Your code may already do both of those things; I won't know until I actually run it.)

Note that Maple only stores a single copy of any polynomial; all other references, including as parenthesized subexpressions of other polynomials, are just pointers to that master copy. It's useful to keep this in mind when attempting to reduce storage requirements.

Your example clearly shows to me that you're strictly interested in the number of characters per line without regard to any typographical niceties such as not beginning lines with commas or the physical width of the output (in, say, milimeters). This of course makes your request quite easy to fulfill for any specific output, but I don't know of any Maple technique to post-process all worksheet output. I've often wanted something like that. I think that it'd be quite easy for Maplesoft to provide such a mechanism; it'd be as simple as allowing a `print/...procedure to apply to all output. It should then be up to the user to program in exclusions for, say, plot output, which'd be trivial to do if the particular post-processing isn't wanted for plots.

Regarding the specific example that you showed, did you explicitly intend to remove the spaces that ordinarily come after commas?

@vs140580 I think that the following idea can help for your reformulated Question, although I haven't yet figured out all the steps for a proper algorithm.

My idea is based on the powers of the adjacency matrix, say A. For any nonnegative integer k, the [i,j] entry of A^k is the number of walks of length exactly from vertex i to vertex j. So self-returning walks always appear as nonzero diagonal entries of A^k for some k. (For this problem, we don't care about that actual value on the diagonal, only that it's not 0.) The main thing that I haven't figured out yet is how to know that all vertices are included in the walk.

As I've said to you before, Maple's type processing (which is used by indets), is purely syntactic and doesn't consider semantics such as mathematical definitions; and this is the way it has always been and must be. Incorporating mathematical semantics is of course possible, but it must be built on top of the syntactic type system. I don't see how it could possibly be otherwise.

@mmcdara Thanks for your correction and especially for your pedagogically excellent and well-presented counterexample. Unfortunately, I've never seen a proper formal definition of cycle basis, so my Answer was based on guessing. If "basis" means what it usually means in math, then I'd expect that all cycles could be generated from the cycle basis via some relatively easy computation (such as unions and intersections). Since your example only has one member containing 5, I don't see how that works. Do you know how to get the cycle [3, 4, 5, 6, 8] from your basis?

I see now that under the OP's reformulation of the Question, cycle bases won't be useful for its Answer. However, I'd still appreciate any teaching that you can give regarding the issues that I mentioned in the first paragraph.

@Carl Love Perhaps the symbolic solution that you actually want is a singular solution that can't be expressed as any instantiation of a generic symbolic solution. By instantiation I mean an assigment of numeric values to some parameters. Here's an example:

#2x2 matrix and 2x1 vector. 5 parameters (a, b, d, x, y). The 2 decision variables are
#unseen and unnamed in this pure matrix-vector form. Their values are the two entries 
#in the solution vectors S0 and S1.

A:= <a, b; 0, d>;  B:= <x, y>;

#Get a generic solution:
S0:= LinearAlgebra:-LinearSolve(A, B);

#Instantiate 3 parameters (a, d, y) to 0 and solve again:
S1:= LinearAlgebra:-LinearSolve(eval([A, B], [a, d, y]=~ 0)[]);

#Note that no possible instantiation of S0 can produce S1.

 

@Carl Love Let's suppose that there theorethically exists a symbolic solution S such as you seek regardless of our ability to find that solution. So, I mean "exists" in the idealized Platonic sense. Then S could easily be used to generate any numeric solution N. But, of course, there are numeric methods that could be used to find an approximation to N (without knowing S) that use much less computation. If you can't find any suitable numeric solutions, then IMO it's a waste of effort to search for S. So, look for approximate numeric solutions first.

@MaPal93 I just reread this entire thread, and I noticed that you never really answered my first question: Why do you think that there's a solutionAnd what makes you think that the computation is "stuck" rather than proceeding in a correct manner with a very lengthy process?

I haven't yet looked at your most-recent attachments.

@sursumCorda It's not strange at all. There is no bug in `simplify/sqrt/function`. An error message tells you what procedure was executing when the presence of a bug (from any location) was detected. It doesn't tell you where in the code the bug is.

@C_R The OP's title suggests (to a small degree) that they believe this to be a Maple 2023 new bug.

There's no need to use $ in any form; F~(list1, list2) works fine.

First 57 58 59 60 61 62 63 Last Page 59 of 708