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

It would be nice if map could do this, but the lesser known zip will work. The general use of zip is to combine elements from two different lists, sets, .... The visual output from zip is useless (a 2x2 matrix whose entries are all NULL) but the appropriate assignments are made.
restart;
A := Matrix([[x,y],[u,v]]);
B := Matrix([[1,2],[3,4]]);
zip( assign, A, B ):
x, y, u, v;
                                 1, 2, 3, 4
---------------------------------------------------------------------
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/
The out-of-the-box defaults for Maple 11 are documents with 2D Math Notation. As I recall, the first time Maple is started, you are given a choice to choose documents or worksheets as the default. (Most new users don't know enough to make an informed decision at this point, and I believe the pre-selected default is document.) The first thing we have every one of our calculus students do in the computer lab is to reset these defaults to open worksheets with Maple notation for input. Here are the instructions for doing this:
  1. go to the Tools menu and select Options ...
  2. click on the Interface tab
  3. set the Default format for new worksheets to Worksheet
  4. click on the Display tab
  5. set the Input display to Maple Notation
  6. at the bottom of the Options window, click Apply Globally
The last step is critical. If you select Apply to session (the default) these settings will be lost the next time you start Maple. But, if you follow these directions once, then you don't have to worry about this again. (If you want a document, you can always open one using File ... New.) Once we get through this, the students have many fewer problems with our labs. 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/
The out-of-the-box defaults for Maple 11 are documents with 2D Math Notation. As I recall, the first time Maple is started, you are given a choice to choose documents or worksheets as the default. (Most new users don't know enough to make an informed decision at this point, and I believe the pre-selected default is document.) The first thing we have every one of our calculus students do in the computer lab is to reset these defaults to open worksheets with Maple notation for input. Here are the instructions for doing this:
  1. go to the Tools menu and select Options ...
  2. click on the Interface tab
  3. set the Default format for new worksheets to Worksheet
  4. click on the Display tab
  5. set the Input display to Maple Notation
  6. at the bottom of the Options window, click Apply Globally
The last step is critical. If you select Apply to session (the default) these settings will be lost the next time you start Maple. But, if you follow these directions once, then you don't have to worry about this again. (If you want a document, you can always open one using File ... New.) Once we get through this, the students have many fewer problems with our labs. 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/
Interested readers might want to revisit a blog post I made a while ago on a related discussion. That discussion produced a simple routine to force conversion to sec and tan. I have since used the same idea to create conversions to other pairs of trig functions. Here's a quick look at how the convert/sectan proc (module) can be used:
> convert(sin(x)/cos(x), sectan);
                                   tan(x)
The fact that this can be easily added only furthers the frustration that it is not provided automatically for all users. 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/
Interested readers might want to revisit a blog post I made a while ago on a related discussion. That discussion produced a simple routine to force conversion to sec and tan. I have since used the same idea to create conversions to other pairs of trig functions. Here's a quick look at how the convert/sectan proc (module) can be used:
> convert(sin(x)/cos(x), sectan);
                                   tan(x)
The fact that this can be easily added only furthers the frustration that it is not provided automatically for all users. 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/
These are all very reasonable points of view. But, let's think about it a little. If you want to have sin(x)/cos(x) replaced by tan(x), would you also want to have sin(x)*cos(x) replaced by cos(x)^2*tan(x)? I doubt it. The basic issue, as I understand it, is that humans have experience and tradition to guide them to the accepted "simplified" form for most expressions. But, these "rules" quickly fail when they are applied in general. While it seems pretty strange to have 1+sin(x)^2 simplify to 2-cos(x)^2, it is this tendency to convert all powers of sin(x) to cos(x) that gives Maple a chance to find further simplifications in truly complicated expressions. (Remember that Maple needs to excel at real-world expressions, not just the standard expressions found in most texts.) Maple is pretty good about applying a specific conversion. Knowing exactly which command to use in every situation takes some experience. The usual suspects include: simplify, combine, and expand. As you get more experience you will start to understand why developers made the decisions they made. (You may not agree with their choices, but ....) 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/
These are all very reasonable points of view. But, let's think about it a little. If you want to have sin(x)/cos(x) replaced by tan(x), would you also want to have sin(x)*cos(x) replaced by cos(x)^2*tan(x)? I doubt it. The basic issue, as I understand it, is that humans have experience and tradition to guide them to the accepted "simplified" form for most expressions. But, these "rules" quickly fail when they are applied in general. While it seems pretty strange to have 1+sin(x)^2 simplify to 2-cos(x)^2, it is this tendency to convert all powers of sin(x) to cos(x) that gives Maple a chance to find further simplifications in truly complicated expressions. (Remember that Maple needs to excel at real-world expressions, not just the standard expressions found in most texts.) Maple is pretty good about applying a specific conversion. Knowing exactly which command to use in every situation takes some experience. The usual suspects include: simplify, combine, and expand. As you get more experience you will start to understand why developers made the decisions they made. (You may not agree with their choices, but ....) 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/
What you are requesting is sometimes referred to as a "soft line break". If I do a text search for "soft break", the first entry shows the help for worksheet,reference,hotwin. In the second group of keyboard bindings the first entry is:
Shift + Enter       Soft New Line
So, enter your lines as you wrote them, but with a Shift+Enter at the end of each line and you will see that all commands are in the same execution group. Everything will be executed as soon as you press the Enter key. The use of Shift+Enter for a soft break is pretty common. I hope 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/
To plot *a* solution, an initial condition is needed. But, not to plot the direction field. The DEplot can be used for both plots. Note that I am using the DE from the original post - it's slightly more interesting.
restart;
with( DEtools );
eq := diff( y(t), t ) = 1-y(t)^2;

DEplot( eq, y(t), t=0..5, y=-3..3, arrows=thin, dirgrid=[50,50] );

iv := [y(0)=2, y(0)=0, y(0)=-2];
DEplot( eq, y(t), t=0..5, y=-3..3, iv, arrows=thin, dirgrid=[50,50] );
You also asked about equilibrium solutions. They are pretty obvious in the above plots. But, they can also be found analytically as follows:
eq0 := eval( eq, y(t)=Y ); # evaluate ODE w/const soln
solve( eq0, {Y} );         # solve for equil soln
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/
To plot *a* solution, an initial condition is needed. But, not to plot the direction field. The DEplot can be used for both plots. Note that I am using the DE from the original post - it's slightly more interesting.
restart;
with( DEtools );
eq := diff( y(t), t ) = 1-y(t)^2;

DEplot( eq, y(t), t=0..5, y=-3..3, arrows=thin, dirgrid=[50,50] );

iv := [y(0)=2, y(0)=0, y(0)=-2];
DEplot( eq, y(t), t=0..5, y=-3..3, iv, arrows=thin, dirgrid=[50,50] );
You also asked about equilibrium solutions. They are pretty obvious in the above plots. But, they can also be found analytically as follows:
eq0 := eval( eq, y(t)=Y ); # evaluate ODE w/const soln
solve( eq0, {Y} );         # solve for equil soln
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/
More information would be most helpful. From your post it almost sounds as though the parameters are always numerical constants. If so, then solve the equation once and then substitute the values of the parameters into the general solution formula. Also, it's very possible to use some of Maple's control structures to create a solution that is much easier to understand. Please give us some more information and let's see what people suggest. 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/
More information would be most helpful. From your post it almost sounds as though the parameters are always numerical constants. If so, then solve the equation once and then substitute the values of the parameters into the general solution formula. Also, it's very possible to use some of Maple's control structures to create a solution that is much easier to understand. Please give us some more information and let's see what people suggest. 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/
The murkiness of the issues is becoming clearer. We need to be distinguish between input and output and, as my last post illustrated, combinations of input and output. The bigger picture is that users should not have to be concerned about any of this. Copy-and-paste should work and the context of the selection should be maintained as much as possible. 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/
The murkiness of the issues is becoming clearer. We need to be distinguish between input and output and, as my last post illustrated, combinations of input and output. The bigger picture is that users should not have to be concerned about any of this. Copy-and-paste should work and the context of the selection should be maintained as much as possible. 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 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/
First 52 53 54 55 56 57 58 Last Page 54 of 76