Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@mattcanderson1 

It is ambiguous whether the OP is interested in the convergence/divergence of a series or of a sequence. Since the word "series" is used and "sequence" isn't, I think that a series is more likely. But then there's "Is this function convergent or divergent?", which implies an interest in the sequence.
 

@MDD There's a lot to explain. I may do this a few lines at a time. I'll start with procedure CoeffsOfLinComb, which is my version of Kitonum's algorithm. I guess that the first line that needs some explanation is 

  V::set(name):= indets(L, And(name, Not(constant))).

This declares the second parameter to be called V. If a corresponding second argument is passed, it must be a set of names; if a second argument isn't passed, then will be assigned a default value of all the names in the first argument, L, that are Not constants (such as Pi).

The next thing that might need explaining is 

C:= {c[k] $ k= 1..nops(L)}.

This declares a local variable C and assigns it the value of a set {c[1], c[2], ..., c[n]} where n is the number of polynomials in (nops(L)). This can be expressed (with the sequencing operator) as "the set of c[k] where runs from to nops(L)."

I'm tired...that's enough for now.

@Kanellopoulos I don't know if the Maple is correct. There is that 1 point (out of the 18 that I checked) with relatively high residuals. Can you check the residuals in Mathematica? 

Maple's algorithm is the "theta method". This is the only method that it ever uses when there's more than one PDE.

@Kanellopoulos It's a moot point now because I've already reconstructed your worksheet by cut-and-paste from the PDF, but please, next time, upload the worksheet directly to MaplePrimes using the green up arrow like I said. The Dropbox version is unusable to me.

We can read the PDFs, but not work with them in Maple. Use the green up arrow on the toolbar in the MaplePrimes editor (last item on the second row of the toolbar) to upload a Maple worksheet in .mw or .mws format.

Please post the equations, the Maple code that you used to solve them, and the Maple code that you used to plot. Regarding checking the solution: That is generally possible through numeric differentiation with the fdiff command.

@MDD It's done. Please find procedure PolyLinearCombo in an Answer below.

@crockeea 

Sorry, once I found a fix for pdf1, I didn't continue because I just assumed that the other pdfs were simply your attempt to correct pdf1

While it is true that your procedures pdf3 and pdf4 don't return a purely numeric value when called with symbolic input, they still evaluate and return a mostly numeric floating point result. This is enough to mess up the computation.

It's easy the analyze what's the special value returned for symbolic input. Just perform the steps on the desktop. I'll do it for pdf1i mod 2 returns i. (The is treated as a polynomial, and the mod is applied to its coefficients.) doesn't equal 1, so the else branch is taken, which produces a purely numeric result. floor(i/2) returns unevaluated. On the second round, the mod also returns unevaluated. Once again, the result doesn't equal 1, so the else branch is taken, producing a purely numeric result. So the "magic" value is (1-pr[0])*(1-pr[1]) evaluated at whatever the setting of Digits is.

By the way, the distinction between procedures declared with proc and those declared with the arrow is very small. Don't read too much into it.

@MDD The coefficients are necessarily already computed at the time the determination of false is made. They are only returned to potentially help with debugging is, which occasionally returns false when it should return true for some extremely complicated expressions that are identically equal to 0.

Note if the input is restricted to polynomials, then you can use the procedure PolyLinearCombo from the other thread. That procedure doesn't use is; the determination true or false is made just by looking at the coefficients. 

Can you post the code? It's very easy to write parallel code that deadlocks and yet works as documented. I'm not saying that that's what's happened in your case, but it does need to be ruled out before searching deeper in the system software for a bug.

You can test your ability to run parallel code like this:

WasteTime:= proc(timeout::positive)
local st:= time();
     while time()-st < timeout do end do;
     time() - st
end proc:

Threads:-Seq[tasksize= 1](WasteTime(30), k= 1..kernelopts(numcpus));

Change the 30 (seconds) to whatever amount of time you need to verify that all threads are running.

I think that what you're calling a "furtex" is called a Mutex in Maple.

@Kitonum I like your way better than my way (evaluation of the variables at random values) for those problems that your way works on (all polynomials and the target is 0). Here is a variation of your way that sets all the free variables to 1 and returns just a list of nontrivial annihilating coefficients.

CoeffsOfLinComb:=proc(L::list(polynom), V::list(name))
local
     c, k, C:= {c[k] $ k= 1..nops(L)},
     S:= solve({coeffs(expand(`+`((C*~L)[])), V)}, C),
     F:= indets(rhs~(S), name) intersect C=~ 1
;
     eval([C[]], eval(S,F) union F)
end proc:

Let me know if you want it translated to Maple 12.

The error message shown in your worksheet is 

Error, (in CodeGeneration:-IssueError) cannot resolve types in {numeric, CodeGeneration:-Names:-ArrayType(numeric, CodeGeneration:-Names:-ArrayRanges(1 .. CodeGeneration:-Names:-unknown), CodeGeneration:-Names:-ArrayOptions())}

Why do you think that this error is due to the length of the expression?

What is the value of your n? It must have a numeric value for you to get any simplification at all.

Several points:

1. Your model seems quite unusual with the c being used in two ways. What's the theoretical justification?

2. Please post your data. The plaintext format that you used before worked well as it could be cut-and-pasted directly into a worksheet.

3. The method that I used for your last problem can't be used on this one. That problem was only slightly nonlinear, and this one is highly nonlinear. Specifically, for that problem I could isolate the nonlinearity into a single dimension where I could do a global branch-and-bound search for the minimum.

4. DirectSearch:-DataFit is very good if you use several of its 36 methods (9 metrics x 4 minimization algorithms) and then take the best answer. It has much more flexibility than Statistics:-NonlinearFit.

5. You can install the DirectSeach package in your own file space---you don't need any permission from your University. If you installed it in your own file space, it would be just like any other Maple program that you personally wrote.

Would you please supply a more-specific example? And would you show some steps in Maple toward what you are trying to accomplish, and where those steps fail? I think that the command Primfield used in conjunction with evala may be part of an answer to your problem, but I'm not sure. See ?Primfield, and ignore the examples the use mod rather than evala.

First 480 481 482 483 484 485 486 Last Page 482 of 709