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

The maximum infolevel is 5, at least for library routines (including int).

If you are like me, you know that setting printlevel to large number is often productive, but infolevel is supposed to max out at 5 (see ?infolevel).

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 maximum infolevel is 5, at least for library routines (including int).

If you are like me, you know that setting printlevel to large number is often productive, but infolevel is supposed to max out at 5 (see ?infolevel).

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

IntegrationTools:-Parts does not make any choices. The user has to make the choice, and Maple just carries out the details. (What do you expect Maple to do if you supply a bad choice for "u"? For the example in the previous post, try Parts( V, cos(x) );)

I agree that userinfo and infolevel are the desired way to get this information. For example:

restart;
infolevel[int]:=5;
                                      5
V := Int( exp(x)*sin(x), x );
                              /                 
                             |                  
                             |  exp(x) sin(x) dx
                             |                  
                            /                   
value( V );
int/indef1: first-stage indefinite integration
int/indef2: second-stage indefinite integration
int/trigexp: case of integrand containing exp and trigs
                       1                 1              
                     - - exp(x) cos(x) + - exp(x) sin(x)
                       2                 2              

Unfortunately, Maple does not evaluate integrals using the same methods that most of us use. So, it's difficult to ask Maple to tell us how a particular integral should be evaluated (by humans).

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

 

IntegrationTools:-Parts does not make any choices. The user has to make the choice, and Maple just carries out the details. (What do you expect Maple to do if you supply a bad choice for "u"? For the example in the previous post, try Parts( V, cos(x) );)

I agree that userinfo and infolevel are the desired way to get this information. For example:

restart;
infolevel[int]:=5;
                                      5
V := Int( exp(x)*sin(x), x );
                              /                 
                             |                  
                             |  exp(x) sin(x) dx
                             |                  
                            /                   
value( V );
int/indef1: first-stage indefinite integration
int/indef2: second-stage indefinite integration
int/trigexp: case of integrand containing exp and trigs
                       1                 1              
                     - - exp(x) cos(x) + - exp(x) sin(x)
                       2                 2              

Unfortunately, Maple does not evaluate integrals using the same methods that most of us use. So, it's difficult to ask Maple to tell us how a particular integral should be evaluated (by humans).

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

 

Acer,

Agreed. Each of these is interesting in its own way. Let's see what the original poster supplies in the way of additional information.

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

Acer,

Agreed. Each of these is interesting in its own way. Let's see what the original poster supplies in the way of additional information.

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

Rarvikanth,

 This is your plot, right?

Note the scale on the horizontal axis. It's pretty difficult to see much detail of a function on such a long time scale. Remember that Maple is selecting points to evaluate your function. Your grid looks to be 40x40, which means the physical dimensions of each box are [ 1.25x10^6, 10 ]

  1. In order for me to offer a real explanation of it, I need some more information from you. How did you create it? From the "Live" in the upper right corner, I'm going to guess that it was created using a smartplot or PlotBuilder.
    (Please provide either the explicit commands, or your worksheet.)
  2. What version of Maple are you using? With which interface?
    With Maple 12, Standard, I can create a plot that is similar to yours with the command:
        plot3d( 0, x=0..5e8, y=0..400, color=red, axes=boxed,
                      style=wireframe, orientation=[-90,0] );

 With a little more information from you, I'm sure we can explain what Maple is doing.

The next question is what are you hoping to see. Again, this requires some more information from you.

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 sounds like a job for hree of my favorite time-saving Maple commands: select, remove, or selectremove. One of the benefits of these commands is that they do not assume the original data is sorted.

Here's an example of how they can be used in a problem like yours.

First generate some data

with(RandomTools):
Sall := Generate( list([integer(range=-10..10),integer(range=-10..10),integer(range=-10..10)],10) ); 
[[-3, 3, 3], [-2, 6, -9], [-2, 10, -8], [-9, -6, -8], [-2, -6, 3], [9, 5, 8], 

  [-8, -2, 2], [-8, -3, -4], [-2, -1, 6], [-6, -10, -10]]

Then, separate the list into those elements whose second element is less than 5 or greater than or equal to 5

L,R := selectremove( s->s[2]<5, Sall ):
L;
     [[-3, 3, 3], [-9, -6, -8], [-2, -6, 3], [-8, -2, 2], [-8, -3, -4], 

       [-2, -1, 6], [-6, -10, -10]]
R;
                   [[-2, 6, -9], [-2, 10, -8], [9, 5, 8]]

The key to using select is coming up with the correct test for deciding if each element is selected or removed. In many cases this can be a builtin Maple command, such as isprime or has. For example, to select the real roots of a solution, I do the following:

soln := solve( (x^2-1)^3=1, x );
                                         (1/2)                    (1/2)  
      (1/2)   (1/2)    1 /         (1/2)\       1 /         (1/2)\       
    -2     , 2     , - - \2 + 2 I 3     /     , - \2 + 2 I 3     /     , 
                       2                        2                        

                          (1/2)                    (1/2)
        1 /         (1/2)\       1 /         (1/2)\     
      - - \2 - 2 I 3     /     , - \2 - 2 I 3     /     
        2                        2                      
solnR := remove( has, [soln], I );
                              [  (1/2)   (1/2)]
                              [-2     , 2     ]

I hope this helps with your problem,

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 support both sides here. It would be nice to have a rating feature, but on sites that have them I often leave them blank.

BUT, when I do find something that is clearly helpful - or not - I am inclined to vote. And, this might not be so bad.

I hope Maplesoft (i.e., Will) will look into this and determine the best way to move forward with this proposal.

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 "Partitions: 10" and "Area: ..." are created with textplot. These, and the title, can be omitted with either of the following:

eval(ApproximateInt(x^2, x=0..1, output=plot, title=""),[LEGEND=NULL,TEXT=NULL]);
eval(ApproximateInt(x^2, x=0..1, output=plot),[LEGEND=NULL,TEXT=NULL,TITLE=NULL]);

It would be nice if the legend could be removed in the same manner as the title, by saying legend="", or something similar, directly in the ApproximateInt command. But, these arguments are passed to plots[display], and the legend= option is not permitted in a display command. This has been an annoyance of mine since legends were introduced a few releases ago.

I hope this helps, and maybe those at Maplesoft can find a way to make improvements in this area. It would be much 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.ed

 

The "Partitions: 10" and "Area: ..." are created with textplot. These, and the title, can be omitted with either of the following:

eval(ApproximateInt(x^2, x=0..1, output=plot, title=""),[LEGEND=NULL,TEXT=NULL]);
eval(ApproximateInt(x^2, x=0..1, output=plot),[LEGEND=NULL,TEXT=NULL,TITLE=NULL]);

It would be nice if the legend could be removed in the same manner as the title, by saying legend="", or something similar, directly in the ApproximateInt command. But, these arguments are passed to plots[display], and the legend= option is not permitted in a display command. This has been an annoyance of mine since legends were introduced a few releases ago.

I hope this helps, and maybe those at Maplesoft can find a way to make improvements in this area. It would be much 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.ed

 

You may not want to load RealDomain at the beginning of your worksheet.

There are significant parts of Maple that depend on being able to work in the complex domain. I prefer to be more surgical in my use of RealDomain. As illustrated in the earlier response to your post, the

use RealDomain in ... end use

style is my preferred usage.

The use statement is relatively new to Maple and many users have yet to discover it or to adapt their usage to include it. I hope questions like yours can help to spread the word.

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

You may not want to load RealDomain at the beginning of your worksheet.

There are significant parts of Maple that depend on being able to work in the complex domain. I prefer to be more surgical in my use of RealDomain. As illustrated in the earlier response to your post, the

use RealDomain in ... end use

style is my preferred usage.

The use statement is relatively new to Maple and many users have yet to discover it or to adapt their usage to include it. I hope questions like yours can help to spread the word.

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

It appears to me that you have a differential equation of order 1. I'm guessing that your original equation involves the differentials "dx" (diff(x)) and "dy" (diff(y(x)). Maple does not work with differentials; divide by dx and the equation can be written as:

ode := (x^(1/3)*y(x)^(2/3)+x)+(x^(2/3)*y(x)^(1/3)+y(x))*diff(y(x),x)=0;
        (1/3)     (2/3)       / (2/3)     (1/3)       \ / d      \    
       x      y(x)      + x + \x      y(x)      + y(x)/ |--- y(x)| = 0
                                                        \ dx     /    

Note that you have to write y(x)^(1/3), not (y^(1/3)(x)).

Now, what do you want to do with this equation? Do you have an initial condition?

The equation is homogeneous. This might allow you to simplify it a little.

Why do you refer to the equation as having "order 2"?

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

It appears to me that you have a differential equation of order 1. I'm guessing that your original equation involves the differentials "dx" (diff(x)) and "dy" (diff(y(x)). Maple does not work with differentials; divide by dx and the equation can be written as:

ode := (x^(1/3)*y(x)^(2/3)+x)+(x^(2/3)*y(x)^(1/3)+y(x))*diff(y(x),x)=0;
        (1/3)     (2/3)       / (2/3)     (1/3)       \ / d      \    
       x      y(x)      + x + \x      y(x)      + y(x)/ |--- y(x)| = 0
                                                        \ dx     /    

Note that you have to write y(x)^(1/3), not (y^(1/3)(x)).

Now, what do you want to do with this equation? Do you have an initial condition?

The equation is homogeneous. This might allow you to simplify it a little.

Why do you refer to the equation as having "order 2"?

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 39 40 41 42 43 44 45 Last Page 41 of 76