Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Ioannis The plot that Rouben posted above (vote up) shows two paraboloids. The one on the right is much flatter than the one on the left, and this causes an optical illusion that makes it more difficult to see it as a paraboloid. The two paraboloids could be more easily distinguished with color or some other artifice, but, for the time being, I'll leave it to Rouben to make that embellishment (if he chooses) because I have more-pressing things to do.

@mmcdara Your timing is not accurate because CodeTools:-Usage doesn't account for the fact that the result of ifactor (and thus also ifactors, essentially) is cached.

I suspect that your code could not easily handle the number shown in my example immediately above because of the powerset being much too large.

You should be able to run the procedure immediately above in Maple 2015. Perhaps you'll need to change mul(S) to mul(x, x= S) and likewise for mul(S[2..]).

This procedure below does the same as my Answer above, in essentially the same way, but it illustrates how the computation is performed via repeated application of the geometric sum formula to the prime-exponent pairs of the prime factorization. The number tested in the example below is so large that even listing its divisors or iterating through them is totally out of the question: There are ~1 quadrillion = 10^15 of them.

SumOddComplementDivisors:= proc(n::integer)
local P, S;
    if n=0 then infinity
    elif abs(n)=1 then 1
    else
        P:= ifactors(n)[2];
        S:= map(p-> (p[1]^(p[2]+1)-1)/(p[1]-1), P);
        `if`(n::odd, mul(S), (S[1]+1)/2*mul(S[2..]))
    fi
end proc
:   
n:= 2^29*mul(ithprime(k)^rand(1..9)(), k= 2..19)*nextprime(2^29);
n := 39943730387748903870428897494573005555549238795858219140794\
  08427992979376542681824710226320630046887046180225126687753224\
  85014780614541312000000

CodeTools:-Usage(SumOddComplementDivisors(n));
memory used=98.26KiB, alloc change=0 bytes, cpu time=15.00ms, 
real time=4.00ms, gc time=0ns

1531661487716093169531385014455233133797946665998965276549256385\
  11203272409082014900523213313509988736347844419100663992744771\
  3886226087936000000

#Count the divisors:
NumberTheory:-SumOfDivisors(n,0);
                        999959385600000

evalf(%);
                                      14
                        9.999593856 10  

ifactor(n);
    29    7    6    2     4     6     5          8     5     2 
 (2)   (3)  (5)  (7)  (11)  (13)  (17)  (19) (23)  (29)  (31)  

       2     4     8     3     9     2     8     9            
   (37)  (41)  (43)  (47)  (53)  (59)  (61)  (67)  (536870923)


 

@mmcdara The name that I used for my procedure, SumOddDivisors, may have caused your surprise/confusion. I'll admit that I should've come up with a better name. My procedure doesn't sum the odd divisors, but it does do what the OP wants: It sums the divisors d such that n/d is odd.

I'm at a loss for a good name for this, and suggestions are welcome. How about SumOddComplementDivisors?

@Kitonum It's extremely inefficient to loop through all positive integers i <= n. Your procedure is essentially unusable for n > 10^8. At the very least, your procedure should be modified to

S := proc(n) 
local i, s;
uses NumberTheory;
s:=0; 
for i in Divisors(n) do 
    if type(n/i, odd) then s:=s+i end if; 
end do;
s;
end proc:

It's shocking that this Answer was awarded 2 votes up and Best Answer.

@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).

Suggestions:

  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....

First 141 142 143 144 145 146 147 Last Page 143 of 709