Carl Love

Carl Love

28045 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

The above plot, which is surprisingly smooth for an error plot, was made at my default setting of Digits, 15. At the more usual setting Digits = 10, you get the following more-erratic and more-normal error plot. Note that the magnitude of the scale is the same. It is also interesting to see how adjusting the dsolve options abserr, initmesh, and maxmesh affects the plot (see ?dsolve,numeric,BVP ). Note that the default setting of abserr is 1e-6, and the errors that we're actually getting are several orders of magnitude below that. So, that's fairly impressive.

There's still the issue of getting the fsolve (or another solver) to work with the procedure. I'm working on it now. This problem is very similar to this Asker's question from a few days ago about an integro-differential equation. I never got that to converge (I think because of a 0/0 issue), but I am going to try the same technique. Basically, we need to see the messages that dsolve returns so that we can fine tune the dsolve options. Also, I am going to make the derivative of the integral one of the equations in the system to avoid the need for numerical integration.

Amir: From your new coding, it looks like you learned a lot from the Answers to your question from a few days ago. Have you managed to solve any of these integro-differential equations? I think a different name is needed because the integral does not depend on the independent variable; it only depends on the solution functions. How about "BVP with constraining integral"?

This is an exciting problem. Maybe there's a paper in this.

There's still the issue of getting the fsolve (or another solver) to work with the procedure. I'm working on it now. This problem is very similar to this Asker's question from a few days ago about an integro-differential equation. I never got that to converge (I think because of a 0/0 issue), but I am going to try the same technique. Basically, we need to see the messages that dsolve returns so that we can fine tune the dsolve options. Also, I am going to make the derivative of the integral one of the equations in the system to avoid the need for numerical integration.

Amir: From your new coding, it looks like you learned a lot from the Answers to your question from a few days ago. Have you managed to solve any of these integro-differential equations? I think a different name is needed because the integral does not depend on the independent variable; it only depends on the solution functions. How about "BVP with constraining integral"?

This is an exciting problem. Maybe there's a paper in this.

@Christopher2222 In Maple17 (or online) check out ?SignalProcessing .

@Christopher2222 In Maple17 (or online) check out ?SignalProcessing .

Erik wrote:

I am not entirely sure how you make the computer use all processors? I am not an expert on programming, so please be detailed ;)

For a start, how about downloading the code that I uploaded and taking a look at it and/or using it? Also, let's see how many processors Maple thinks that you have. Execute the following line in any Maple session.

kernelopts(numcpus);

And, do know how many processors your computer actually has?

The most basic technique for parallelizing is to take the outermost loop and and re-express it using seq or map instead of for. You can't change variables that are global to (or at higher scope than) the loop because of conflicts that would occur when separate processes try to change them at the same time. So, you make them local. Then change the seq or map to Threads:-Seq or Threads:-Map. That's all there is to it for the most basic technique. Parallelizing will only work if the loop iterations are independent. In other words, the results of later iterations cannot depend on the results of earlier iterations.

Erik wrote:

I am not entirely sure how you make the computer use all processors? I am not an expert on programming, so please be detailed ;)

For a start, how about downloading the code that I uploaded and taking a look at it and/or using it? Also, let's see how many processors Maple thinks that you have. Execute the following line in any Maple session.

kernelopts(numcpus);

And, do know how many processors your computer actually has?

The most basic technique for parallelizing is to take the outermost loop and and re-express it using seq or map instead of for. You can't change variables that are global to (or at higher scope than) the loop because of conflicts that would occur when separate processes try to change them at the same time. So, you make them local. Then change the seq or map to Threads:-Seq or Threads:-Map. That's all there is to it for the most basic technique. Parallelizing will only work if the loop iterations are independent. In other words, the results of later iterations cannot depend on the results of earlier iterations.

@tuGUTS 

Most of what you say makes some sense, but I have a lot of trouble understanding your English. However, what you start off with is utter nonsense: A matrix is not a group. A matrix can be a member of a group, but it is not by itself a group. A group is a set together with a binary operation on that set that satisfies certain properties.

@tuGUTS 

Most of what you say makes some sense, but I have a lot of trouble understanding your English. However, what you start off with is utter nonsense: A matrix is not a group. A matrix can be a member of a group, but it is not by itself a group. A group is a set together with a binary operation on that set that satisfies certain properties.

The thing that stands out to me based on a "mental compile" of the code (meaning that I'm just reading it, not running it until you upload it) is the same loop that Acer mentions. It looks to me like you're just throwing away the first 999 Arrays A. You're doing that 1000 times, and each A contains 3000 random numbers. So you're throwing away close to 3 billion random numbers. And Maple's algorithm for generating those numbers is not trivial.

@Markiyan Hirnyk Without randomize(), you will get the same sequence of random numbers every time. For example, I run your code on my computer...

restart: with(Statistics):
X := RandomVariable(Uniform(0, 10)):
seq(Sample(X, 1 .. 5), j = 1 .. 3):
lprint(%);
Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order)])

...and you can see that I got exactly the same random numbers as you. Sometimes that type of reproducibility is desirable. Certainly it is desirable for debugging. But if you want independent results in separate executions, then you want a different sequence of random numbers, and for that you need to use randomize().

@Markiyan Hirnyk Without randomize(), you will get the same sequence of random numbers every time. For example, I run your code on my computer...

restart: with(Statistics):
X := RandomVariable(Uniform(0, 10)):
seq(Sample(X, 1 .. 5), j = 1 .. 3):
lprint(%);
Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(8.14723686393178959), 2 = HFloat(9.05791937075619202), 3 = HFloat(1.26986816293506055), 4 = HFloat(9.13375856139019326), 5 = HFloat(6.32359246225409510)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(.975404049994095246), 2 = HFloat(2.78498218867048397), 3 = HFloat(5.46881519204983846), 4 = HFloat(9.57506835434297621), 5 = HFloat(9.64888535199276554)}, datatype = float[8], storage = rectangular, order = Fortran_order)]), Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order, attributes = [source_rtable = Array(1 .. 5, {1 = HFloat(1.57613081677548283), 2 = HFloat(9.70592781760615608), 3 = HFloat(9.57166948242945637), 4 = HFloat(4.85375648722841202), 5 = HFloat(8.00280468888800200)}, datatype = float[8], storage = rectangular, order = Fortran_order)])

...and you can see that I got exactly the same random numbers as you. Sometimes that type of reproducibility is desirable. Certainly it is desirable for debugging. But if you want independent results in separate executions, then you want a different sequence of random numbers, and for that you need to use randomize().

Please upload a worksheet containing the code that you showed. In the form that you showed it, it cannot be cut-and-pasted.

@erik10 I'm just confirming that you understand perfectly what I said.

@erik10 I'm just confirming that you understand perfectly what I said.

First 643 644 645 646 647 648 649 Last Page 645 of 709