Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

I cannot duplicate your error in Maple 2020.1, and reading through your sys, I don't see how it's possible that you got that error in an earlier version of Maple. Your sys appears to be manifestly an explicit first-order system, so it doesn't need to be converted to one. So, are you sure that you got that specific error message using exactly the code shown in your worksheet? Please re-execute and confirm.

I get the error "initial Newton iteration not converging". That can usually be corrected by using a continuation parameter. I see that you mentioned continuation in a code comment.

@Anthrazit My shared kernel idea was based on a false impression of what you wanted. After reading your Reply to Tom, I realized that what you want is a database, something like your own version of Maple's ScientificConstants package. Mac Dude's Reply to your Reply outlines a potential solution. You should leverage Maple's Records as much as possible.

@Joe Riel I don't know if this is significantly more efficient, but I like it better (Maple 2019 or later required):

fd:= FileTools:-Text:-Open("data.csv"):
A:= Array([while (line:= readline(fd)) <> 0 do [parse(line)] od]);
fclose(fd);

Like your solution, mine supposes that each line contains the same number of entries, none of which are lists.

@Bohdan I'm guessing that your indexed entries are actually stored in the external file as strings, enclosed in double quotes. In that case, use datatype= anything. Let's say that you've successfully imported the file to a Maple matrix named M. We need to convert those strings to algebraic expressions. To do that, use

M1:= subsindets[flat](M, string, parse);

I just saw that you said "length exceeds error". The message "Length exceeds...." is not an error or even a warning. It's just a message that's shown instead of the actual output. It's only shown after that output has been computed in its entirety without error. That output still remains programmatically accessible.

@SeyiOshin You wrote:

  • I have used Matlab to obtain the eigenvalues of the matrices when all the variables are defined

Then you weren't using Matlab's symbolic capabilities.

  • and it did so in a fraction of the time it took Maple.

I don't find that surprising at all; Matlab works quite efficiently with hardware-float matrices. But I suspect that you would've achieved better results in Maple (better than what you got, not better than Matlab) had you declared your matrices to have datatype= float[8] (if they are real numbers) and shape= symmetric (if indeed they were symmetric).

And you think that Matlab's symbolic capabilities will work more efficiently than Maple's? I'd bet money against that proposition.

@acer In my experience, the "usual manner" is that the length of the expanded procedure is checked before performing any elision required by a low setting of interface(verboseproc). This is unfortunate. This is why procedures output by dsolve(..., numeric) for large systems often get the "length exceeded" message even though their bodies would've usually been elided anyway.

@bnpndxtrwp The "original example" that you refer to may be older than Maple's Vector and Matrix (capitalized) commands. It may have been true that a vector (lowercase) of lists was more efficient than other container structures available at that time.

That being said, I'm not claiming that a Matrix is the most efficient structure to use. To ascertain that, I'd need to see the full range of ways that you use it. Rather, I recommend a Matrix because of the great flexibility of its indexing.

Partial answer: Somewhere in your input expression(s), you've used square brackets for algebraic grouping. This is not allowed; you must used round parentheses. However, this answer doesn't explain the undefined. You'll need to upload your worksheet, or at least your input.

Your anger is blocking your ability to learn.

@nrussoniello In 2003 I wrote a Maple program to compute the rank of a matrix of rational functions over the rationals (in any number of variables) by random numeric assignments to the variables (akin to VV's method). By working over finite fields, I was able to compute a provable upper bound on the probability that that computation did not give the correct rank. Those upper bounds were infinitesimal, typically about 10^(-30), and could be made arbitrarily close to 0 by making the random selections from a larger finite field or by using multiple random selections. The time needed to compute exactly the rank of a matrix over a finite field with characteristic < 2^25 is trivial.

I won a 1000-euro prize for that program/proof.

@nm It's a mystery to me and a great Question: Is using restart equivalent to starting a new kernel? Your experience here suggests that they aren't equivalent. Hopefully someone else can provide more insight.

@David Sycamore To make the requested change, you simply need to replace

`+`(convert(j, base, 10)[])

with

j

 

The key is to use convert(..., polynom) (as discussed in the replies to one of your other Questions) to convert the unwieldy series structures (produced by taylor) into Maple's standard algebraic forms. And do you want a O(...term in your final output?

It would be much easier for me to show you how to do it if you upload a complete worksheet using the green uparrow on the toolbar of the MaplePrimes editor.

I edited the title of your Question to remove the phrase "in 2-D output" because I think that using that phrase confuses the issue. As I said elsewhere, the form of the output has no bearing on how it's treated by subsequent input.

First 172 173 174 175 176 177 178 Last Page 174 of 709