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 work consists of two independent procedures. The first procedure  IsConvex  checks the convexity of a polygon. The second procedure  IsSimple  verifies the simplicity of a polygon. Formal argument   is the list of vertices of the polygon.

    Regarding the basic concepts, see  http://en.wikipedia.org/wiki/Polygon

     

    IsConvex:=proc(X::listlist)

    local n, Z, f, i, x, y;

    n:=nops(X);

    Z:=[op(X),X[1]];

    f:=seq((x-Z[i,1])*(Z[i+1,2]-Z[i,2])-(y-Z[i,2])*(Z[i+1,1]-Z[i,1]),i=1..n);

       for i to n do

        if  convert([seq(is(subs(x=j[1],y=j[2],f[i])<=0), j in {op(X)} minus  {X[i],X[irem(i,n)+1]})],`or`) and      convert([seq(is(subs(x=j[1],y=j[2],f[i])>=0),

        j in {op(X)} minus {X[i],X[irem(i,n)+1]})], `or`) then break fi;

       od;

    if i<=n then return false else true fi;

    end proc:

     

    IsSimple:=proc(X::listlist)

    local n, Z, i, j, f, T, Q, x, y;

    Z:=[op(X),X[1],X[2]]; n:=nops(X);

    if n>nops({op(X)}) then   return false  fi;

       for i from 2 to nops(Z)-1 do

         if is((Z[i-1,1]-Z[i,1])*(Z[i+1,1]-Z[i,1])+(Z[i-1,2]-Z[i,2])*(Z[i+1,2]-Z[i,2]) =  sqrt((Z[i-1,1] -Z[i,1])^2+(Z[i-1,2]-Z[i,2])^2)*sqrt((Z[i+1,1]-Z[i,1])^2 +(Z[i+1,2]-Z[i,2])^2)) then return false fi;

       od;

    f:=seq((x-Z[i,1])*(Z[i+1,2]-Z[i,2])-(y-Z[i,2])*(Z[i+1,1]-Z[i,1]),i=1..n);

    _Envsignum0:= 0: 

       for i from 1 to n do

       T[i]:=[]; Q[i]:=[];

          for j from 1 to n do

          if modp(j-i,n)<>0 and modp(j-i,n)<>1 and modp(j-i,n)<>n-1 and                  not(signum(subs(x=Z[j,1],y=Z[j,2],f[i])*subs(x=Z[j+1,1],y=Z[j+1,2],f[i]))=-1 and             signum(subs(x=Z[i,1],y=Z[i,2],f[j])*subs(x=Z[i+1,1],y=Z[i+1,2],f[j]))=-1) then

          if (subs(x=Z[j,1],y=Z[j,2],f[i])=0 implies (signum((Z[j,1]-Z[i,1])*(Z[i+1,1]-Z[j,1]))=-1 or             signum((Z[j,2]-Z[i,2])*(Z[i+1,2]-Z[j,2]))=-1)) then

          T[i]:=[op(T[i]),1]; Q[i]:=[op(Q[i]),1] else  T[i]:=[op(T[i]),1]  fi; fi;   od;

           od; 

    convert([seq(nops(T[i])=n-3,i=1..n), seq(nops(Q[i])=n-3,i=1..n)],`and`)  

    end proc:

     

    Examples:

    X:=[[0,0],[1,0],[2,1],[3,0],[4,0],[2,2]]: IsConvex(X), IsSimple(X);

    X:=[[0,0],[2,0],[1,1],[1,-1]]: IsConvex(X), IsSimple(X);

    X:=[[0,0],[2,0],[1,1],[1,0], [-1,-1]]: IsConvex(X), IsSimple(X);

    X:=[[0,0],[1,0],[1,2],[-2,2],[-2,-2],[3,-2],[3,4],[-4,4],[-4,-4],[5,-4],[5,6],[-6,6],[-6,-6],[7,-6],[7,8],[-6,8],[-6,7],[6,7],[6,-5],[-5,-5],[-5,5],[4,5],[4,-3],[-3,-3],[-3,3],[2,3],[2,-1],[-1,-1],[-1,1],[0,1]]: IsConvex(X), IsSimple(X);

    X:=[seq([cos(2*Pi*k/17), sin(2*Pi*k/17)], k=0..16)]: IsConvex(X), IsSimple(X);

    Testing_polygons.mws 

    Edited: The variables  x  and  y  are made local.

     

    La aplicacion de las matrices en su más claro ejemplo, dirigido explicitamente a la criptografia; solo hay que tener conocimiento de algebra de matrices y calculo de matriz inversa. (versión español).

    The application of the matrices in its most obvious example, explicitly directed to cryptography; just have to have knowledge of matrix algebra and inverse matrix calculation. (version english).

     

    Criptografia.mw

     

    Lenin Araujo Castillo

    Physics Pure

    Computer Science

    I am baffled by this choice of Maple. When one goes to Maple website and look at the help pages on the web, like this

    http://www.maplesoft.com/support/help/Maple/view.aspx?path=convert/rational

    Then all the commands in the help pages are shown using build-in images. This means if one sees a command they want to copy to try, they are not able to copy it using the mouse since it is an image, or even may be to copy it to some text file for later use, email it, etc...

    Basically one can just look at it. 

    Compare this to Mathematica web help page

    http://reference.wolfram.com/mathematica/ref/Rationalize.html

    Where one can click on any Mathematica command, and a small windows opens with plain text format of the command that one can copy and paste anywhere.

    Not only that, the formatting of the commands in Maple help pages are all in the new document mode style (the italic math font used, which I can't stand looking at, that is why I do not use document mode). 

    So, for someone using worksheet, and want to see the good old fashioned Maple commands (1D, nothing fancy, plain text), they can't find those.  It would be nice to have a version of the help web pages in 1D, for those who want to browse help in classical Maple code and not interested in all document mode.

    (Yes, I know I can do that in Maple itself on my desktop, but many times I use google to find a Maple command, and it leads me to Maple help pages, and then I find I can't copy the command). Then I have to open the local help page on my Maple, and look for the same command again in order to copy something).

     

    I really very much like this package since it works just perfectly converting units and also supports CGS for people doing calculations in theoretical physics. I have just a suggestion concerning the formattig: As is explained in many physics books and also at the units standard website http://physics.nist.gov/, units shouldn't be placed in square brackets since these brackets are defined such that [m] = kg means: unit of m is kg. To write is m = 3 [kg] is a very common and unharmful mistake, also used very often when labelling axes in figures, e.g. m [kg] instead of the correct m/kg or m (kg). Another issue is that units shouldn't be printed italic but upright and any physics journal requests its authors to consider this rule. Again, this is not a "mistake" but on the other hand the Maple pretty-print output is already so nice that considering such rules would even make it perfect.

    I am fully aware that omitting the brackets could be considered harmful if someone has an algebraic expression in front of the unit where symbols and units could be mixed. On the other hand having the usual interspace between unit and expression, the unit being upright and maybe even coloured (analogously to e.g. operators in the physics package) units and symbols could be easily held apart.

    On the help page updates,Maple17,SignalProcessing

    If I open the current help page in a worksheet window and enter through each line individually I get an error on executing 2.1.8

    The !!! will execute the whole page no problem although it brings up the second issue which is using the stop hand, it won't stop the calculation of the entire worksheet part way through. 

     

    Congratulations to Eric Miles, a graduate teaching assistant at Colorado State University, for winning the second individual prize of The Möbius App Challenge! Eric will be receiving an iPad prize pack for his app Stretch and Translate Sin(x).

    Maplesoft launched the Möbius App Challenge earlier this year to give Maplesoft community members the opportunity to get involved in the creation of Möbius Apps. This contest seeks to challenge users to create Math Apps using Maple, submit them to The Möbius Project website, then award the most useful, creative, and effective submissions. Finalists from the individual level challenge are chosen four times a year, so make sure to enter the next round of the challenge for your chance at a Maplesoft prize pack!

    For full contest details and to enter, please visit: http://www.maplesoft.com/lp/mobius/index.aspx.

    Jonny Zivku
    Maplesoft Product Manager, Maple T.A.

    Well-known problem is the problem of placing eight shess queens on an 8×8 chessboard so that no two queens attack each other. In this post, we consider the same problem of placing  m  shess queens on an  n×n  chessboard. The problem has a solution if  n>3  and  m<=n .

    Work consists of two procedures. The first procedure  Queens  returns the total number of solutions and saves a complete list of all solutions (global variable  S ). The second procedure  QueensPic  shows the user-defined solutions from the list  S  on the board. Formal argument  t  is the number of solutions in each row of the display. The second procedure should be used in the standard interface, rather than in the classic one, since in the latter it may not work properly.

    Queens := proc (m::posint, n::posint)

    local It, K, l, L, M, P;

    global S, p, q;

    It := proc (L)

    local P, k, i, j;

    M := []; k := nops(L[1]);

    for i in L do

    for j to n do

    if convert([seq(j <> i[s, 2], s = 1 .. k)], `and`) and convert([seq(l[k+1]-i[s, 1] <> i[s, 2]-j, s = 1 .. k)], `and`) and convert([seq(l[k+1]-i[s, 1] <> j-i[s, 2], s = 1 .. k)], `and`) then M := [op(M), [op(i), [l[k+1], j]]]

    fi;

    od; od;

    M;

    end proc;

    K := combinat:-choose([`$`(1 .. n)], m);

    S := [];

    for l in K do P := [];

    L := [seq([[l[1], i]], i = 1 .. n)];

    P := [op(P), op((It@@(m-1))(L))];

    S := [op(S), op(P)]

    od;

    p := args[1]; q := args[2];

    nops(S);

    end proc:

     

    QueensPic := proc (M, t::posint)

    local m, n, HL, VL, T, A, N;

    uses plottools, plots;

    m := p; n := q; N := nops(args[1]);

    HL := seq(line([.5, .5+k], [.5+n, .5+k], color = black, thickness = 2), k = 0 .. n);

    VL := seq(line([.5+k, .5], [.5+k, .5+n], color = black, thickness = 2), k = 0 .. n);

    T := [seq(textplot([seq([op(M[i, j]), Q], j = 1 .. m)], color = red, font = [TIMES, ROMAN, 24]), i = 1 .. N)];

    if m <= n and 3 < n then

    A := seq(display(HL, VL, T[k], axes = none, scaling = constrained), k = 1 .. N), seq(display(plot([[0, 0]]), axes = none, scaling = constrained), k = 1 .. t*ceil(N/t)-N);

    Matrix(ceil(N/t), t, [A]);

    display(%);

    fi;

    end proc:

     

    Examples of work:

    Queens(5, 6);  

    S[70], S[140], S[210];

    QueensPic([%], 3); 

                                                                                248

    [[1, 5], [2, 3], [3, 6], [4, 4], [6, 1]], [[1, 3], [2, 5], [4, 1], [5, 4], [6, 2]], [[2, 1], [3, 4], [4, 2], [5, 5], [6, 3]]

     

    Two solutions of classic problem:

    Queens(8, 8); 

    S[64..65];

    QueensPic(%, 2);

                                                                                          92

    [[[1, 5], [2, 8], [3, 4], [4, 1], [5, 7], [6, 2], [7, 6], [8, 3]], [[1, 6], [2, 1], [3, 5], [4, 2], [5, 8], [6, 3], [7, 7], [8, 4]]]

     

     

    Queens_problem.mw

    There are still several bugs resulting from the MaplePrimes update last week which you may not be aware of.

    1. The list "All Recent Posts & Questions" is not in the correct order. It is ordered by the time of creation of the Post or Question. It should be ordered by the time of the most recent update to the thread. In other words, the top seven entries in "All Recent Post & Questions" should be the seven entries of "Active Conversations".
    2. Email notifications do not always contain a hyperlink to the relevant post. (I could send you some examples if you need.)
    3. In the list of Answers in a user's profile, the votes for the Answers are not shown for those Answers created after the update.
    4. There are no longer automatically generated titles for Replies for which the author fails to enter a title. This taken alone may be a good idea, but it contributes to bug (2) above. Also, it makes it impossible to send a "Contact Author" email relating to the Reply---when you click send on the email, it will be rejected, even if you tried to add a title.

    Earlier this week, we updated MaplePrimes with some fairly extensive changes that improved site performance. While MaplePrimes behaved as expected for most, a few people experienced some problems logging in, and a few other issues were also reported. If you are a MaplePrimes member inconvenienced by these issues, I apologize and thank you for your patience, and also for reporting the problems. I've had some conversations with a few different members, and your help in describing and diagnosing the problems is very much appreciated.

    We have been working hard to resolve these problems, and I'm happy to report that most have now been taken care of.

    • The log-in function now works as expected across all browsers. If you are still having problems, you can visit http://www.mapleprimes.com/logout.aspx to force a log-out and reset your browser cookies for MaplePrimes, which will also correct the problem going forward.

    • We have corrected the problem where links to uploaded files were resulting in 404 errors.

    • We have also corrected an issue where the ordering of posts in a user's profile page was done incorrectly.


    There are a handful of smaller problems that we continue to work through, and if you notice any other issues, please continue to let us know, either by posting here on MaplePrimes, or by contacting me directly.

    Bryon

    The board is going to work now with FF for me after latest updates.

    NB: I got some mails advicing to delete (old) cookies for Mapleprimes, but
    as my browser is alsways completely cleared on close (or on demand) that can
    not have been the reason.

    It works at least, if I give up all security settings. Which I do not want,
    so I sketch a way to use them.

    Be aware that not all in a page comes from Mapleprimes. Some is from another
    server maplesoft.com and thus considered as 3rd party. Same for some scripts
    and CSS etc, which stem from Google, jquery (or else)

    If using NoScript or some blockers or similar essentially one has to allow
    ajax.googleapis.com, which was needed in the previous version as well (see
    below). Dito code.jquery.com is needed (both are 3rd party to Mapleprimes).

    It still may hang up at loading ajax-loader.gif, which is located on the
    server mapleprimes.com - I do not know why. After allowing a request policy
    from mapleprimes.com to ajax.googleapis.com it loads.

    That allows to still block all the social media stuff (especially FB connect
    is disabled)

    And currently I do not see calls to 2o7, just Omniture is trying to work.

    ---

    For the call to Google: it seems to be needed only for their jquery library,
    ajax.googleapis.com/ajax/libs/jquery/ and .../jquery/.

    But the site calls the open source code.jquery.com/ui anyway. So why using
    Google as well? Why not change and stay on code.jquery.com?

    Calling to Google transmits my IP and browser header, it is like a fingerprint
    and allows GG to identify me later on as Maple user. I dislike that very much.

    Edited: edit works as well

    So, I like Maple language. I want to promote it. However, among my friends, people mostly like things that are "Free and Open" like SymPy is. However, I think Maple is just better for mathematics, because it is so interactive, and it's so easy to explore mathematical concepts with it. So, I would like it to survive and be widely used.

    The statistical R package seem to have survived by having many arduous open source fans writing packages, convenient functions and interfaces with general purpose languages. I don't see much of this trend with Maple, but I would love to, and yet I am not in power to change the fact that Maple is not open source. So, my question -- can we open source Maple?

    After disabling all security addons the Ajax gif loads, then it shows an error and after that it jumps to a page displaying "2013", but that page actually does not have any content (use ctrl + u to see it).

    And the I see, that the browser tries to load from maplesoft.112.2o7.net and hangs up in that transfer (have not checked the ports).

    In reality I would forbid to load from 2o7, as I receject almost all trackers.

    But looking at Adobe http://www.adobe.com/de/privacy/analytics.html or others http://www.makeuseof.com/tag/that-mysterious-2o7-net-tracking-cookie-all-you-need-to-know/ those are 3rd party cookies (Omniture ---> Adobe)

    Every reasonable person aware of security and xss forbids dubious sources from other websites (and I am not happy that this sites call Ajax at Google)

    And if that is the reason for the bad behaviour of the new sites it would be a good joke, really.

    For me it only works with IE and all its security issues (and I have to use "preview" before posting is possible)

    As of yesterday's updates to the MaplePrimes software, the ordering of the Answers in a User's Profile has been changed from reverse chronological to forward chronological. This sucks. If you have to change it, then at least make the ordering an option. I will note that the ordering of a User's Posts is still reverse chronological. It makes no sense for Posts to be in one order and Answers in another.

    Also, I still cannot login on Firefox. I turned off all my add-ons, and it still doesn't work. It doesn't reject my credentials; rather it acts (for one screen) like it is logging me in as someone with a null name and 0 reputation.

    When I edit someone else's material, it changes the author to me!!

    In Internet Explorer, I need to update every page every time I view it. If I don't, I won't see the new material. 

    I have not noticed any improvement in the amount of time it takes for updates to appear in the right column. It can still take a half hour from when the post/answer/reply was made.

    Two problems surfaced when I upgraded my Mac to Mavericks (OS X 10.9).

    First, the old Java SE installation was removed (actually, some linkages were destroyed), so a Maple launch puts up a dialog "need to install Java." Apple hasn't yet (10/23/13) updated the software database links --- installation fails with a "can't find software" error. I reinstalled Java using the version at http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2013-05.dmg. (The links can be redone, it's just easier to reinstall.)

    Second, the (new?) structure for /Library/Frameworks made my Maple license invalid. I dug out the old email with my activation code, then re-activated.

    And all is now copacetic.

    I can post answers, but those are not shown

    PS: would have done at other threads - but as alreyd said ...

    PPS: how about testing? grrrrrrrrrr .......

    First 92 93 94 95 96 97 98 Last Page 94 of 307