Carl Love

Carl Love

23953 Reputation

25 Badges

9 years, 311 days
Natick, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity

These are replies submitted by Carl Love

@MANUTTM What do the independent variables ySr, and g represent? I'm puzzled by the recent appearance of g, which seems to be an independent variable of D (demand) only? Do you have a way to compute D(g, Sr) for any feasible g and Sr

@wswain You wrote:

  • I am not sure why when I tried to change the execution group to Maple Input (with F5 and by the pull down) and it kept responding as in 2-D mode even though it said "maple input" in the bar.

I've noticed that myself in Maple 2022. I don't know whether it's a bug or it's supposed to work that way; nor do I know when, if ever, that changed.

@acer Thank you. When I checked, it was listed (with dead links) in Recent Posts and Active Conversations, but not in Recent Questions. It seems to take an inordinate amount of time for that update to happen.

@Rouben Rostamian  Although what you posted is not a complete Answer, it's almost an Answer, and it's all in the right direction towards getting a complete Answer. So, your significant quantity of work is appreciated and deserves a vote up.

@vv Amazing, but how did you find and its argument? 

Why are you using a finite-difference derivative approximation? And with such a large value of delta (0.01) at that? If there's some reason why you can't use a regular derivative, that may explain why fsolve is not working. fsolve might work with a lower value of Digits, say 5 or 6. The default in Maple is Digits = 10, so there's a good chance that's also the default in Maple Flow.

@mmcdara In Maple 2022, I tried your Student[Statistics]:-Sample command and numerous variations. They either returned hfloat results identical to Statistics:-Sample, meaningless results (e.g., when using Binomial(100, 3/10)), or some indication that the input wasn't understood (e.g., when using BinomialRandomVariable(100, 0.3)).

It would be nice if there was a nicer way than trunc to get Sample to return integers for integer distributions.

@pointerbender As to the reason that it helps, note that vv's idea is a standard trick for proving summation formulas by mathematical induction. As in


#Use mathematical induction to prove this:
S:= n-> Sum(k, k= 1..n) = n*(n+1)/2:

Sum(k, k = 1 .. n) = (1/2)*n*(n+1)

#Base case:

Sum(k, k = 1 .. 1) = 1

#Inductive case:
S(n+1) - S(n) = n+1;

(Sum(k, k = 1 .. n+1)-(Sum(k, k = 1 .. n)) = (1/2)*(n+1)*(n+2)-(1/2)*n*(n+1)) = n+1


(Sum(k, k = n+1 .. n+1) = n+1) = n+1



Note that I've only used the inert command Sum rather than its active form sum. So the proof is making no use of the fact that Maple's sum already knows the formula that we're trying to prove, which of course wouldn't be fair.

So that your Question can be better Answered, please clarify these things:

  1. Your example problem is so trivial that I'm having trouble answering it partly because there are so many ways to code it (most of which don't use recursion) and partly because it's hard to understand why anyone would want a recursive solution for something that can be completely solved with a very simple equation (x[i] = x[0] + i*b). I suspect that the other two respondents have similar thoughts. So, if this was just intended to be a simple example of a more-general problem that is your actual interest, then please give a more-relevant example.
  2. What do you mean by "binary" in the title? Yes, I know what binary means, but I can't see how it applies to your example. Perhaps if that were explained, the example wouldn't seem so trivial.
  3. Reading what you wrote as standard mathematical English, it seems that you want to restrict the solutions to a particular set A. That's not possible if your other mathematical symbols are meant in their usual interpretations. (Thus, the other two respondents assumed that you meant that you want the output sequence as a set, without restriction.) So, what did you really mean by the set A? The restriction to a given set is not possible because once a value is given for b and any single x[i], the rest are completely determined by your formula x[i] = x[i-1] + b.

@ecterrab It is not "an entirely different problem". In both cases, an anomaly occurs because the input expression can be simplified to 0. Whether that occurs inside of a RootOf is of minor significance. I wanted to present an example that would give problematic results without an error message[*1], so I intentionally chose one where RootOf wouldn't be involved.

[*1] ...because bugs that are manifested without throwing an error are much more dangerous and insidious.

@acer Here's a similar but simpler case with problematic (IMO) results. I prefer the solve result.

PDEtools:-Solve(sin(t)^2 + cos(t)^2 - 1, t); #NULL output 
solve(sin(t)^2 + cos(t)^2 - 1, t);

You wrote: 

  • Will the above work all the time? should this command be used to obtain this information or is there a better way?

You need to reread carefully your posted output of your own commands, because they didn't even work on the example that you showed. The extremal values of the second coordinate do not necessarily correspond to the extremal values of the first coordinate. However, extracting the min and max (rather than the first and last) of each column of the data matrix is a viable strategy for obtaining the "true view"---one that I've used myself to get around that DEFAULT problem (long before the "originalview" field was introduced).

@angelisasking I think that all that you need to do is change the i on the right side of the line of code that I indicated to some other otherwise-unused variable.

@Will_iii Since I don't have Maple Flow, I can only answer by comparing to Maple itself. From what I've seen so far, Maple Flow is just a large subset of Maple commands in a completely different GUI interface.

Since log[b](x) = ln(x)/ln(b), surely this will work:


Since your error message indicates that the Units:-Simple package is being used, there's a chance that this will work:


The :- is to tell it to NOT use the package version of log. It works in Maple, but I don't know whether it works in Maple Flow.

There was an Excel file containing the 3D data attached to your recently deleted duplicate Question. Please post and/or attach that file here.

1 2 3 4 5 6 7 Last Page 1 of 625