Carl Love

Carl Love

28130 Reputation

25 Badges

13 years, 312 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@michjoh 

My primary purpose in the Answer above was to explain how to do a double break because sometimes it can't reasonably be avoided, and it also seemed to be the way that your thinking was headed. However, your code above uses an explicit loop to search through a table. This is not an efficient way to search. The time complexity is O(M*N^2) or possibly even O(M*N^2*ln(N)) (with the extra ln(N) because of the possibility of table indices not being stored linearly---I'm not sure how they're stored). Tom Leslie came up with a better way to do it: He uses an array for storage and the built-in member for the searches. Search by member still uses time proportional to the size of the object being searched, but is significantly faster than a for loop because it's built-in. I think that I can reduce the search time to logarithmic by using a table to mark the visited spots (kind of like marking your trail when you're lost in the woods so that you know when you've crossed your own trail). I'll probably have a chance to code it later today. It'll have time complexity O(M*N*ln(N)).

@michjoh I'm sorry that I didn't see this "Follow-up question" at the time that you posted it. On a quick reading, I think that this question has subsequently been answered in your subsequent thread "Break to form new lines". So, before I delve into this, please let me know if an answer is needed here.

You have one equation with 14 variables. If you can't come up with some numeric values for these so-called "constants", then the situation is hopeless.

@want to be a permanent vegan 

You say that "it" doesn't work. I want to make it clear that "it" refers to your functions, not my solution to your previous problem. My solution does indeed work in the sense that it corrects the error that you were getting before, which was a Maple error. This new error is a deeper more-mathematical error in your functions, which I'm too tired to delve into right now.

One way of achieving the piecewise plot that you want is this:

plots:-display([plot(I1, 0..100), plot(I2, 100..200)]);

Once again, the above will work if and only if your functions can be evaluated to real values in their respective intervals, which I haven't checked.

@Markiyan Hirnyk 

I was a member of one of the perfect-score teams in the contest, and the only member of that team who was expert in Maple. I completed four of the problems in Maple, one of which was the problem we're discussing now.

All of the problems were, by design, probably impossible to do directly with any CAS in existence at the time. I'm not sure that Prof. Lloyd N. Trefethen (the one who posed the problems) actually checked every CAS, but he was (is) a renown expert in such matters. By "doing the problem" I mean, for all ten problems, obtaining ten decimal digits of approximation; symbolic solutions are not wanted. All of the problems required (at that time) a significant amount of computation and a significant amount (many hours or days) of "by hand" work to get the ten digits. Much faster solutions have subsequently been found for most of the problems.

It's possible that Mathematica has made good use of the wealth of knowledge provided by the many published solutions to the problems (a whole book has been written about these solutions); I believe that Maple has failed to make use of that knowledge. The book is The SIAM 100-Digit Challenge: A Study in High-Accuracy Numerical Computing by Folkmar Bornemann, Dirk Laurie, Stan Wagon, and Jorg Waldvogel; 2004 SIAM (the Society for Industrial and Applied Mathematics); ISBN 0-89871-561-X.

@Markiyan Hirnyk Yes, if a Maple table is truly desired, it would be done like that. I was just guessing that the OP was using table colloquially, not in the Maple sense of the word. But you may be right.

@Markiyan Hirnyk Nice use of DirectSearch to find complex roots of a complex-valued function. I converted your Reply into an Answer so that I could vote it up.

Regarding your inability to upload the file to MaplePrimes: MaplePrimes has a problem with certain special characters in filenames.

Regarding my Answer: My main purpose was to show the OP how to improve his code that filtered the roots given by fsolve. I'm not at all surprised that fsolve missed many roots. I am suprised by the abyssmal failure of RootFinding:-Analytic to find any roots at all.

@Markiyan Hirnyk With fsolve, I found 16 roots in just the third quadrant of the OP's rectangle. These are shown in my Answer below. My first attempt was also to use RootFinding:-Analytic. I tried many different ways, but couldn't find a single root with it. I tried several smaller regions over which the function is indeed analytic.

Regarding your plot, I believe that the function is too "wavy" for its behavior to be adequately captured on the coarse grid of your plot. The magnitude has many very steep and narrow "valleys", as shown on my plots in my Answer.

@acer I don't know if this is a 2D-input difference, but don't you mean Shift-Enter rather than Ctrl-Enter? For me (using Maple Input (1D)), Ctrl-Enter inserts a page break.

I appreciate that you uploaded your worksheet for us to read. It'd be helpful if you'd also attach it to your post so that we could download it to work with it in our own Maple.

@sunflower 

1. Don't remove a Reply after it has already been replied to. That makes my previous Reply seem out of context. You had asked for an explanation of the lines where I defined rectangle.

2. If you want another house, you'll need to tell me what to put on it. I don't have much artistic imagination. And why do you want another house? How about just asking a question directly?

3. I have no idea what you mean by "form".

4. Your English doesn't make me unhappy.

@sunflower I don't know if this'll be much help to you, but those two lines mean the same thing as

rectangle:= proc(Point, height, width)
     plots:-polygonplot(
          [Point, Point+[width,0], Point+[width,height], Point+[0,height], Point],
          args[4..]
     )
end proc:

You should look up ?parameter in the Maple help. That should keep you occupied for a few days.

The integral I5 clearly converges for any real x0! I'd expect even my good calculus II students to see that (without using Maple). The expression under the radical is strictly positive, so there are no poles to worry about. Do a limit comparison test with Int(1/x^4, x= 1..infinity).

P.S.: I just saw that Preben said essentially the same thing.

Your example doesn't make sense. What does Oy mean? What does "limit by y, x=1, y=5" mean?

To understand what a tubeplot is, you must first understand what a spacecurve is. Look up the help for spacecurve (?spacecurve). Let me know if you understand that. If you don't understand that, we'll need to start there.

@tomleslie Tom's Answer is the true answer (an exposition of The Way), not a fake. If you want to do symbolic computation, don't use floats. His Answer works on irrational bases also, despite what he says, and any float can be converted to a rational.

Kitonum's Answer uses a fake technique. This is not meant as a disparagement of Kitonum's Answer---the fake can be useful sometimes.

First 450 451 452 453 454 455 456 Last Page 452 of 711