Carl Love

Carl Love

20278 Reputation

24 Badges

8 years, 109 days
Mt Laurel, New Jersey, United States
My name was formerly Carl Devore.

MaplePrimes Activity

These are replies submitted by Carl Love

@nm SemiAlgebraic only works for systems of polynomial equations and inequalities, and perhaps some cases that can be easily converted to polynomials.

Are A and always polynomials? 

Don't edit your Question such that it becomes a completely different Question. It's extremely rude if the Question has already been Answered, as this one has been.

If you have an unrelated Question about matrix arithmetic, start a new Question thread.

@nm The partial fraction decomposition depends on the factorization of the denominator used. The presence of the nonreal I suggests (but does not mandate) that a splitting into linear factors is desired. So Maple's result and your analysis of it are correct if the given factorization as a square of an irreducible quadratic is the desired factorization. In that case, it's considered irreducible over the field of rationals extended by I.

@acer Your 3rd procedure, mm1sub3, ignores its 1st parameter, x. I can't tell if that was intentional or an oversight. If it was intentional, please explain why you did it that way. 

In "Maplese", the labels that you're referring are called tickmark labels (as opposed to axis labels). And, of course, the small lines perpendicular to the axes are the tickmarks themselves, the smaller ones being called subticks. Kitonum's Answer shows a way to remove all the tickmark labels and the tickmarks. Is that what you want? Or do you just want to remove the labels? Or do you just want to remove some of the labels? And you may not be aware that you can also change the tickmark labels to any expressions, numeric or otherwise. Do you want that?

@ogunmiloro You asked:

  • can the model ''th := x -> a__1*(tanh((x-c__1)*b__1)+d__1) + a__2*(tanh((x-c__2)*b__2)+d__2)''
    be used for data on daily active cases?

No, absolutely not. A sum-of-sigmoids model can only be used on cumulative data. However, if the amount of time that cases remain "active" is fairly short and fairly constant, then the derivative of a sum-of-sigmoids model might work. But it also might not because the active-case data has much more noise due to the time that cases remain active not being truly constant.

  • can a plot be made from the observation of your simulation  ''Observe that the residual sum of square is 1.5e8 instead of 8.3e7''? 

Your question doesn't make sense to me. The residual sum of squares is a single number (which when viewed in the context and especially in the units-squared of the problem can represent the quality of the fit). How can a plot be made from a single number?

@mmcdara Vote up.

The OP has posted many Questions over the past year in an attempt to model this exact data set. It's clear that an appropriate model is a sum of sigmoid functions. It's clear that the OP wants to model the data and extrapolate the model. Thus the exponential fits, high-degree polynomial fits, and splines of the other Answers are utterly worthless (and the polynomials and splines couldn't even be called "models" in the scientific sense).


  1. Show the extrapolation of the sum-of-sigmoids fit out to its upper horizontal asymptote. I think x=500 is a good stopping point.
  2. It's clear that the positivity constraint is mandatory for this problem. What you did to enforce that constraint is important and interesting. However, the part where you actually do a fit without that constraint is distracting and should be relegated to an appendix or footnote. 

Your last Reply adds to the confusion. What does "I am not using the 17v" mean? There are two relevant versions here: Maple 17 and Maple 2017. They differ by several years and several major releases. So which version do you think that you're using? The evidence collected by acer strongly suggests that you're actually using Maple 17.

@Carl Love The function L1 seems to have some extreme numeric instability.

For d=1, I tried to integrate its real part on the interval -10..10 with Simpson's Rule and other higher-order Newton-Cotes formulas. Even using a partition of 2^23 (~8 million) subintervals, I couldn't get convergence in the second digit. The first digit was fairly stable: 0.1....

@tomleslie You wrote:

  • I can see quite a lot of freeze() and thaw() commands bweing used!

It only requires one freeze and one thaw. Indeed, it can all be done in a single line:

thaw([solve](subs(diff(y(x),x)= freeze(diff(y(x),x)), eq), y(x)))[],

where eq is the ODE in "normal" form (with diff, not D).

@adel-00 I did the following things:

1. I set Digits:= 15
2. I made the substitution for as we discussed.
3. I set epsilon = 1e-5 in the Int command. This means I was trying for about 5 digits precision.
4. I used -20.. 20 as the interval of integration.
5. I set d=1.
6. I attempted to numerically integrate the real part of the integrand, i.e., I wrapped it with Re.

After 4 hours or so, the integral returned unevaluated. I guess that that means that it couldn't achieve even the 5 or so digits of accuracy implied by epsilon=1e-5.

I also tried several other things.


The command index was added in Maple 2017. For older Maple, simply replace index with 

e-> e[_rest]

For horizontally displayed fractions, modify the table creation command to 

Fr:= table(
    sort([indets(P, And(string, float &under parse))[]]) =~
        f-> sprintf("%d/%d", op(f)),
        sort([indets(GraphTheory:-WeightMatrix(G), fraction)[]])
subsindets[2](r, And(string, float &under parse), Fr, e-> e[_rest]);

@snowman You're welcome. See the followup "Aliasing" that I just added to my Answer.

I finally got a chance to look at the plots from your Question on a standard-resolution (HD) monitor instead the high-resolution HP (QHD) and Samsung Galaxy Note (WQHD) that I usually use. And now that I've done that, I'm convinced that the issue that causes the "roughness" is what I suspected when I wrote the Answer above: Technically, it's called aliasing, and it's a major issue in all computer graphics, and indeed in any discretized representation of a continuous process. In terms simplified to this particular application--the plotting of curves--it's a result of there being too many computed points (rather than too few) compared to the number of available pixels.

There are some things that you can do in Maple to ameliorate aliasing. The first of these applies in general, the second is specific to implicitplot, and the third could be applied to any curve-plotting command.

  1. Go to menu Tools --> Options --> Display and set "plot anti-aliasing" to "enabled" if it's not already so.
  2. Use the resolution option to reduce the number of points in the plot structure and hence the number of points sent to the renderer. The value of the option needs to be based on your specific output device.
  3. In this particular case, your curve is perfectly smooth (in the mathematical sense) and monotonic, so there's no need to compute a large number of points (via a high gridrefine) in the first place.

Wikipedia has detailed information about aliasing: "Anti-aliasing" is an index article to seven Wikipedia articles on the subject. The last of these, "The Nyquist-Shannon sampling theorem", provides a mathematically precise description of the phenomenon.


3 4 5 6 7 8 9 Last Page 5 of 570