Carl Love

Carl Love

28050 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Kitonum See help page ?QuaNtile (not ?QuaRtile). It documents the eight interpolation method options that can be used with either command.

@Stretto The reason that I asked about restart is because your maple.ini is executed whenever you do a restart, as well as when you start a new worksheet or open an old one. So, is there any difference in your blank line situation between using restart: and restart; ?

I suppose that you already know to suppress the output inside the maple.ini with colons. But colons don't suppress explicit output statements print, printf, lprint, userinfo, etc.

@Ali2020 All these seemingly weird syntax innovations work in Maple 2019 if you use the input style Maple Input (also commonly called 1-D input). This is the style where the input characters are in a monospaced reddish-brown upright bold font (as shown in my code box).

Short        Equivalent longer 
syntax      syntax                           When added (approx.)
----------------------------------------------------------------------------------------------
y::odd                 type(y, odd)     has been valid for decades
s+= x                   s:= s+x           new to Maple 2019
--y                        y:= y-1            new to Maple 2019
x*= 2                    x:= x*2           new to Maple 2019
y/= 2                     y:= y/2           new to Maple 2019
(x,y):= (1,2)          x:= 1; y:= 2;    has been valid for 15 years or so

But there's one feature that I used that has no current equivalent in 2D Input, and it's a profound, game-changing improvement to Maple coding that saves much coding time and much computation time. That is, a looping command (such as while) can be used as an expression rather than as a statement. When this is done, the expression returned is the sequence of the evaluated final expressions in the loop. This allows for the efficient creation of sequences that cannot be created with seq.

I've spent many coding hours over the years converting inefficient loops (inefficient because of the immutable-container issue described in the Answer) into more-efficient forms, such as seq. That's no longer necessary! Hoorah for Maple!
 

Since the singularity of sec (or tan) at Pi/2 is not integrable, you have a problem with this particular example. However, if the integration is possible, then summing an arbitrary number of them is quite easy, and I'll show it in an Answer.

I edited the title of your Question. Please don't try to fit your entire Question into the title box!

@mmcdara I don't see any theoretical difficulty for a CAS to correctly handle the arithmetic of infinity. For Maple, for the bugs that you showed, it'd be a matter of suppressing some automatic simplification. Many such things have been improved with automatic simplification over the years. For example, times a Matrix returns a zero Matrix rather than plain 0. So, I wouldn't be surprised if there was already a CAS where one did not need to be very careful regarding infinity.

However, note that automatic simplification is an essential part of Maple's efficiency. It's quicker to process expressions if the rule is simply "explicit A - A = 0, always".

In addition to being new to Maple 2019, most of its new syntax features only work in 1-D input (aka Maple Input).

@Stretto What happens in your session if you use 

restart:

that is, the output of the restart is suppressed with a colon? (This is just an info-gathering experiment; I'm not claiming that this will or won't solve your blank-line problem!)

 

@Stretto You wrote:

  •  I did look in to memoization but I felt it wouldn't work well since I imagine it would try to remember everything....

It's only used for the specific procedures to which it's applied, not everything.
 

There are two procedure options for limiting the memory used by memoization. The first is 

option remember, system;

With this option, the procedure's remember table is cleared whenever there's a garbage collection. (Whenever you see the memory or time numbers on the status bar change, there's been a garbage collection.)

The second is 

option cache;

A cache is a remember table with a limited number of entries. Once the limit is reached, each new entry causes the removal of the least recently used entry. The default number of entries is 512. That can be changed to some other value, for example, 1024, by

option cache(1024);​​​​​​

Once a procedure has option cache or remember (with or without system), it automatically remembers previously computed values; no explicit assignments are needed, although they are allowed (and often useful).

The command forget can be used to dump remember tables.

Procedures which are local to other procedures can also have remember tables. These will get garbage collected just like any other local.

The statements 'x' = x: and the following with cannot possibly do anything useful, not even display any useful information. I'm wondering what your intention was with those. 

@Carl Love Here are some example solutions under the second pedagogical model that I gave above.
 

Question 1

restart:

v:= t-> t^3-t^2-4*t+4:
maximize(v(t), t= 0..2);

4

Question 2: (ambiguous question)
Answer 1: Net distance:

int(v(t), t= 0..4);

80/3

Answer 2: Total distance:

int(abs(v(t)), t= 0..4);

167/6

Question 3:

restart:

y1:= 5:  y2:= 2*x^2:
int(abs(y1-y2), x= `..`(solve(y1=y2, x)));

(10/3)*10^(1/2)

Question 4:

restart:

y:= 4:
int(Pi*y^2, x= 0..3);

48*Pi

 


 

Download Answers1.mw

If your main interest is the number of partitions of a number rather than the partitions themselves, then this Wikipedia page is more relevant: https://en.wikipedia.org/wiki/Partition_function_(number_theory) It's where I got the recursive formula in my Answer below.

@rwjewett Thank you for the problems, but to understand the scope of the project, we need to see the solutions. In particular, we need to know the extent to which you want Maple's computational abilities to be used. Here are pedagogical models at two extremes:

  1. Minimal computational use of Maple: Maple is only being used as a mathematical typesetting system for a full-English-text exposition of a "by hand" solution as would be found in a textbook's companion solutions manual. If this is the case, it would be easier to do the project with actual mathematical typesetting software.
  2. Minimal textual use of Maple: Maple's computational abilities are used to whatever extent possible with minimal exposition. This would be fairly easy for someone familiar with Maple, especially the Student packages.

There are many levels of gradation between these extremes.

@minhthien2016 As I said in a Reply to the main Question, that's not a solution to the original problem. Regarding my dimensionality argument, allowing a 7th parameter with 6 equations means that the solution space likely has topological dimension 7 - 6 = 1 in C^7, so the probability of an integer solution is no longer infinitesimal.

The solution that you found in your addendum is not a solution to the original equation! The coefficient of x^2 is not a parameter in the original. Allowing that coefficient to be negative changes VV's convexity argument. Allowing it to be a 7th parameter changes my dimensionality argument.

@Carl Love The header has changed, and no longer says Maple 2016.

First 225 226 227 228 229 230 231 Last Page 227 of 709