MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • After making a search for applications in the applications center, they are ordered in some crazy unknown way. 

    They do not appear to be ordered alphabetically by author, nor by title and also they have no date published attached to the searched list. 

    Searching for all titles by product Maple 16, we find that TEST APPLICATION created July 31 is actually listed behind Robert Lopez's Classroom Tips and Techniques: Slider-Control of Parameters in Numeric...

    MapleSim now is in direct competition with Mathematica's System modeller.

    I just found that out now, it could have been out for a while but they look similar.  Mathematica is already comparing it with MapleSim and essentially indicating that their modeller is superior.

    Let's hear from the Maple crowd.  Is System Modeller better than MapleSim?

    Let's see how we can display patterns, or even images, on 3D plot surfaces. Here's a simple example.

    The underlying mechanism is the COLOR() component of a POLYGONS(), GRID(), or MESH() piece of a PLOT3D() data structure. (See here, here, and here for some older posts which relate to that.)

    The data stored in the MESH() of a 3D plot structure can be a list-of-lists or, more efficient, an Array. The dimensions of that Array are m-by-n-by-3 where m and n are usually the size of the grid of points in the x-y plane (or of points in the two independent parameter spaces). In modern Maple quite a few kinds of 3D plots will produce a GRID() or a MESH() which represent the m-by-n independent data points that can be controlled with the usual grid=[m,n] option.

    The plot,color help-page describes how colors may specified (for each x-y point pair to be plotted) using a procedure f(x,y). And that's fine for explicit plots, though there are some subtleties there. What is not documented on that help-page is the possibility of efficiently using an m-by-n-by-3 or an m*n-by-3 datatype=float[8], order=C_order Array of RGB values or am m*n float[8] Vector of hue values to specify the color data. And that's what I've been learning about, by experiment.

    A (three-layer, RGB or HSV) color image used by the ImageTools package is also an m-by-n-by-3 Array. And all these Arrays under discussion have m*n*3 entries, and with either some or no manipulation they can be interchanged. I wrote earlier about converting ImageTools image structures to and from 2D density-plots. But there is also an easy way to get a 3D density-plot from an ImageTools image with a single command. That command is ImageTools:-Preview, and it even has a useful options to rescale. The rescaling is often necessary so that the dimensions of the COLOR() Array in the result match the dimensions of the grid in the MESH() Array.

    For the first example, producing the banded torus above, we can get the color data directly from a densityplot, without reshaping/manipulating the color Array or using any ImageTools routines. The color data is stored in a m*n Vector of hue values.

    But first a quick note: Some plots/plottools commands produce a MESH() with the data in a list-of-lists-of-lists, or a POLYGONS() call on a sequence of listlists (eg. `torus` in Maple 14). For convenience conversion of the data to a 3-dimensional Array may be done. It's handy to use `op` to see the contents of the PLOT3D() structure, but a possible catastrophe if a huge listlist gets printed in the Standard GUI.

    restart:
    with(ImageTools):with(plots):with(plottools):
    N:=128:
    
    d:=densityplot((x,y)->frem((x-2*y),1/2),0..1,0..1,
                          colorstyle=HUE,style=patchnogrid,grid=[N,N]):
    #display(d);
    
    c:=indets(d,specfunc(anything,COLOR))[1];
    
                             /     [ 1 .. 16384 Vector[column] ]\
                             |     [ Data Type: float[8]       ]|
                   c := COLOR|HUE, [ Storage: rectangular      ]|
                             \     [ Order: C_order            ]/
    
    T:=display(torus([0,0,0],1,2,grid=[N,N]),
               style=surface,scaling=constrained,axes=none,
               glossiness=0.7,lightmodel=LIGHT3):
    #op(T); # Only view the operands in full with Maple 16!
    
    # The following commands both produce the banded torus.
    
    #op(0,T)(MESH(op([1,1..-1],T),c),op([2..-1],T)); # alternate way, M16 only
    
    subsop([1,1]=[op([1,1],T),c][],T);
    

    Most of the examples in this post use the command `op` or `indets` extract or replace the various parts of of the strcutures. Perhaps in future there could be an easy mechanism to pass the COLOR() Array directly to the plotting commands, using their `color` optional parameter.

    In the next example we'll use an image file that is bundled with Maple as example data, and we'll use it to cover a sphere. We won't downsize the image, so that it looks sharp and clear (but note that this may make your Standard GUI session act a bit sluggish). Because we're not scaling down the image we must specify a grid=[m,n] size in the plotting command that matches the dimensions of the image. We'll use ImageTools:-Preview as a convenient mechanism to produce both the color Array as well as a 3D densityplot so that we can view the original image. Note that the data portion of the sphere plot structure is an m-by-n-by-3 Array in a MESH() which matches the dimensions of the m-by-n-by-3 Array in the COLOR() portion of the result from ImageTools:-Preview.

    restart:
    with(ImageTools):with(plots):with(plottools):
    im:=Read(cat(kernelopts(mapledir),"/data/images/tree.jpg")):
    
    p:=Preview(im):
    
    op(1,p);
    
                     /                    [ 235 x 354 2-D  Array ]  
                     |                    [ Data Type: float[8]  ]  
                 GRID|0 .. 266, 0 .. 400, [ Storage: rectangular ], 
                     \                    [ Order: C_order       ]  
    
                        /     [ 235 x 354 x 3 3-D  Array ]\\
                        |     [ Data Type: float[8]      ]||
                   COLOR|RGB, [ Storage: rectangular     ]||
                        \     [ Order: C_order           ]//
    
    q:=plot3d(1, x=0..2*Pi, y=0..Pi, coords=spherical, style=surface,
              grid=[235,354]):
    
    display(PLOT3D(MESH(op([1,1],q), op([1,4..-1],p)), op(2..-1,q)),
               orientation=[-120,30,160]);
    

    Many years ago, I played Scrabble competitively. One of the first things a beginner tournament player should do is learn the two-letter word list. Recently, I created a worksheet that tests your knowledge of all the valid two-letter words accepted in official tournament play in North America. The worksheet makes extensive use of the StringTools package which has terrific tools for manipulating words.

    The worksheet link is below if you'd like to try it out, and I'll...

    Here are 30 all-time men's best 100m  (see http://en.wikipedia.org/wiki/100_metres
     and  http://www.alltime-athletics.com/m_100ok.htm )
            1      9.58       +0.9    Usain Bolt          16.08.2009

    There is a flaw (bug) in the DEplot routine.  If you load the plottools package before using DEplot with the arrows=line option, the DEplot routine tries to use the line definition from the plottools package.  A worksheet illustrating this problem is below.

    I would like to pay attention to http://www.scientificcomputing.com/atlas-032408.aspx . It seems to be a powerful tool to research, to teach, and to learn.

    On Monday, August 6 at 1:31 a.m. EDT, NASA will attempt the landing of a new planetary rover, named Curiosity, on the surface of Mars.  The Mars Science Laboratory project is managed by the NASA Jet Propulsion Laboratory (JPL) in Pasadena, California, a world-renowned center for robotic space exploration and advanced science and engineering.  JPL recently began a widespread adoption of Maplesoft technology, and Maplesoft’s products are expected to help JPL save...

    With the addition of ten new Clickable-Calculus examples to the Teaching Concepts with Maple section of the Maplesoft website, we've now posted 63 of the 154 solved problems in my data-base of syntax-free calculations. Once again, these examples and associated videos illustrate point-and-click computations, but more important, they embody the

    Apart from the online description of this new Maple 16 feature here, there is also the help-page for subexpressionmenu.

    I don't know of a complete listing of its current functionality, but the key thing is that it acts in context. By that I mean that the choice of displayed actions depends on the kind of subexpression that one has selected with the mouse cursor.

    Apart from arithmetic operations, rearrangements and some normalizations of equations, and plot previews, one of the more interesting pieces of functionality is the various trigonometric substitutions. Some of the formulaic trig substitutions provide functionality that has otherwise been previously (I think) needed in Maple.

    In Maple 16 it is now much easier to do some trigonometric identity solving, step by step.

    Here is an example executed in a worksheet. (This was produced by merely selecting subexpressions of the output at each step, and waiting briefly for the new Smart Popup menus to appear automatically. I did not right-click and use the traditional context-sensitive menus. I did not have to type in any of the red input lines below: the GUI inserts them as a convenience, for reproduction. This is not a screen-grab movie, however, and doesn't visbily show my mouse cursor selections. See the 2D Math version further below for an alternate look and feel.)

    expr:=sin(3*a)=3*sin(a)-4*sin(a)^3:

    expr;

    sin(3*a) = 3*sin(a)-4*sin(a)^3

    # full angle reduction identity: sin(3*a)=-sin(a)^3+3*cos(a)^2*sin(a)
    -sin(a)^3+3*cos(a)^2*sin(a) = 3*sin(a)-4*sin(a)^3;

    -sin(a)^3+3*cos(a)^2*sin(a) = 3*sin(a)-4*sin(a)^3

    # subtract -sin(a)^3 from both sides
    (-sin(a)^3+3*cos(a)^2*sin(a) = 3*sin(a)-4*sin(a)^3) -~ (-sin(a)^3);

    3*cos(a)^2*sin(a) = 3*sin(a)-3*sin(a)^3

    # divide both sides by 3
    (3*cos(a)^2*sin(a) = 3*sin(a)-3*sin(a)^3) /~ (3);

    cos(a)^2*sin(a) = sin(a)-sin(a)^3

    # divide both sides by sin(a)
    (cos(a)^2*sin(a) = sin(a)-sin(a)^3) /~ (sin(a));

    cos(a)^2 = (sin(a)-sin(a)^3)/sin(a)

    # normal 1/sin(a)*(sin(a)-sin(a)^3)
    cos(a)^2 = normal(1/sin(a)*(sin(a)-sin(a)^3));

    cos(a)^2 = 1-sin(a)^2

    # Pythagoras identity: cos(a)^2=1-sin(a)^2
    1-sin(a)^2 = 1-sin(a)^2;

    1-sin(a)^2 = 1-sin(a)^2

     

    The very first step above could also be done as a pair of simpler sin(x+y) reductions involving sin(2*a+a) and sin(a+a), depending on what one allows onself to use. There's room for improvement to this whole approach, but it looks like progress.

    Download trigident1.mw

    In a Document, rather than using 1D Maple notation in a Worksheet as above, the actions get documented in the more usual way, similar to context-menus, with annotated arrows between lines.

    expr := sin(3*a) = 3*sin(a)-4*sin(a)^3:

    expr

    sin(3*a) = 3*sin(a)-4*sin(a)^3

    (->)

    2*cos(a)*sin(2*a)-sin(a) = 3*sin(a)-4*sin(a)^3

    (->)

    4*cos(a)^2*sin(a)-sin(a) = 3*sin(a)-4*sin(a)^3

    (->)

    4*cos(a)^2*sin(a) = 4*sin(a)-4*sin(a)^3

    (->)

    cos(a)^2*sin(a) = sin(a)-sin(a)^3

    (->)

    cos(a)^2 = (sin(a)-sin(a)^3)/sin(a)

    (->)

    cos(a)^2 = 1-sin(a)^2

    (->)

    1-sin(a)^2 = 1-sin(a)^2

    (->)

    1 = 1

    ``

    Download trigident2.mw

     

    I am not quite sure what is the best way to try and get some of the trig handling in a more programmatic way, ie. by using the "names" of the various transformational formulas. But some experts here may discover such by examination of the code. Ie,

    eval(SubexpressionMenu);
    
    showstat(SubexpressionMenu::TrigHandler);
    

    The above can leads to noticing the following (undocumented) difference, for example,

    > trigsubs(sin(2*a));
                  
                                     1       2 tan(a)
    [-sin(-2 a), 2 sin(a) cos(a), --------, -----------,
                                  csc(2 a)            2
                                            1 + tan(a)
    
        -1/2 I (exp(2 I a) - exp(-2 I a)), 2 sin(a) cos(a), 2 sin(a) cos(a)]
    
    > trigsubs(sin(2*a),annotate=true);
    
    ["odd function" = -sin(-2 a), "double angle" = 2 sin(a) cos(a),
    
                                   1                       2 tan(a)
        "reciprocal function" = --------, "Weierstrass" = -----------,
                                csc(2 a)                            2
                                                          1 + tan(a)
    
        "Euler" = -1/2 I (exp(2 I a) - exp(-2 I a)),
    
        "angle reduction" = 2 sin(a) cos(a),
    
        "full angle reduction" = 2 sin(a) cos(a)]
    

    And that could lead one to try constructions such as,

    > map(rhs,indets(trigsubs(sin(a),annotate=true),
    >                identical("double angle")=anything));
    
                                 {2 sin(a/2) cos(a/2)}
    

    Since the `annotate=true` option for `trigsubs` is not documented in Maple 16 there is more potential here for useful functionality.

    At first I wanted to post this message as a response to a question

    http://www.mapleprimes.com/questions/136153-AnimateDisplay 

    But for some reason the message is not loaded.

    Look at the example of animation of astroid. First you need to create animation frames as separate graphical structure (in my example - it is E[k] ). And only then by  plots [display]

    It appears the wikipedia entry for Maple (software) is deeply in need of an overhaul to reflect new graphic modifications and for better eye candy. 

    Not that it really matters but the graphics there are rather primitive and outdated. 

    When using "plotsetup(png,...)" the third rotational angle is ignored.  Attached are a worksheet and the corresponding three plots that demonstrate this bug.

    The explosion of cloud this - cloud that, is rather obvious now.

     

    SO, I decided to check-out the cloud feature to my Maple? One problem, I cannot see - what is in it?

    • Yes, I understand, you use the cloud palette in Maple.
    • It shows the group, who the document / notebook is from, what it's title is? And such.
    • _
    • BUT, is there a web page - listing? hidden somewhere, on MaplePrimes or someplace on Maplesoft's service? (

    Some Maplesoft users have been receiving emails that indicate a new patch for Maple software is available. Recipients of this message receive an attachment called Maple_Patch.zip which they are asked to extract using the password MapleSecuirityUpdate1707. Please be advised that this patch did not originate from Maplesoft and should not be opened under any circumstances. Maplesoft is currently investigating further. Please contact

    First 108 109 110 111 112 113 114 Last Page 110 of 308