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
  • The question of colorbars for plots comes up now and then.

    One particular theme involves creating an associated 2D plot as the colorbar, using the data within the given 3D plot. But the issue arises of how to easily display the pair together. I'll mention that Maple 2015.1 (the point-release update) provides quite a simple way to accomplish the display of a 3D plot and an associated 2D colorbar side-by-side.

    I'm just going to use the example of the latest Question on this topic. There are two parts to here. The first part involves creating a suitable colorbar as a 2D plot, based on the data in the given 3D plot. The second part involves displaying both together.

    Here's the 3D plot used for motivating example, for which in this initial experiment I'll apply shading by using the z-value for hue shading. There are a few ways to do that, and a more complete treatment of the first part below would be to detect the shading scheme and compute the colorbar appropriately.

    Some of the code below requires update release Maple 2015.1 in order to work. The colors look much better in the actual Maple Standard GUI than they do in this mapleprimes post (rendered by MapleNet).

    f := 1.7+1.3*r^2-7.9*r^4+16*r^6:
    
    P := plot3d([r, theta, f],
                r=0..1, theta=0..2*Pi, coords=cylindrical,
                color=[f,1,1,colortype=HSV]):
    
    P;

     

    Now for the first part. I'll construct two variants, one for a vertical colorbar and one for a horizontal colorbar.

    I'll use the minimal and maximal z-values in the data of 3D plot P. This is one of several aspects that needs to be handled according to what's actually inside the 3D plot's data structure.

    zmin,zmax := [min,max](op([1,1],P)[..,..,3])[]:
    
    verthuebar := plots:-densityplot(z, dummy=0..1, z=zmin..zmax, grid=[2,49],
                                     size=[90,260], colorstyle=HUE,
                                     style=surface, axes=frame, labels=[``,``],
                                     axis[1]=[tickmarks=[]]):
    
    horizhuebar := plots:-densityplot(z, z=zmin..zmax, dummy=0..1, grid=[49,2],
                                      size=[300,90], colorstyle=HUE,
                                      style=surface, axes=frame, labels=[``,``],
                                      axis[2]=[tickmarks=[]]):
    

    Now we can approach the second part, to display the 3D plot and its colorbar together.

    An idea which is quite old is to use a GUI Table for this. Before Maple 2015 that could be done by calling plots:-display on an Array containing the plots. But that involves manual interation to fix it up to look nice: the Table occupies the full width of the worksheet's window and must be resized with the mouse cursor, the relative widths of the columns are not right and must be manually adjusted, the Table borders are all visible and (if unwanted) must be hidden using context-menu changes on the Table, etc. And also the rendering of 2D plots in the display of the generated _PLOTARRAY doesn't respect the size option if applied when creating 2D plots.

    I initially thought that I'd have to use several of the commands for programmatic content generation (new in Maple 2015) to build the GUI Table. But in the point-release Maple 2015.1 the size option on 2D plots is respected when using the DocumentTools:-Tabulate command (also new to Maple 2015). So the insertion and display is now possible with that single command.

    DocumentTools:-Tabulate([P,verthuebar],
                            exterior=none, interior=none,
                            weights=[100,25], widthmode=pixels, width=420);

     

     

     

    DocumentTools:-Tabulate([[P],[horizhuebar]],
                            exterior=none, interior=none);
    

     

     

     

    We may also with to restrict the view, vertically, and have the colorbar match the shades that are displayed.

    DocumentTools:-Tabulate([plots:-display(P,view=2..5),
                             plots:-display(verthuebar,view=2..5)],
                            exterior=none, interior=none,
                            weights=[100,25], widthmode=pixels, width=420);
    

     

     

     

    DocumentTools:-Tabulate([[plots:-display(P,view=2..5)],
                             [plots:-display(horizhuebar,view=[2..5,default])]],
                            exterior=none, interior=none);
    

     

     

     

    I'd like to wrap both parts into either one or two procedures, and hopefully I'd find time to do that and post here as a followup comment.

    Apart from considerations such as handling various kinds of 3D plot data (GRID vs MESH, etc, in the data structure) there are also the matters of detecting a view (VIEW) if specified when creating the 3D plot, handling custom shading schemes, and so on. And then there's the matter of what to do when multiple 3D surfaces (plots) have been merged together.

    It's also possible that the construction of the 2D plot colorbar is the only part which requires decent programming as a procedure with special options. The Tabulate command already offers options to specify the placement, column weighting, Table borders, etc. Perhaps it's not necessary to roll both parts into a single command.

    3dhuecolorbarA.mw

    acer

    I wanted to let everyone know that there is a Maple 2015 update available. Maple 2015.1 provides:

    • Support for high-resolution monitors (e.g. 4K, UHD)
    • Updated translations for Brazilian Portuguese, French, Japanese, and Simplified Chinese
    • Enhancements to the Explore command
    • Improvements to the DataSets package
    • Updates to the Microsoft Excel plug-in
    • Enhancements to unit handling
    • A variety of improvements to the math engine, interface, and documentation

    To get this update, you can use Tools>Check for Updates from within Maple, or visit Maple 2015.1 Downloads.

    If you are a MapleSim 2015 user, you already have this update, as it was part of the MapleSim 2015 installation.

    Kim

    Here we have a very brief introduction to the use of embedded components, but effective for the study of the polynomials in operations and some products made with maple 2015 to strengthen and raise the mathematics today.

     

    Operaciones_con_Polinomios.mw

    (in spanish)

    Atte.

    L.AraujoC.

    This post is related to the question. There were  proposed two ways of finding the volume of the cutted part of a sphere in the form of a wedge.  Here the procedure is presented that shows the rest of the sphere. Parameters procedure: R - radius of the sphere, H1 - the distance the first cutting plane to the plane  xOy,  H2 -  the distance the second cutting plane to the plane  zOy. Necessary conditions:  R>0,  H1>=0,  H2>=0,  H1^2+H2^2<R^2 . For clarity, different surfaces are painted in different colors.

    restart;

    Pic := proc (R::positive, H1::nonnegative, H2::nonnegative)

    local A, B, C, E, F;

    if R^2 <= H1^2+H2^2 then error "Should be H1^(2)+H2^(2)<R^(2)" end if;

    A := plot3d([R*sin(theta)*cos(phi), R*sin(theta)*sin(phi), R*cos(theta)], phi = arctan(sqrt(-H1^2-H2^2+R^2), H2) .. 2*Pi-arctan(sqrt(-H1^2-H2^2+R^2), H2), theta = 0 .. Pi, color = green);

    B := plot3d([R*sin(theta)*cos(phi), R*sin(theta)*sin(phi), R*cos(theta)], phi = -arctan(sqrt(-H1^2-H2^2+R^2), H2) .. arctan(sqrt(-H1^2-H2^2+R^2), H2), theta = 0 .. arccos(sqrt(R^2-H2^2-H2^2*tan(phi)^2)/R), color = green);

    C := plot3d([R*sin(theta)*cos(phi), R*sin(theta)*sin(phi), R*cos(theta)], phi = -arctan(sqrt(-H1^2-H2^2+R^2), H2) .. arctan(sqrt(-H1^2-H2^2+R^2), H2), theta = arccos(H1/R) .. Pi, color = green);

    E := plot3d([r*cos(phi), r*sin(phi), H1], phi = -arccos(H2/sqrt(R^2-H1^2)) .. arccos(H2/sqrt(R^2-H1^2)), r = H2/cos(phi) .. sqrt(R^2-H1^2), color = blue);

    F := plot3d([H2, r*cos(phi), r*sin(phi)], phi = arccos(sqrt(-H1^2-H2^2+R^2)/sqrt(R^2-H2^2)) .. Pi-arccos(sqrt(-H1^2-H2^2+R^2)/sqrt(R^2-H2^2)), r = H1/sin(phi) .. sqrt(R^2-H2^2), color = gold);

    plots[display](A, B, C, E, F, axes = none, view = [-1.5 .. 1.5, -1.5 .. 1.5, -1.5 .. 1.5], scaling = constrained, lightmodel = light4, orientation = [60, 80]);

    end proc:

     

    Example of use:

    Pic(1,  0.5,  0.3);

                                 

     

     

    Here we have an application to understand how algebraic expressions, calculating degrees relative abosulutos polynomial operations and introduction to work.Here we have an application to understand how algebraic expressions, calculating degrees relative abosulutos polynomial operations and introduction to work.

     

    Grados_de_Polinomios.mw

    (in spanish)

    Atte.

    L.AraujoC.

     

     

    We’re trying out something new with our webinars and are hosting our first ever live streaming webinar. Broadcast in real time, and featuring Jonny Zivku, our Maple T.A. Product Manager, this will be your chance to see the face behind the voice, as well as learn more about how academic institutions around the world are using Maple T.A. We hope you can join us.

    Here are the full details:

    Transforming Testing and Assessment with Maple T.A.

    In this webinar, you will learn how Maplesoft's testing and assessment system, Maple T.A., is being used to improve learning, save money, reduce drop-out rates, and increase student satisfaction at academic institutions around the world.

    The following Maple T.A. case studies will be presented:

    • The University of Waterloo saved $100,000/year on their grading budget
    • At the Amsterdam University of Applied Science, student pass rates went up approximately 20% within one year
    • The University of Canterbury continued to offer their full academic program after an earthquake damaged classrooms
    • At the University of Guelph, drop-out rates were reduced by more than 10%
    • ...And more!

    All attendees of this webinar will be sent a complimentary copy of the Maplesoft magazine Transforming Testing and Assessment.

    To join us for the live streaming webinar, please click here to register.

    In case anyone is interested, we recently posted a new application on the Application Center,

    Time Series Analysis: Forecasting Average Global Temperatures

    While interesting in itself (well, I think so, anyway), this application also provides tips and techniques for analyzing time series data in Maple, and shows how to access online data sets through the new data sets functionality in Maple 2015.

    eithne

    The trailers for the new Star Wars movie (Star Wars: The Force Awakens) introduced a new Droid called BB-8. This curious little guy features a spherical body and a controlled instrumented head. More recently, the BB-8 droid was showcased in a Star Wars celebration event and to many peoples' surprise it is real and not a CGI effect!

    We have a Sphero robot from Orbotix here at the office, and there was an immediate connection between BB-8 and the Sphero. All that remains is to add the head!

    Many have already put together their version of the BB-8, but I wanted to have a physical model that I can play with in a virtual environment and explore some design options.


     

    Preparation:

    To build a model of BB-8 like robotic system in MapleSim (Maplesoft's physical modeling software environment), I first needed a couple things in place before going forward:

    1. A few simple CAD shapes (half-sphere, wheels)

    2. A component to represent the contact between two spheres (both outside contact and inside contact)

    I used Maple’s plottools package to build the CAD files I needed. First a half-spherical shape:

    Then a wheel:

     

    The next step was to create the contact component in MapleSim. I used a Modelica custom component to bring together vector calculations of normal and tangential forces with a variety of options for convenience into one component:

     

     

    Build the model:

    We start with a spherical shape contacting the ground:

     

    Then we add two wheels inside it, and a hanging mass to keep the reference axis vertical when the wheels turn:

     

    Learning from published diagrams showing the internal mechanism of a Sphero, another set of free wheels improves the overall stability when motion commands are given to the two active wheels:

     

    Now this model can be used to move around the surface by giving speed commands to the individual motors that drive to the two bottom wheels. What is needed next is the head and the mechanism to move it around.

    Since the head can move almost freely, independent of body rotation, it has to be controlled via magnetic contacts and a controlled arm.

    First, we add the control arm:

     

    Now we need to build the head.

    The head has an identical triangle to the one at the end of the control arm. At each vertex there is a ball bearing that would slide on the surface of the main spherical body without friction. The magnetic force between the corresponding vertices of the two triangles is modeled via the available point-to-point force element in MapleSim.

     

     

    Once assembled, the MapleSim model diagram looks like this:

     

    ...and our BB-8 droid looks like this:

     

     

    Seeing the BB-8 in action:

    Now that we have constructed our droid in MapleSim, we can animate and see it in action!

     

    With this application we can meet safety characteristics of a relationship and simple or compound functions. Made with maple 2015.

    Relaciones_y_Funciones.mw

    (in spanish)

    L.AraujoC.

     

         Maple is seriously used in my article Approximation of subharmonic functions in the half-plane by the logarithm of the modulus of an analytic function. Math. Notes 78, No 4, 447-455 in two places. The purpose of this post is to present these applications.                                                                                                 First, I needed to prove the elementary inequality (related to the properties of the minimal harmonic majorant of the function 1/Im z in a certain strip)                                                                                                    2R+sqrt(R)-R(R+sqrt(R))y - 1/y   1/4                                                                                                  for    y ≥ 1/(R+sqrt(R)) and  y ≤ 1/R, the parameter R is greater than or equal to 1.   The artless attemt                                                                          
    restart; `assuming`([maximize(2*R+sqrt(R)-R*(R+sqrt(R))*y-1/y, y = 1/(R+sqrt(R)) .. 1/R)], [R >= 1])

    maximize(2*R+R^(1/2)-R*(R+R^(1/2))*y-1/y, y = 1/(R+R^(1/2)) .. 1/R)

    (1)

    fails. The second (and successful) try consists in the use of optimizers:

    F := proc (R) options operator, arrow; evalf(maximize(2*R+sqrt(R)-R*(R+sqrt(R))*y-1/y, y = 1/(R+sqrt(R)) .. 1/R)) end proc:

    F(1)

    .171572876

    (2)

     

    Optimization:-Minimize('F(R)', {R >= 1})

    [.171572875253809986, [R = HFloat(1.0)]]

    (3)

    To be sure ,
    DirectSearch:-Search(proc (R) options operator, arrow; F(R) end proc, {R >= 1})
    ;

    [.171572875745665, Vector(1, {(1) = 1.0000000195752754}, datatype = float[8]), 11]

    (4)

    Because 0.17
    "158 < 0.25, the inequality is  proved.   "
    Now we establish this  by the use of the derivative. 

    solve(diff(2*R+sqrt(R)-R*(R+sqrt(R))*y-1/y, y) = 0, y, explicit)

    1/(R^(3/2)+R^2)^(1/2), -1/(R^(3/2)+R^2)^(1/2)

    (5)

    maximize(1/sqrt(R^(3/2)+R^2)-1/(R+sqrt(R)), R = 1 .. infinity, location)

    (1/2)*2^(1/2)-1/2, {[{R = 1}, (1/2)*2^(1/2)-1/2]}

    (6)

    minimize(eval(2*R+sqrt(R)-R*(R+sqrt(R))*y-1/y, y = 1/sqrt(R^(3/2)+R^2)), R = 1 .. infinity, location)

    3-2*2^(1/2), {[{R = 1}, 3-2*2^(1/2)]}

    (7)

    evalf(3-2*sqrt(2))

    .171572876

    (8)

    The second use of Maple was the calculation of the asymptotics of the following integral (This is the double integral of the Laplacian of 1/Im z over the domain {z: |z-iR/2| < R/2} \ {z: |z| ≤ 1}.). That place is the key point of the proof. Its direct calculation in the polar coordinates fails.

    `assuming`([(int(int(2/(r^2*sin(phi)^3), r = 1 .. R*sin(phi)), phi = arcsin(1/R) .. Pi-arcsin(1/R)))/(2*Pi)], [R >= 1])

    (1/2)*(int(int(2/(r^2*sin(phi)^3), r = 1 .. R*sin(phi)), phi = arcsin(1/R) .. Pi-arcsin(1/R)))/Pi

    (9)

    In order to overcome the difficulty, we find the inner integral

    `assuming`([(int(2/(r^2*sin(phi)^3), r = 1 .. R*sin(phi)))/(2*Pi)], [R*sin(phi) >= 1])

    (R*sin(phi)-1)/(sin(phi)^4*R*Pi)

    (10)

    and then we find the outer integral. Because
    `assuming`([int((R*sin(phi)-1)/(sin(phi)^4*R*Pi), phi = arcsin(1/R) .. Pi-arcsin(1/R))], [R >= 1])

    int((R*sin(phi)-1)/(sin(phi)^4*R*Pi), phi = arcsin(1/R) .. Pi-arcsin(1/R))

    (11)

    is not successful, we find the indefinite integral  

    J := int((R*sin(phi)-1)/(sin(phi)^4*R*Pi), phi)

    -(1/2)*cos(phi)/(Pi*sin(phi)^2)+(1/2)*ln(csc(phi)-cot(phi))/Pi+(1/3)*cos(phi)/(R*Pi*sin(phi)^3)+(2/3)*cos(phi)/(R*Pi*sin(phi))

    (12)

    We verify that  the domain of the antiderivative includes the range of the integration.
    plot(-cos(phi)/sin(phi)^2+ln(csc(phi)-cot(phi)), phi = 0 .. Pi)

     

    plot((2/3)*cos(phi)/sin(phi)^3+(4/3)*cos(phi)/sin(phi), phi = 0 .. Pi)

     

        That's all right. By the Newton-Leibnitz formula,

    ``
    eval(J, phi = Pi-arcsin(1/R))-(eval(J, phi = arcsin(1/R)));

    (1/3)*(1-1/R^2)^(1/2)*R^2/Pi+(1/2)*ln((1-1/R^2)^(1/2)*R+R)/Pi-(4/3)*(1-1/R^2)^(1/2)/Pi-(1/2)*ln(R-(1-1/R^2)^(1/2)*R)/Pi

    (13)

    Finally, the*asymptotics*is found by

    asympt(eval(J, phi = Pi-arcsin(1/R))-(eval(J, phi = arcsin(1/R))), R, 3)

    (1/3)*R^2/Pi-(3/2)/Pi+(1/2)*(ln(2)+ln(R))/Pi-(1/2)*(-ln(2)-ln(R))/Pi+O(1/R^2)

    (14)

          It should be noted that a somewhat different expression is written in the article. My inaccuracy, as far as I remember it, consisted in the integration over the whole disk {z: |z-iR/2| < R/2} instead of {z: |z-iR/2| < R/2} \ {z: |z| ≤ 1}. Because only the form of the asymptotics const*R^2 + remainder is used in the article, the exact value of this non-zero constant is of no importance.

           It would be nice if somebody else presents similar examples here or elsewhere.

     

    Download Discovery_with_Maple.mw

    I'd like to pay attention to an application "Interaural Time Delay" by Samir Khan. His applications are interesting, based on  real data, and  mathematically accurate. Here is its introduction:

    "Humans locate the origin of a sound with several cues. One technique employs the small difference in the time taken for the sound to reach either ear; this is known as the interaural time delay (ITD). This application modifies a single-channel audio file so that the sound appears to originate at an angle from the observer. It does this by introducing an extra channel of sound. Despite both channels having the same amplitude, the sound appears to come from an angle simply by delaying one channel".

    Maplesoft regularly hosts live webinars on a variety of topics. Below you will find details on upcoming webinars we think may be of interest to the MaplePrimes community.  For the complete list of upcoming webinars, visit our website.

    Case Study: Transforming a University's Placement Testing Process

    This webinar will feature the story of how the University of the Virgin Islands moved their placing testing process from paper and pen to using the Mathematical Association of America’s (MAA) placement tests offered through the Maple T.A. testing environment. Instructors at the university now handpick questions to create their own placement tests that best fit the course they are teaching. From there, they are able to analyze the data and craft lessons based on student performance. The end result is that students are more satisfied with the education they are receiving and instructors have made enormous gains with regards to efficiency and flexibility.

    To join us for the live presentation with Dr. Celil Ekici from the University of the Virgin Islands, please click here to register.

    Getting Started with Maple

    This webinar is designed for the user who comes to Maple for the first time. It will demonstrate “how to get started” by clarifying the user interface and the ways math can be entered into Maple, and then “processed.” Coverage includes

    • Entering mathematical expressions and interacting with them in a syntax-free way.
    • The difference between input in mathematical notation and “linear” or text form.
    • The role of the Context Sensitive Menu system for interacting with mathematical objects.
    • Graphing and interacting with various types of graphs, including animations, surfaces, and implicit plots.
    • Use of built-in tools such as Assistants, Tutors, and Task Templates.
    • The Maple help system and the Maple Portal.
    • Introduction to differential equations and matrix manipulations.

    To join us for the live presentation, please click here to register.

    3-D Model Import/Export and Printing The new Import and Export commands introduced in Maple 2015 provide a unified approach to all data import and export activities, replacing the need to use different commands in different situations. They can be used with many of the wide variety of file types supported by Maple, including 3-D graphics data, numeric and tabular data, images, audio files, special-purpose formats for mathematical objects such as graphs, and much more.

    In the following example, you can see how to use these commands in order to bring 3-D models from the popular website Thingiverse and to export 3-D plots to a format suitable for 3-D printing.

    Tips and Techniques: 3-D Model Import/Export and Printing

    Another application for the study of rational numbers in operations, generating fraction, etc.

     

    Numeros_Racionales.mw

    (in spanish)

     

    Atte.

    L.AraujoC.

    First 68 69 70 71 72 73 74 Last Page 70 of 297