Doug Meade

 

Doug

---------------------------------------------------------------------
Douglas B. Meade <><
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

MaplePrimes Activity


These are replies submitted by Doug Meade

I do now have a .mbook file, prepared with the prompt assistance of Scott and others at Maplesoft. However, at present MaplePrimes.com does not allow the uploading of a .mbook. Sure, I could give the file a new extension and remind users that they must change the extension back to .mbook to view the file, but that should not be necessary. I hope this limitation can be quickly removed. I will then post the .mbook to MaplePrimes for all to give a first test to the Maple Reader. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Jacques, What version of Maple are you using? In Maple 11.01, and all previous versions of Maple on which I have tried this, I get:
a := sin(k*Pi):
limit( a, k=infinity ) assuming k::integer;
                                   -1 .. 1
If this syntax did work, I would be satisfied - up to a point. If this works, then it would be quite trivial to provide an extension to the current implementation of limit that implements one of the suggested syntaxes(?) in my original post. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Jacques, What version of Maple are you using? In Maple 11.01, and all previous versions of Maple on which I have tried this, I get:
a := sin(k*Pi):
limit( a, k=infinity ) assuming k::integer;
                                   -1 .. 1
If this syntax did work, I would be satisfied - up to a point. If this works, then it would be quite trivial to provide an extension to the current implementation of limit that implements one of the suggested syntaxes(?) in my original post. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
I have raised the issue of function domain in previous correspondence with Maplesoft. In my case, I was talking about sequences. That is, a function whose domain is a (subset of) the integers. As acer points out, plots are not too much of a problem as pointplot can always be used. (In fact, the real complaint here is that all plots are really discrete objects.) I was interested in limits. I want to be able to have a way to compute what I call a discrete limit. I Maple to tell Maple that the variable in a limit is discrete. For example, at present Maple gives:
limit( sin(k*Pi), k=infinity );
               -1 .. 1
No complaints here, but I do want a NATURAL way to have this limit evaluate to 0. Maybe something like one of the following:
limit( sin(k*Pi), k=infinity, _IntergerDomain );
limit( sin(k*Pi), k=infinity ) assuming k::integer;
I have to admit that I was a little surprised to discover that the following does work, in this case:
a := sin(k*Pi);
              a := sin(k Pi)
limit( (a assuming k::integer), k=infinity );
                    0
It would seem to me that this functionality could be made more natural or automatic. I hope the developers will give this some consideration for a future enhancement. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
I have raised the issue of function domain in previous correspondence with Maplesoft. In my case, I was talking about sequences. That is, a function whose domain is a (subset of) the integers. As acer points out, plots are not too much of a problem as pointplot can always be used. (In fact, the real complaint here is that all plots are really discrete objects.) I was interested in limits. I want to be able to have a way to compute what I call a discrete limit. I Maple to tell Maple that the variable in a limit is discrete. For example, at present Maple gives:
limit( sin(k*Pi), k=infinity );
               -1 .. 1
No complaints here, but I do want a NATURAL way to have this limit evaluate to 0. Maybe something like one of the following:
limit( sin(k*Pi), k=infinity, _IntergerDomain );
limit( sin(k*Pi), k=infinity ) assuming k::integer;
I have to admit that I was a little surprised to discover that the following does work, in this case:
a := sin(k*Pi);
              a := sin(k Pi)
limit( (a assuming k::integer), k=infinity );
                    0
It would seem to me that this functionality could be made more natural or automatic. I hope the developers will give this some consideration for a future enhancement. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Court, Sorry. I wish I did know how to do a real-time slider in a maplet. The animation control is not a maplet. My current thinking is that it this could be introduced via an option that might look like 'samplerate'=10. The default samplerate could be 0 (or negative) to indicate that updates are to be done only upon release of the button. The units could be microseconds or some other unit of time. Maybe someone with more knowledge about Java could code this extension. Otherwise, I hope this can be placed on the wish list for Maple 12. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Court, Sorry. I wish I did know how to do a real-time slider in a maplet. The animation control is not a maplet. My current thinking is that it this could be introduced via an option that might look like 'samplerate'=10. The default samplerate could be 0 (or negative) to indicate that updates are to be done only upon release of the button. The units could be microseconds or some other unit of time. Maybe someone with more knowledge about Java could code this extension. Otherwise, I hope this can be placed on the wish list for Maple 12. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Another way to work with your definitions of your Boolean expressions is to use the unapply command. When you create a procedure (function) with the arrow operator (->) the RHS of the operator is not evaluated until the procedure is called. With unapply the argument is evaluated before creating the procedure. Compare:
B1 := x<2 and x>0;
                        x < 2 and 0 < x
F1 := x -> `if`(B1,1,0);
                      F1 := x -> `if`(B1, 1, 0)
F2 := unapply( `if`(B1,1,0), x );
             F2 := x -> `if`(x < 2 and 0 < x, 1, 0)
[F1,F2](1);
                [`if`(x < 2 and 0 < x, 1, 0), 1]
[F1,F2](-1);
                [`if`(x < 2 and 0 < x, 1, 0), 0]
plot( [F1,F2], -1..1, thickness=2, color=[red,blue], legend=["F1","F2"] );
  Warning, unable to evaluate 1 of the 2 functions to numeric values in the
  region; see the plotting command's help page to ensure the calling sequence
  is correct
The important thing to notice here is that the "x" used in the definition of B1 is not the same "x" used in the body of the procedure F1. This is why the if statements in F1 never take on a specific Boolean value. This same example is available for downloading as a worksheet from the URL Download 178_IfUnapplyExample.mw
View file details Hoping this is useful, Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Suppose you want to find the intersection of surfaces f(x,y,z)=L and g(x,y,z)=M. Wouldn't it work to use implicitplot3d to look at the surface defined by (f(x,y,z)-L)^2 + (g(x,y,z)-M)^2 = 0? To answer my own question, yes - in principle. But, Maple does have some troubles because this definition is too precise. You really want to have all of the points that are "really close" to this intersection. I thought I remember there being a tolerance option in implicitplot(3d) but I can't find mention of this in the online help. In lieu of this, I'll do it manually as follows:
with( plots ):

eq1 := x^2+y^2-z^2=1;
                         2    2    2    
                        x  + y  - z  = 1

eq2 := z=0;
                             z = 0

Z := (lhs(eq1)-rhs(eq1))^2 + (lhs(eq2)-rhs(eq2))^2;
                                      2     
                    / 2    2    2    \     2
                    \x  + y  - z  - 1/  + z 

implicitplot3d( Z=0, x=-2..2, y=-2..2, z=-2..2,
                axes=boxed, grid=[45,45,45] ); # empty plot

implicitplot3d( Z=0.01, x=-2..2, y=-2..2, z=-2..2,
                axes=boxed, grid=[45,45,45] ); # decent plot
The grid option is needed to force Maple to evaluate the function at enough points to get a reasonable picture. This is far from optimal, but with some care can be made to work. I hope this is helpful, Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Suppose you want to find the intersection of surfaces f(x,y,z)=L and g(x,y,z)=M. Wouldn't it work to use implicitplot3d to look at the surface defined by (f(x,y,z)-L)^2 + (g(x,y,z)-M)^2 = 0? To answer my own question, yes - in principle. But, Maple does have some troubles because this definition is too precise. You really want to have all of the points that are "really close" to this intersection. I thought I remember there being a tolerance option in implicitplot(3d) but I can't find mention of this in the online help. In lieu of this, I'll do it manually as follows:
with( plots ):

eq1 := x^2+y^2-z^2=1;
                         2    2    2    
                        x  + y  - z  = 1

eq2 := z=0;
                             z = 0

Z := (lhs(eq1)-rhs(eq1))^2 + (lhs(eq2)-rhs(eq2))^2;
                                      2     
                    / 2    2    2    \     2
                    \x  + y  - z  - 1/  + z 

implicitplot3d( Z=0, x=-2..2, y=-2..2, z=-2..2,
                axes=boxed, grid=[45,45,45] ); # empty plot

implicitplot3d( Z=0.01, x=-2..2, y=-2..2, z=-2..2,
                axes=boxed, grid=[45,45,45] ); # decent plot
The grid option is needed to force Maple to evaluate the function at enough points to get a reasonable picture. This is far from optimal, but with some care can be made to work. I hope this is helpful, Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
I believe you will be happier if you use the print command (as in Tim's example). I know it's not pretty to write
print( printf( ... ) );
but that is what I would do in this case. Good luck, Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
This one is even easier to explain - but the explanation is not pleasing. Constant is being used in two different ways. You are interpreting "constant" in the Maple context. The second use is the mathematical interpretation. I think we are all experienced enough to recognize that this type of overloading happens regularly. I don't think it is difficult to understand the way in which these terms are being used in this context. But, maybe this discussion could suggest some improvements in the language used in the documentation. (Hint, hint.) Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Now, to present some balance to my previous posting:
  • Why are variable limits no longer permitted?
  • Does this apply only to implicitplots, or in general to all plot commands?
It is very powerful to be able to plot over non-rectangular regions. I believe this feature was touted in promotional materials for an earlier release of Maple (not too far in the past). The suggestion for a workaround to this is much appreciated. But, if it is so straightforward to implement this with plottools[transform], why not build it into the product? An inquiring mind wants to know, Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
Excuse me for intruding, but this seems pretty clear to me. A constant is a constant, it never changes. Of course, in Maple, a constant is really a constant function, i.e., a function whose output is the same for all possible inputs:
1;
                               1
1(x);
                               1
1(foo);
                               1
1([1,a,d]);
                               1
Constants can be computed based on other information, but cannot depend on the value of other variables in the plot. The phrase "evaluate to constants for all values of x" can be restated as saying the expression is a function that returns a numeric value for all valid inputs. In particular, this means that the values of the function cannot have a parameter; everything must be numeric. I hope this is helpful. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
As an experienced author of maplets for use with MapleNet, I am well aware of this requirement. The Publisher's Guide clearly states, on p. 19 (p. 23 of 55 in the PDF file) that:
When writing a Maplet application for MapleNet, follow these guidelines. • Ensure that the last line in the file is the Maplets:-Display command.
I know that I did not read this to mean that there could be NOTHING after the Display command, but that is what it says and means. I do hope that this can be reworded for subsequent releases. Doug
---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/
First 67 68 69 70 71 72 73 Page 69 of 76