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

In my previous post about the limitations on zip  I should have mentioned seq as a good alternative to zip with more than two lists.

In your case, I might do something like:

hdr := < n | a[n] | b[n] >:
body := < seq( < k | coeff(D2F,R,k) | coeff(DF,R,k) >, k=0..nmax ) >:
< hdr, body >;

This constructs the matrix, body, one row at a time.

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.ed

 

In my previous post about the limitations on zip  I should have mentioned seq as a good alternative to zip with more than two lists.

In your case, I might do something like:

hdr := < n | a[n] | b[n] >:
body := < seq( < k | coeff(D2F,R,k) | coeff(DF,R,k) >, k=0..nmax ) >:
< hdr, body >;

This constructs the matrix, body, one row at a time.

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.ed

 

Your coefficients should not be the problem. One of my thoughts is to revise your problem so that Maple responds with floating point coefficients. To be honest, I did not look at these coefficients long enough to have a feeling for their actual size. Even if they are small, Maple should be able to handle them.

The truth is in the details.

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.ed

Your coefficients should not be the problem. One of my thoughts is to revise your problem so that Maple responds with floating point coefficients. To be honest, I did not look at these coefficients long enough to have a feeling for their actual size. Even if they are small, Maple should be able to handle them.

The truth is in the details.

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.ed

The problem is that the dsolve returns NULL, and then rhs(NULL) raises the error.

rhs(NULL);
Error, invalid input: rhs expects 1 argument, but received 0

So, why does dsolve not find a solution when k=15? That question I have not yet been able to answer.

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.ed

The problem is that the dsolve returns NULL, and then rhs(NULL) raises the error.

rhs(NULL);
Error, invalid input: rhs expects 1 argument, but received 0

So, why does dsolve not find a solution when k=15? That question I have not yet been able to answer.

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.ed

Yes. It's the same problem. Just a new semester, and hoping that a new post might bring some new insights.

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.ed

I nominate these sorting questions for inclusion on the list of Top 10 Maple (Student) Questions.

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.ed

I nominate these sorting questions for inclusion on the list of Top 10 Maple (Student) Questions.

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.ed

The contourplot command is in the plots package. If you have not loaded this package prior to executing the controurplot command, Maple does not know this means anything special.

In jakubi's post he used the "long name": plots:-contourplot which tells Maple to look for contourplot in the plots package. If you don't  like this approach, or if you are going to be using many other commands from the plots package, you should execute the command:

with( plots );

Then you can refer to contourplot by it's "short name": contourplot

If you want to use commands from a package inside a procedure, you can use the (relatively new) use command. For example,

CP := proc()
  local p1, p2;
  uses plots;
  p1 := contourplot3d( ... );
  p2 := plot3d( ... );
  display( [p1,p2] );
end proc;

Lastly, is there a reason you are using contourplot and not contourplot3d? The latter is more efficient, and more flexible. Even if what you really want is a 2D plot, the 3D command is oftentimes faster and easier to use. All you have to do is set the orientation to give the appropriate 2D view. The online help for contourplot3d explains a lot of this as well.

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.ed

The contourplot command is in the plots package. If you have not loaded this package prior to executing the controurplot command, Maple does not know this means anything special.

In jakubi's post he used the "long name": plots:-contourplot which tells Maple to look for contourplot in the plots package. If you don't  like this approach, or if you are going to be using many other commands from the plots package, you should execute the command:

with( plots );

Then you can refer to contourplot by it's "short name": contourplot

If you want to use commands from a package inside a procedure, you can use the (relatively new) use command. For example,

CP := proc()
  local p1, p2;
  uses plots;
  p1 := contourplot3d( ... );
  p2 := plot3d( ... );
  display( [p1,p2] );
end proc;

Lastly, is there a reason you are using contourplot and not contourplot3d? The latter is more efficient, and more flexible. Even if what you really want is a 2D plot, the 3D command is oftentimes faster and easier to use. All you have to do is set the orientation to give the appropriate 2D view. The online help for contourplot3d explains a lot of this as well.

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.ed

This is exactly why add is preferred over sum for problems like this.

I could accept no response from Maple using sum, but not an erroneous answer like this.

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.ed

I had forgotten about forget. Thanks for pointing it out to me.

But, to be truly effective, what I need is a version of forget that allows me to forget everything in any remember table whenever f is redefined. This would require an ability to determine every remember table that contains entries involving f and removing only those entries from the remember table.

I don't have the expertise with remember tables to implement this right now. Is this realistic? Is it something that should be suggested to the developers for a future release?

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.ed

Robert,

Thanks for your addition to this post. I didn't think to check the Classic interface.

Just one quibble. You wrote:

I tried your example with 2D math in Classic, and got a different error message:

Error, (in sin) expecting 1 argument, got 2

because in this case Maple changed the ";" to ")" without asking.

This error message suggests to me that Maple is seeing sin( x, x=0..1 ) which is the sine function with 2 arguments. Nothing about changing a comma to a parenthesis. To me it appears to be a difference in the order in which checks are done.

While I know the parsers have to be different, shouldn't they all be implementing the same syntax. Is it really acceptable to have different output from the different input modes and interfaces?

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.ed

 

This is not quite an accepted proof, but it does fulfill your request "how do I get Maple to show 2^(1/2)/3?". Except, I think the correct value is 2/3^(1/2). My approach is to let Maple make a numerical approximation and then use identify to find the corresponding closed-form expression that has this approximation.

a := 2/sqrt(n+2)-2/sqrt(n+3);
                              2              2      
                         ------------ - ------------
                                (1/2)          (1/2)
                         (n + 2)        (n + 3)     
S := sum( a, n=1..infinity );
                    infinity                             
                     -----                               
                      \                                  
                       )    /     2              2      \
                      /     |------------ - ------------|
                     -----  |       (1/2)          (1/2)|
                     n = 1  \(n + 2)        (n + 3)     /

evalf( S );
                                 1.154700538
identify( % );
                                  2  (1/2)
                                  - 3     
                                  3       

I think identify is a pretty neat command. I've used it several times in other situations like this. I've not shown it to my colleagues, but students think it's pretty handy.

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.ed

 

First 35 36 37 38 39 40 41 Last Page 37 of 76