{VERSION 2 3 "IBM INTEL NT" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 0 0 0 0 0 0 } {CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "2 D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 }{CSTYLE "Help Heading" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 256 "Times" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Out put" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {SECT 0 {PARA 0 "" 0 "" {TEXT 26 7 "Advice:" }{TEXT -1 25 " Re ordering an expression" }}{PARA 0 "" 0 "" {TEXT -1 116 "Normally, once an expression has been created in a Maple session, it is always writt en in the same order. Thus if " }{XPPEDIT 18 0 "a+b*c" ",&%\"aG\"\" \"*&%\"bGF$%\"cGF$F$" }{TEXT -1 60 " has occurred previously, even as \+ a sub-expression (e.g. in " }{XPPEDIT 18 0 "(a+b*c)*d" "*&,&%\"aG\"\" \"*&%\"bGF%%\"cGF%F%F%%\"dGF%" }{TEXT -1 17 "), and you enter " } {MPLTEXT 0 21 5 "c*b+a" }{TEXT -1 27 ", Maple will rewrite it as " } {XPPEDIT 18 0 "a+b*c" ",&%\"aG\"\"\"*&%\"bGF$%\"cGF$F$" }{TEXT -1 17 " . \n\nYou can use " }{MPLTEXT 0 21 4 "sort" }{TEXT -1 63 " to change the order of an expression. The first argument to " }{MPLTEXT 0 21 4 "sort" }{TEXT -1 100 " is the expression to sort, and the second is a list of variables or functions. A third argument " }{MPLTEXT 0 21 4 "plex" }{TEXT -1 211 " causes the sorting to be in pure lexicogr aphic order in the members of the list, rather than decreasing total d egree in the members of the list. \n\nAfter being sorted, the express ion stays in the sorted order." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "sort(a+b*c+c^3*d, [b,c]);" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#,(*&%\"dG\"\"\"%\"cG\"\"$F&*&%\"bGF&F 'F&F&%\"aGF&" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 34 "This is in total-degree order, so " }{XPPEDIT 18 0 "d*c^3 " "*&%\"dG\"\"\"*$%\"cG\"\"$F$" }{TEXT -1 25 ", which is of order 3 in " }{XPPEDIT 18 0 "b" "I\"bG6\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "c " "I\"cG6\"" }{TEXT -1 15 ", comes before " }{XPPEDIT 18 0 "b*c" "*&% \"bG\"\"\"%\"cGF$" }{TEXT -1 40 " which is of order 2 in those variabl es." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "sort(a+b*c+c^3*d, [b,c],plex);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(*&%\"bG\"\"\"%\"cGF&F&*&%\"dGF&F'\"\"$F&%\"aGF&" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 31 "In pure l exicographic order in " }{MPLTEXT 0 21 5 "[b,c]" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "b*c" "*&%\"bG\"\"\"%\"cGF$" }{TEXT -1 14 " comes before " }{XPPEDIT 18 0 "d*c^3" "*&%\"dG\"\"\"*$%\"cG\"\"$F$" }{TEXT -1 9 " \+ because " }{MPLTEXT 0 21 1 "b" }{TEXT -1 178 " has first priority. In \+ a sum, terms containing no members of the list come last. In a produc t, however, factors containing no members of the list come first. Thu s we obtained " }{XPPEDIT 18 0 "d *c^3" "*&%\"dG\"\"\"*$%\"cG\"\"$F$" }{TEXT -1 13 " rather than " }{XPPEDIT 18 0 "c^3 *d" "*&%\"cG\"\"$%\"d G\"\"\"" }{TEXT -1 44 ".\n\nHowever, suppose you have the expression \+ " }{XPPEDIT 18 0 "c^3 + c^2 + c + 1" ",**$%\"cG\"\"$\"\"\"*$F$\"\"#F&F $F&\"\"\"F&" }{TEXT -1 26 " and wish to change it to " }{XPPEDIT 18 0 "1 + c + c^2 + c^3" ",*\"\"\"\"\"\"%\"cGF$*$F%\"\"#F$*$F%\"\"$F$" } {TEXT -1 26 ". There is no way to use " }{MPLTEXT 0 21 4 "sort" } {TEXT -1 67 " to do this. You would have to create the expression ini tially as " }{MPLTEXT 0 21 17 "1 + c + c^2 + c^3" }{TEXT -1 75 ". But there is a trick you can use: obtain a new variable that looks like \+ " }{MPLTEXT 0 21 1 "c" }{TEXT -1 127 " but is not the same for Maple, \+ and create the expression using that new variable. Then assign the ne w variable as a value to " }{MPLTEXT 0 21 1 "c" }{TEXT -1 1 "." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " p:= c^3 + c^2 + c + 1;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"pG,**$%\"cG\"\"$\"\"\"*$F'\"\"#F)F 'F)F)F)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "newc:= readlib(` tools/gensym`)(c):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "1 + n ewc + newc^2 + newc^3;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,*\"\"\"F$% \"cGF$*$F%\"\"#F$*$F%\"\"$F$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "c:= newc;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"cGF$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "p;" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#,*\"\"\"F$%\"cGF$*$F%\"\"#F$*$F%\"\"$F$" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 166 "In a more complicated case, to create the new version of the expression you could first convert the \+ expression to a list, permute the elements as desired, substitute " } {MPLTEXT 0 21 4 "newc" }{TEXT -1 5 " for " }{MPLTEXT 0 21 1 "c" } {TEXT -1 33 ", and then convert back to a sum." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plist:= convert(p,list);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&plistG7&\"\"\"%\"cG*$F'\"\"#*$F'\"\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "newc:= readlib(`tools/gensym`)(c): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "[op(plist[2..4]), plist [1]];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7&%\"cG*$F$\"\"#*$F$\"\"$\"\" \"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "subs(c=newc,\");" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#7&%\"cG*$F$\"\"#*$F$\"\"$\"\"\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "convert(\",`+`);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,*%\"cG\"\"\"*$F$\"\"#F%*$F$\"\"$F%F%F%" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "c:= newc;" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%\"cGF$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "p;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,*%\"cG\"\"\"*$F$\"\"#F%*$F$\" \"$F%F%F%" }}}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "See also:" }{TEXT -1 2 " " }{HYPERLNK 17 "sort" 2 "sort" "" }{TEXT -1 2 ", " } {HYPERLNK 17 "`tools/gensym`" 2 "tools,gensym" "" }}}{SECT 0 {PARA 0 " " 0 "" {TEXT 26 22 "Maple Advisor Database" }{TEXT 256 18 " R. Israe l, 1997" }}}}{MARK "0 17 1 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }