Carl Love

Carl Love

28025 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

Thank you for your Answer. I was not familiar with the method of extracting the solution procedures. To answer the question that you pose rhetorically in the title of your Answer, there are two reasons:

  1. It just seems more natural to me to work with the plots, because I am well acquainted with the internal structure of plots and rtables, but not at all well acquainted with the internal structure of the modules returned by pdsolve. Certainly this is just a matter of taste.
  2. It hardly matters for this small example, but the plot method seems to use substantially less cputime (about 1/3 the time in this example). I haven't looked into why this is, but my guess is that the plots allow for more processing by evalhf in a "batch mode", i.e., fewer total calls to evalhf with each doing more work.

Robert Lopez wrote:

To get the values of the highest-ordered derivative, ... trick the system into thinking ... that the derivative is actually one of the system's dependent variables.

Could you give an example of this with pdsolve(..., numeric)? I am familiar with how to do this with dsolve(..., numeric), but when I try with pdsolve, I get an error message about the system being "too far from a standard form".

PDE:= {diff(u(x,t),t) = -diff(u(x,t),x), diff(u(x,t),x)= w(x,t)}:
IBC:= {u(x,0)=sin(2*Pi*x),u(0,t)=-sin(2*Pi*t)}:
pds:= pdsolve(PDE, IBC, numeric, time=t, range=0..1);
Error, (in pdsolve/numeric/par_hyp) input system is too far from a 'standard' form (see ?pdsolve,numeric for more detail)

Thank you for your Answer. I was not familiar with the method of extracting the solution procedures. To answer the question that you pose rhetorically in the title of your Answer, there are two reasons:

  1. It just seems more natural to me to work with the plots, because I am well acquainted with the internal structure of plots and rtables, but not at all well acquainted with the internal structure of the modules returned by pdsolve. Certainly this is just a matter of taste.
  2. It hardly matters for this small example, but the plot method seems to use substantially less cputime (about 1/3 the time in this example). I haven't looked into why this is, but my guess is that the plots allow for more processing by evalhf in a "batch mode", i.e., fewer total calls to evalhf with each doing more work.

Robert Lopez wrote:

To get the values of the highest-ordered derivative, ... trick the system into thinking ... that the derivative is actually one of the system's dependent variables.

Could you give an example of this with pdsolve(..., numeric)? I am familiar with how to do this with dsolve(..., numeric), but when I try with pdsolve, I get an error message about the system being "too far from a standard form".

PDE:= {diff(u(x,t),t) = -diff(u(x,t),x), diff(u(x,t),x)= w(x,t)}:
IBC:= {u(x,0)=sin(2*Pi*x),u(0,t)=-sin(2*Pi*t)}:
pds:= pdsolve(PDE, IBC, numeric, time=t, range=0..1);
Error, (in pdsolve/numeric/par_hyp) input system is too far from a 'standard' form (see ?pdsolve,numeric for more detail)

@J4James I can't get it. The obvious thing to try is

pds:-plot([diff(u(x,t), x)], x=0, t= 0..1, numpoints= 50);

But that just gives a constant 0 plot, which is obviously wrong.

@J4James I can't get it. The obvious thing to try is

pds:-plot([diff(u(x,t), x)], x=0, t= 0..1, numpoints= 50);

But that just gives a constant 0 plot, which is obviously wrong.

Do you have a reference on this "relaxation method" that I could look at? Possibly something on the web? I looked at the Wikipedia page "relaxation (iterative method)", but I couldn't relate it to your situation. How is the relaxation factor 1.2 chosen?

Your iteration uses r and z; why is theta not also used? Why is the iteration not done in Cartesian coordinates?

I don't think that it makes sense to sort the points. We used that code when we were dealing with a surface, a cylinder, of points. This time it is just a curve. They are already in a natural order.

You should evalf the initial points.

@kswong89 There are so many problems with this....

First, since you have F:= ... rather than F = ..., your expression is an assignment; it is not an equation. Since it is not an equation, it doesn't make sense to "solve" it. But I think that you mean "evaluate" rather than "solve".

Second, m and n are bound variables (as opposed to free variables), since they are index variables of summations. It doesn't make sense to assign values to them, or even to refer to them in any context more global than the summations, such as the overall expression.

Third, if you set the other variables to 1 that you wanted, two of the sines will be 0 for any m and any n. Thus, you'd be dividing by 0.

Fourth, I cannot expand your .png thumbnail to view it. This may be a limitation of the ability of my software. If it was .jpg, I could expand it. Anyway, please post full-size images.

@kswong89 There are so many problems with this....

First, since you have F:= ... rather than F = ..., your expression is an assignment; it is not an equation. Since it is not an equation, it doesn't make sense to "solve" it. But I think that you mean "evaluate" rather than "solve".

Second, m and n are bound variables (as opposed to free variables), since they are index variables of summations. It doesn't make sense to assign values to them, or even to refer to them in any context more global than the summations, such as the overall expression.

Third, if you set the other variables to 1 that you wanted, two of the sines will be 0 for any m and any n. Thus, you'd be dividing by 0.

Fourth, I cannot expand your .png thumbnail to view it. This may be a limitation of the ability of my software. If it was .jpg, I could expand it. Anyway, please post full-size images.

@Markiyan Hirnyk I see. Thank you.

@Markiyan Hirnyk I see. Thank you.

@Markiyan Hirnyk So isn't that worth a vote up?

@Markiyan Hirnyk So isn't that worth a vote up?

I think that the results of your isolve are difficult to interpret when compared to the corresponding results from msolve:

msolve(2275*s=2503, 1563);
                           {s = 976}

I don't see the significance of the chrem answer. Could you explain that?

I think that the results of your isolve are difficult to interpret when compared to the corresponding results from msolve:

msolve(2275*s=2503, 1563);
                           {s = 976}

I don't see the significance of the chrem answer. Could you explain that?

@Markiyan Hirnyk You must've inadvertently hit backspace while your cursor was in the Code Edit Region. The main procedure in the module needs to be named ModuleApply. In the code in your most recent attempt it appears as ModleApply. The original version of the attached worksheet is fine, but here I have attached a new version with some more comments.

Subcover1.mw

@Markiyan Hirnyk You must've inadvertently hit backspace while your cursor was in the Code Edit Region. The main procedure in the module needs to be named ModuleApply. In the code in your most recent attempt it appears as ModleApply. The original version of the attached worksheet is fine, but here I have attached a new version with some more comments.

Subcover1.mw

First 662 663 664 665 666 667 668 Last Page 664 of 708