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

This is not my experience. From a recent post I had the following list of matrices:
L := [ Matrix([[0,1],[1,0]]), Matrix([[1,1],[1,0]]), Matrix([[0,1],[1,0]]) ];
When the output is selected and pasted into MaplePrimes I see
 
 [Matrix(%id = 171110540), Matrix(%id = 172174720), Matrix(%id = 171422596)]
[Matrix(%id = 171110540), Matrix(%id = 172174720), Matrix(%id = 171422596)] It matters not whether this is tagged as pre or maple. Interestingly, if this selection is pasted into Word, then the matrices are displayed. I am working in a worksheet (Maple 11). I do not see a difference if I use Maple notation or 2D Math input. Would my experience be different if I were using a document? Not appreciably:
> L := [Matrix([[0, 1], [1, 0]]), Matrix([[1, 1], [1, 0]]), Matrix([[0, 1], [1, 0]])];
print(`output redirected...`); # input placeholder
 [Matrix(%id = 153366752), Matrix(%id = 153369700), Matrix(%id = 151482308)]
Going back a step, let me try John's example. Here is what I get if I select the input and output and paste them as a single object:
Matrix(3,3,(i,j)->i*j);
                           Matrix(%id = 162278524)
But, if I select ONLY the matrix output, then I get:
Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 2, (2, 2) = 4, (2, 3) = 6, (3, 1) = 3, (3, 2) = 6, (3, 3) = 9})
Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 2, (2, 2) = 4, (2, 3) = 6, (3, 1) = 3, (3, 2) = 6, (3, 3) = 9}) Still, not the output that John reports. John: How did you get the matrix into your 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/
While I do not have the programming experience upon which to state exactly what is possible today, I do agree with the position Jacques is advocating. There are lots of neat tricks that experts like to throw around to impress others, but they are symptomatic of the problems experienced by new users. Combined, they form a steep learning curve for a software tool. While Maple's learning curve is much easier to navigate today than it was several years ago, it is still too steep. The "clickable math" is a step forward, but even that interface has too many nuances (button click, selections, ...) to be truly intuitive. Just look at the new Maple poster showing how to use some of the new "clickable" resources. How much basic user instruction could fit into the same amount of space. Sure, the font sizes are different, but remember the one-page quick reference guides that were so common only a few years ago. Jacques' point is that in spite of the improvements, much more could -- and should -- be done to make Maple's interface truly USER-friendly. (Not developer friendly or expert-user friendly, but NEW USER-friendly.) Another part of this challenge is to keep the old-timers happy as well. I admit that it might be harder to sell me on new interface paradigms because I am so comfortable with the old ways. 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/
While I do not have the programming experience upon which to state exactly what is possible today, I do agree with the position Jacques is advocating. There are lots of neat tricks that experts like to throw around to impress others, but they are symptomatic of the problems experienced by new users. Combined, they form a steep learning curve for a software tool. While Maple's learning curve is much easier to navigate today than it was several years ago, it is still too steep. The "clickable math" is a step forward, but even that interface has too many nuances (button click, selections, ...) to be truly intuitive. Just look at the new Maple poster showing how to use some of the new "clickable" resources. How much basic user instruction could fit into the same amount of space. Sure, the font sizes are different, but remember the one-page quick reference guides that were so common only a few years ago. Jacques' point is that in spite of the improvements, much more could -- and should -- be done to make Maple's interface truly USER-friendly. (Not developer friendly or expert-user friendly, but NEW USER-friendly.) Another part of this challenge is to keep the old-timers happy as well. I admit that it might be harder to sell me on new interface paradigms because I am so comfortable with the old ways. 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/
Cut-and-paste can be a very effective debugging technique, particularly when the destination is different from the source and the selection has to be converted to a new format. Two common examples are copying a selection from 2D Maple input and pasting it in an input that uses Maple notation and copying Maple input/output/graphics to a different application (e.g., MaplePrimes or Word or ...). Some of these translations can be enlightening. Some are downright frustrating (try to copy a Matrix from a worksheet to MaplePrimes). It is precisely this issue with conversion of output that leads me to omit almost all output from my MaplePrimes posts. I have much more success copying output from Maple to Word, for example. Additional improvements in this area would be greatly appreciated. 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/
Cut-and-paste can be a very effective debugging technique, particularly when the destination is different from the source and the selection has to be converted to a new format. Two common examples are copying a selection from 2D Maple input and pasting it in an input that uses Maple notation and copying Maple input/output/graphics to a different application (e.g., MaplePrimes or Word or ...). Some of these translations can be enlightening. Some are downright frustrating (try to copy a Matrix from a worksheet to MaplePrimes). It is precisely this issue with conversion of output that leads me to omit almost all output from my MaplePrimes posts. I have much more success copying output from Maple to Word, for example. Additional improvements in this area would be greatly appreciated. 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 should have also included this in my response: "Another debugging skill I have learned is to ignore the error message. Instead, go back and look at the user input looking for misuses of the syntax in ways that look reasonable." One of my messages to students is that the computer does exactly what you tell it to do. It also does only what you tell it to do. You cannot tell the computer to "solve it" when you really want to find the zeros of the derivative of a function. So, I have learned to carefully read user-entered commands looking for things that may look OK but really have no meaning. Quotes are often misused. Brackets (, [, { are also commonly misused. Not realizing that Maple is case-sensitive is also common. This list would not be complete without mentioning implied multiplication. That is probably the first thing I look for. 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 should have also included this in my response: "Another debugging skill I have learned is to ignore the error message. Instead, go back and look at the user input looking for misuses of the syntax in ways that look reasonable." One of my messages to students is that the computer does exactly what you tell it to do. It also does only what you tell it to do. You cannot tell the computer to "solve it" when you really want to find the zeros of the derivative of a function. So, I have learned to carefully read user-entered commands looking for things that may look OK but really have no meaning. Quotes are often misused. Brackets (, [, { are also commonly misused. Not realizing that Maple is case-sensitive is also common. This list would not be complete without mentioning implied multiplication. That is probably the first thing I look for. 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/
Jason and Mario: Job well done! Is there any chance for an English translation of Mario's worksheet? 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/
Here is a literal implementation of the process you described. I created sample lists L and P. Note that it is possible to index the loop on the elements of a set or list directly. We do have to be careful about using the name D (differentiation operator, by default).
with( LinearAlgebra[Modular] ):
L := [ Matrix([[0,1],[1,0]]), Matrix([[1,1],[1,0]]), Matrix([[0,1],[1,0]]) ]:

P := [ Matrix([[1,1],[1,0]]), Matrix([[1,0],[0,0]]) ]:

K := Array( 1..nops(L)*nops(P) ):

i := 0;
for A in L do
  for DD in P do
    i := i+1;
    K[i] := Mod(2, DD^%T . A . DD, integer);
  end do;
end do;

i;
seq( K[j], j=1..i );
As others have already posted, there are many other ways to achieve the same result. Depending on the number of elements in P and L, and the exact way in which you will be using K, one approach might be faster or more efficient. The more you can tell us about your exact needs, the better we can provide relevant responses to your question. I hope this gives you something you can work with. 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/
Here is a literal implementation of the process you described. I created sample lists L and P. Note that it is possible to index the loop on the elements of a set or list directly. We do have to be careful about using the name D (differentiation operator, by default).
with( LinearAlgebra[Modular] ):
L := [ Matrix([[0,1],[1,0]]), Matrix([[1,1],[1,0]]), Matrix([[0,1],[1,0]]) ]:

P := [ Matrix([[1,1],[1,0]]), Matrix([[1,0],[0,0]]) ]:

K := Array( 1..nops(L)*nops(P) ):

i := 0;
for A in L do
  for DD in P do
    i := i+1;
    K[i] := Mod(2, DD^%T . A . DD, integer);
  end do;
end do;

i;
seq( K[j], j=1..i );
As others have already posted, there are many other ways to achieve the same result. Depending on the number of elements in P and L, and the exact way in which you will be using K, one approach might be faster or more efficient. The more you can tell us about your exact needs, the better we can provide relevant responses to your question. I hope this gives you something you can work with. 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/
Does this help?
p1 := plot( [[0,1/2],[1,1]], style=line, color=blue ):
p2 := plot( [[1,0],[0,1]], style=line, color=red ):
plots[display]( [p1,p2] );
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/
Does this help?
p1 := plot( [[0,1/2],[1,1]], style=line, color=blue ):
p2 := plot( [[1,0],[0,1]], style=line, color=red ):
plots[display]( [p1,p2] );
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/
Here is the same solution using the builtin coordinate support in plot3d:
a := 1;
S := plot3d( 2*a, theta=0..2*Pi, phi=Pi/6..5*Pi/6, coords=spherical );
C := plot3d( a, theta=0..2*Pi, z=-sqrt(3)*a..sqrt(3)*a, coords=cylindrical );
plots[display]( [S,C], scaling=constrained );
Note that my usage of theta and phi are different from those used in the previous post. In my experience, it is much more common to use theta for the angle with the postive x-axis and phi for the angle with the positive z-axis. 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/
Here is the same solution using the builtin coordinate support in plot3d:
a := 1;
S := plot3d( 2*a, theta=0..2*Pi, phi=Pi/6..5*Pi/6, coords=spherical );
C := plot3d( a, theta=0..2*Pi, z=-sqrt(3)*a..sqrt(3)*a, coords=cylindrical );
plots[display]( [S,C], scaling=constrained );
Note that my usage of theta and phi are different from those used in the previous post. In my experience, it is much more common to use theta for the angle with the postive x-axis and phi for the angle with the positive z-axis. 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/
To have Maple setup but not evaluate the integrals, you can use the intert version of int and limit: Int and Limit, respectively.
f := t;
                                      t
F := Int( f*exp(-s*t), t=a..infinity );
                           /infinity               
                          |                        
                          |          t exp(-s t) dt
                          |                        
                         /a                        
Limit( F, a=0, right );
                            /  /infinity               \
                            | |                        |
                      lim   | |          t exp(-s t) dt|
                    a -> 0+ | |                        |
                            \/a                        /
The eval command can be used to evaluate an inert expression. If you are not interested in the evaluation, then you might be able to use the inert integral to create something that looks more like what you are requesting. For example:
Int( f*exp(-s*t), t=0^`+`..infinity );
                           /infinity               
                          |                        
                          |          t exp(-s t) dt
                          |                        
                         / +                       
                          0                        
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 53 54 55 56 57 58 59 Last Page 55 of 76