Carl Love

Carl Love

28100 Reputation

25 Badges

13 years, 103 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@tomleslie I wouldn't call the computer-performed translation of a file from one only-readable-by-computer format to another an "update". Only the format is changed, not the content. Like, if a hardbook is released in paperback, you wouldn't call it an updated edition.

@gtbastos Why doubt? It's easily done. See help for the commands LinearAlgebra:-Modular:-RowReduce and LinearAlgebra:-Modular:-MatBasis.

@asa12 You can use sort for this purpose:

sort(Statistics:-Tally(["1","1","2","2","2","77"]), (a,b)-> lhs(a)<lhs(b));

That'll work in your Maple 12. In modern Maple, it can be simplified to

sort(Statistics:-Tally(["1","1","2","2","2","77"]), key= lhs);

Why do you want to use 4th-order Runge-Kutta (RK4) rather than any of the numerous other more-modern methods that Maple offers that have dynamic error control?

You can get RK4 via

dsolve(..., numeric, method= classical[rk4]);

The use of of the keyword static is not required. Its purpose is efficiency: Module members declared static are not copied for each instance of the object. Since their values can't change, they can always be reread from the prototype. However, it always seems that the vast majority of object members are static, so it would've been better if static were the default and some other keyword, like dynamic, were used for the object members whose values could change. The constant appearance of the word static does clutter the code.

As Acer pointed out, your original code only needed a minor correction: a definition of Point as a structured type. But if you don't use objects, then you must use with for the infix operators, which means that only one overload per infix operator can be in effect at a time, which to me is an onerous restriction.

A large part of the complexity discussed by Acer is to deal with the symbolic cases, e.g., what to do with cases like p1 + p2 where p1 is a Point but p2 is just a symbol. Keep that in mind when you're comparing this to other languages. C++ for example doesn't have native symbols; you'd need to define them as an object in their own right.

@asa12 It must be a difference in your older version of Maple. Try removing the word decimal:

sprintf("%08d", convert(StringTools:-Ord("A"), binary));

@asa12 

sprintf("%08d", convert(StringTools:-Ord("A"), binary, decimal));

@Kitonum Note that it's possible to apply a sequence of functional operators such as (min,max) as a single operator the same way that you can do with a list of functional operators such as [min,max]. For example

MinMax:= n-> (min,max)(op~(1, ifactors(n)[2]));

@Joe Riel

I was more impressed that I was able to print the whole table in Yeti's format with a single fprintf statement.

I don't understand why `?()` works, or why `?[]` doesn't work. The latter was my first choice, but it gives the incomprehensible error message "`?[]` expects a list for its 2nd argument but received [1,1]". Everything that I've done to test it shows that the [1,1] that it is receiving is indeed a list.

Yeah, now that I see it, I like indx-> A[op(indx)] better also.

@brian bovril Yes, that's correct.

@AmusingYeti Here's a procedure for your formatted output:

InvertRtable:= (A::rtable)-> ListTools:-Classify(curry(`?()`, A), [indices(A)]):

YetiPrint:= proc(A::rtable, fp::{nonnegint, symbol, string})
local e, T:= sort([entries(InvertRtable(A), 'pairs')], key= (e-> rhs(e)[1]));
   fprintf(
      fp,
      cat("|", seq(cat("%a", "=%a" $ nops(rhs(e))-1, ", %a|"), e= T)),
      (op@rhs, lhs)~(T)[]
   )
end proc:

Example:
A:= LinearAlgebra:-RandomMatrix(9$2, generator= rand(0..9)):
YetiPrint(A, terminal);

|[1, 1]=[2, 6]=[3, 8]=[4, 1]=[4, 7]=[5, 5]=[6, 3]=[6, 6]=[6, 9]=[7, 2]=[8, 1]=[8, 3]=[9, 4], 3|[1, 2]=[3, 2]=[3, 5]=[4, 4]=[4, 6]=[6, 5]=[6, 8]=[8, 6]=[9, 3], 7|[1, 3]=[2, 8]=[4, 2]=[5, 1]=[8, 5], 8|[1, 4]=[1, 7]=[3, 3]=[3, 6]=[4, 5]=[4, 9]=[5, 6]=[5, 8], 5|[1, 5]=[1, 8]=[1, 9]=[2, 2]=[2, 7]=[3, 1]=[3, 4]=[3, 9]=[5, 2]=[6, 7]=[7, 7], 0|[1, 6]=[2, 3]=[5, 3]=[6, 1]=[6, 2], 6|[2, 1]=[5, 9]=[7, 6]=[7, 8]=[8, 8]=[9, 5]=[9, 8], 4|[2, 4]=[3, 7]=[4, 3]=[6, 4]=[7, 1]=[7, 5]=[8, 4]=[9, 1], 2|[2, 5]=[2, 9]=[4, 8]=[7, 4]=[7, 9]=[8, 2]=[8, 7]=[8, 9]=[9, 9], 1|[5, 4]=[5, 7]=[7, 3]=[9, 2]=[9, 6]=[9, 7], 9|

 

 

@vv To my mind, the purpose of the procedures is to classify those entries whose existence isn't determined by an indexing function. From a standpoint of information theory, these are the only entries that are really there.

@acer Your technique doesn't work the way that you expect it to. The 5 of the outer evalf supercedes the Digits used by the inner evalf, so the inner evalf is being done at 5-digits precision. Here's a test that shows this:

x:= 1+1e-6:  y:= 1+2e-6:
evalf[5](evalf(y-x));

                               0.
evalf(y-x):  evalf[5](%);
                            0.000001

So, evalf violates the usual rule that arguments are evaluated before being passed!

 

Your attempt to write Maple code doesn't shed much light on your problem. I think that you should take a step back, forget about Maple, and try to describe your problem mathematically. You're trying to solve a differential equation, right? ordinary or partial? numeric or symbolic solution? You mentioned Poincare's theorem (in an earlier version of this Question). You mentioned a change of variables. Now put it all together into a clear mathematical statement of the problem.

@gtbastos Do you want all 4x4 matrices of 0s and 1s of rank 3 or 4 over GF(3)? Or do you want all 4x4 matrices of rank 3 or 4 over GF(3)?

First 362 363 364 365 366 367 368 Last Page 364 of 709