Carl Love

Carl Love

28130 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@taro Your symbol `N.D` contains a nonstandard character, the period, and so it must be enclosed in backquotes to be considered a symbol. On the other hand, Norman is a symbol already, so enclosing it in backquotes is redundant. In either case, the string result given can be parsed to recover the original symbol. See ?symbol.

@vv My first attempt at this would also have been string based. Because of the massive machinery of computer algebra at our disposal, I have a vague sense that there's an easier or better way. On the other hand, this is ultimately about the simplification of displays rather than expressions, and displays are string based.

So, with the ability to count occurences in strings, one could do a key sort of the RootOfs, or indeed of any of the subexpressions given by indets(..., anything), to determine the best candidates for aliasing. I'm writing on my phone right now (parked in a rest area waiting out a thunderstorm) without access to a computer with Maple.

@Axel Vogt often is a replacement for zip rather than map. Such is the case with all nine usages in this Question.

@Markiyan Hirnyk No, that was impossible this time, because the time that your Comment was posted was later than the time that I began typing my Answer. I always read all Replies and Answers that are posted before I begin entering my Reply or Answer.

I encourage you to repost your Answer in this thread. Information that appears in Replies is, as far as I know, not indexed, so it's impossible to find with a search. If you repost your Answer, then it'll be in a place where it can be found later.

Also, although I usually find your Answers adequate, I think that the one in question lacked sufficient clarity. This is partly due to, I believe, your tendency to copy-and-paste from 2-D to 1-D. This causes many changes, for example, I believe that A *~ B is changed to `~`[`*`](A, B). That isn't as clear.

@mmcdara And, just to be sure, you see that my use of indets and alias is not ad hoc and involves no copy-and-paste from solution to input, right?

Regarding the power of indets: There's no limit to the complexity of type expressions that one can create. See ?type,structured (and that page is just a start). These complex types have always worked for me with command type. However, I have made types complex enough that indets fails to find all subexpression of the type.

VV: It would be great to base whether to use an alias on the number of times that a subexpression occurs; however, it's not trivial to do that count.

@mmcdara Unfortunately, the documentation of this effect at ?restart is confusing and slightly incorrect. Your example is further proof of what I've been saying here for years: Contrary to what's said at ?restart, it's the separation by execution groups that matters, not the separation by lines. 

Yet I've seen many veteran users here routinely ignoring my advice.

@mmcdara You should never put a restart command in an execution group with any other command. The results of doing so are somewhat unpredictable. In this case, the result is that the interface command is ignored. Try again with the restart and interface commands in separate execution groups.

@vv Rather than entering the RootOfs manually and coming up with names for them, you can do this:

Rs:= indets(sols, RootOf):
alias(seq(R[k] = Rs[k], k= 1..nops(Rs)));
sols; #redisplay in compact form

@Mac Dude I only said "a year or so" because it seems like the administrators are only motivated to make about one update per year to the MaplePrimes code.

I guess that a lot of the spam comes from India. I have 2-1/2 reasons for thinking this:

  1. A lot of it is for non-web-based businesses in India, such as moving companies in specific cities.
  2. "Juriya," which appears as a suffix on a vast number of spammer's userames, is, I believe, a region in India. It's a vague region, I think, not something easy to look up like a city or state---kinda like we in the US would use "the Northeast".
  3. The relentless assault of spam begins precisely at midnight, Eastern Daylight Savings Times, and tapers off between 8 and 10 AM, Monday through Saturday. This must be a common work shift somewhere.

 

@vv Thank you. I was just trying to be dramatic to a humorous extent. I voted up your Question when I first read it.

I updated the code to work with eval's recurse option, and to prettyprint correctly when it returns unevaluated.

If you can think of some more interesting test cases, please test them. I do appreciate all testing of my code; I do tend to post quickly with inadequate testing.

An interesting situation is that eval itself, when it returns unevaluated, has a bound variable. For example, in Eval(f(x), x= a), x is a bound variable. The new eval works correctly with these bound variables, although I haven't yet updated the examples section of the Answer to show that.

@vv Okay, my procedure has been corrected, and I added your new example to the examples section.

Kitonum's solution also "fails" for eval('g(x)', x= 2*x), yet you gave his a vote up whereas mine is treated like a piece of trash to be kicked to the side of the road.

@emendes If L is a list, then <L> will print line by line. If L has more than 10 members, then you'll need to issue the command

interface(rtablesize= infinity);

You only need to issue this command once per session, and you can put it in an initialization file. You can replace infinity by any positive integer that you want to be the maximum number of lines to use.

@vv I think that eval can be easily corrected to handle these situations (see my Answer). If this were done, then there's no need to inform the user about potential problems.

@ecterrab I wonder if you would feel the same way if it were sum instead of int? Please see my Answer below where I apply the same principles to both the default sum and your redefined sum from the Physics package, and then I apply my corrected version of eval to both.

I feel, and I believe that VV feels, that regardless of what the function f is, eval(f(x), x= 1) should equal eval(f(z), z= 1). If this isn't true, then eval is no better than subs.

Ideally, all procedures which use bound variables in their arguments (such as int, sumlimit) should treat their bound variables the same way that seq, add, and mul treat their bound variables. Furthermore, there should be a parameter modifier to declare a variable as having that special status like the bound variables of  seq, add, and mul.

@Preben Alsholm The way that Google (and I guess some other search engines) order search results in based (partly) on how many other web pages the URLs appear on. This is the famous "Page-rank algorithm"---how Google founder Larry Page became famous. Thus, someone who wants to raise the rank of their page wants to get their page's URL mentioned on as many other pages as possible. This is called SEO: Search Engine Optimization. (Not all SEO is nefarious. Legitimate non-spam-related SEO is a major business.)

First 388 389 390 391 392 393 394 Last Page 390 of 711