Carl Love

Carl Love

28045 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

@vv Thank you for testing my procedure.

In all cases, my procedure's time is O(y), where is the y-value of the final output. In the cases that the OP has presented so far, y < < LCM(m). (In other words, the minimal has been quite surprisingly smaIl in the OP's cases that we've seen here.) I don't know whether this is coincidence or whether it has to do with details of the OP's overall problem that we haven't seen yet.

My procedure does not automatically reduce the moduli when it's possible to do so. It could easily do that; I simply didn't implement it. In the cases presented so far, the 3rd and 4th moduli can be reduced to 23^2 and 17^2 (as you noticed in your first Answer). Using these reduced moduli, I get the result for your 6-equation example in about 2 minutes, [X = 5220211473, Y = 10734787609]. I am considering some ways to reduce that time.

@sursumCorda Your code is slow for two reasons:

  1. It's checking every value of y starting from 1.
  2. It's redoing the harder modular arithmetic for every one of those y.

First of all, we can prove that any y solving the equations alone (i.e., irrespective of the inequalities) is a multiple of 91. So 90/91 of your iterations don't find any solution. Second, the vast majority of the modular arithmetic required for this can be done once and for all by a single call to chrem.

I see that the "Product: " in the header of this Question has been changed from "Maple Calculator" to just "Maple". In Maple, the above series can be obtained by

convert(GAMMA(a,z), Sum, z= 0);

and making a few minor (high-school-algebra-level) simplifications to enhance the presentation.

 

@Traruh Synred I meant to just run the memory-measuring procedure 100 times to check whether it itself was contributing to the leak.

To diagnose the potential leak further, we need to see your code. You have thought that you've uploaded code a few times before, but it never seems to have worked. Can you describe what you do, exactly which buttons you press?

If need be, you can email me your worksheet. Use the "More" -> "Contact author" pull-down at the bottom of this message to send me a preliminary email, and then I'll send you an email address to use to send the file.

@C_R The double-arrow from the palette is being treated as an &-operator, which means that it has higher precedence than any other operator in the expression. So its left operand doesn't include the initial not. Both the left and right operands of <=> need to be parenthesized. 

As a completely separate issue, you also need to stop the automatic simplification of the right operand by making it (``(not P) and ``(not Q)) (using your desired palette symbols).

Doing these two things, I get this output for the 1st Law:
 

@Traruh Synred Initializing a variable in the same line that it's declared makes no difference.

Try running it 100 times in a row. Can't draw conclusions from just 2 runs.

I wouldn't call this a "tutorial", but it'll be a useful starting point if you haven't seen it already

help("OpenMaple,Python,API");

@Traruh Synred You wrote:

  • I add the 63-word array that 'kerneloptos(memoryuse)' creates. 'MemoryInUse' doesn't do that. 

What makes you say that? Although it doesn't use an array per se, it does essentially the same thing using a list of lists. See its code via

showstat(MmaTranslator:-Mma:-MemoryInUse);

Local variables do get deleted when they go out of scope. For example,

MemUse:= proc() 
local M:= Array(kernelopts('memusage'))[..,3], x;
    add(x, x= M) 
end proc:

After calling MemUse()is inaccessible and gets deleted by the garbage collector.

Your header says "Maple Calculator". Do you just want to see the series for reference? If so, you could just look it up in an online reference. Or do you want it to do some calculations? I don't think that Maple Calculator is very practical for something that elaborate; not sure. I don't mean that it's incapable, just that entering and manipulating the formulae is awkward.

@vv I think that a reasonable and feasible goal for future Maple would be to give the mimimal exact integer solution to Archimedes's Cattle Problem, which is a famous ancient problem of the type in this Question. The answer has 206,545 digits, which is well within the capability of Maple's GMP integers.

@vv Okay then. I hadn't previously noticed your corresponding change of the coefficients.

@adel-00 You spelled solve as "slove".

Assign the result of solve, for example

xyz:= solve(...);

Then in the plots, do

plot3d(eval(x, xyz[]), ...);

and likewise for the y and z plots.

@FDS Regarding efficiency, the time on my computer to compute the minimizing parameter values for the 192 data points was 120 milliseconds.

@vv You changed the 3rd modulus from 23^3 to 23^2. Apparently, this doesn't change the final x and y.

@FDS Okay, but note that my technique reduces the error (specifically sqrt(SSE), the square root of the sum of the squared residuals) by a factor of 26 compared with the MathCAD values.

Edit: I just saw that you increased the data points to 192. I'll make the comparison again with the new data.

Edit 2: Using the new data, my reduction factor in sqrt(SSE) is 1.4. The parameter values that I got are Q__0 = 7018.5, Q__s = 2813.2, k__f = 2.0578 * 10^(-5). These are in the same ballpark as the MathCAD values.

First 37 38 39 40 41 42 43 Last Page 39 of 709