emendes

455 Reputation

6 Badges

8 years, 105 days

MaplePrimes Activity


These are questions asked by emendes

Hello,

I need to order a set of polynomials based on a given ranking. For example:

F:=[F1,F2,F3,F4,F5,F6]:
F1 := x1*x4^2+x4^2-x1*x2*x4-x2*x4+x1*x2+3*x2;
F2 := x1*x4-x3-x1*x2;
F3 := x3*x4-2*x2^2-x1*x2-1;
F4 := x1*x3^2+x3^2-x1^2*x2*x3-x1*x2*x3+x1^3*x2+3*x1^2*x2;
F5 := -x3^2 + x1*x2*x3 -2*x1*x2^2-x1^2*x2-x1;
F6 := 2*x1*x2^2+2*x1^2*x2^2-2*x1^2*x2+x1^2+x1;

The order used to rank the polynomials is based on the variables in the following order: x1 < x2 < x3 < x4.

The ranking criteria are:

  1. The first polynomial should be the one involving x4 with the lowest degree of nonlinearity in x4 and the fewest number of terms (in this case, F2).
  2. The next polynomial should also involve x4, but with the lowest degree of nonlinearity and the next fewest number of terms and so on.
  3. Once the polynomials in x4 are exhausted, the ranking continues similarly for the next variable x3, followed by x2, and finally x1.

How can I do this efficiently?

Obs.:If necessary, I can share my solution to the problem, though it's far from efficient.

Hello,

I'm having trouble updating an old Maple package to work with the latest version of Maple. In the package, there are several commands that modify predefined procedures and then rename them (see the example below). I need to save all these new procedures to a text file so I can further modify them and better understand their functionality. How can I achieve this?

d_remset := subs(`class`=`d_class`,`remseta`=`d_remseta`,`premas`=`d_premas`,op(`remset`)):

remset is a procedure previously defined.  

Many thanks.

Obs.: If you have a better idea on how to deal with the procdures, please let me know. 

Hello

I am struggling to translate an old Maple V3 package to work with the latest version of Maple. Although I have received help from members of this list and managed to resolve some problems on my own, I am at a loss as to how to fix the following Maple code. 

# differentiation
ddf := proc(f)
    local j;
    print(f):
    sum('expand(eval(subs(diff = 0,diff(f,indets(f)[j])))*(indets(f)[j]))','j' = 1 .. nops(indets(f)))
end proc:

Suppose that 

f:=x;

ddf(f);
                               x

Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation

Any help in figuring out what the author was going for would be really appreciated.

Obs.: An example taken from the old Maple v3 help file.  If f:=z^2+y, the output is 2*z*z'+y'.

Hello

In my last question, I asked for help converting an old Maple V3 code to the latest version. With the help of  @Rouben Rostamian, I managed to get most of the procedures working again. Unfortunately, there is one procedure that I cannot figure out how to convert. Below is the procedure, along with an example that works and one that does not.

saturbasis := proc(ps,js,ord)
 local qs,gb,zz,j,aux;
     print("ps = ",ps):
     print("js = ",js):
	 print("ord = ",ord):
     if js <> {} then
         qs := [op(ps),'`@z`.j*js[j]-1' $ ('j' = 1 .. nops(js))];print("qs = ",%):
         zz := ['`@z`.(nops(js)-j+1)' $ ('j' = 1 .. nops(js))];print("zz = ",%):
         aux:= [op(zz),'ord[nops(ord)-j+1]' $ ('j' = 1 .. nops(ord))]:print("aux = ",aux):
         gb := grobner['gbasis'](qs,aux,'plex');
         qs := [];
         for j to nops(gb) do
             if {op(zz)} minus indets(gb[j]) = {op(zz)} then
                 qs := [gb[j],op(qs)]
             fi
         od
     else qs := ps
     fi;
     qs
end proc:

First example:

ps:=[2*x1^2 + 3*x2^2 + 4*x1 + x2, x1*x3 - 3*x2 - 1, 2*x1*x4 + 3*x2 + 1]:
js:={x1}:
ord:=[x1, x2, x3, x4]:

saturbasis(ps,js,ord);
             [    2       2                                
    "ps = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, 

                        ]
      2 x1 x4 + 3 x2 + 1]


                         "js = ", {x1}

                   "ord = ", [x1, x2, x3, x4]

             [    2       2                                
    "qs = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, 

                                   ]
      2 x1 x4 + 3 x2 + 1, @z x1 - 1]


                         "zz = ", [@z]

                 "aux = ", [@z, x4, x3, x2, x1]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
[    2       2                                                  
[2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, x2 x3 + 2 x1 + 4, 

           ]
  2 x4 + x3]


Second example:

ps:=[2*x1*x4^2 + 3*x1 + x4 + 6, x3*x4^3 + 2*x4^4 - 9*x3 - 18*x4, 2*x2*x4^2 + 3*x2 - 4*x4 + 1]:
js:={2*x4^2 + 3, x4^3 - 9}:
ord:={2*x4^2 + 3, x4^3 - 9}:

saturbasis(ps,js,ord);
           [       2                  
  "ps = ", [2 x1 x4  + 3 x1 + x4 + 6, 

         3       4                        2                  ]
    x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1]


                          /    2        3    \ 
                "js = ", { 2 x4  + 3, x4  - 9 }
                          \                  / 

                           /    2        3    \ 
                "ord = ", { 2 x4  + 3, x4  - 9 }
                           \                  / 

          [       2                  
 "qs = ", [2 x1 x4  + 3 x1 + x4 + 6, 

        3       4                        2                    
   x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1, 

      /    2    \           /  3    \    ]
   @z \2 x4  + 3/ - 1, 2 @z \x4  - 9/ - 1]


                      "zz = ", [2 @z, @z]

                      [            3          2    ]
            "aux = ", [2 @z, @z, x4  - 9, 2 x4  + 3]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
Error, (in grobner:-gbasis) invalid input: Groebner:-Basis expects its 2nd argument, tord1, to be of type Or(ShortMonomialOrder,name,MonomialOrder), but received plex(2*`@z`,`@z`,x4^3-9,2*x4^2+3)

I suppose that the "." is no longer used as it was back in Maple V3, and it seems that the author of the procedure was creating extra auxiliary variables to solve the problem.


What did the author use @ for creating the variables?  And how to fix the error?

Many thanks
 

Hello

I need to use the Ritt algorithm to find the characteristic sets of a set of differential equations. In the past, it seems there was a Maple package by D. Wang available through Maple Applications, but this no longer appears to be the case. I managed to download an old set of files from the author’s site, dated February 1996, which is a Maple V3 package. The instructions in the Readme file mention that using the provided Makefile, an m-file containing all the functions will be created, which can then be loaded into Maple. Unfortunately, running make -f Makefile did not create anything, so I am wondering if I could get some assistance on how to convert this package to something compatible with the latest Maple releases.

The source (txt) files are structured as follows:

Example: 


1) Comments
2) Definition of the User functions - something like

 

dcharsets[dcharset] := proc() `charsets/d_charset`(args) end:

dcharsets[dmcharset] := proc() `charsets/d_mcharset`(args) end:

dcharsets[dcs] := proc() `charsets/d_charser`(args) end:

dcharsets[dmcs] := proc() `charsets/d_mcs`(args) end:

dcharsets[dics] := proc() `charsets/d_ics`(args) end:

and

read `charsets.m`:

# set of non-zero remainders of d-polys in ps wrt d-ascending set as
#       user level function
`charsets/d_remset` :=

subs(`charsets/class`=`charsets/d_class`,
     `charsets/remseta`=`charsets/d_remseta`,
     `charsets/premas`=`charsets/d_premas`,op(`charsets/remset`)):

and lots of Maple procedures - Example below

 

`charsets/d_charset` := proc(ps,lst,medset)

....

end:

the source file ends with the following lines.

read dhelp;
save `dcharsets.m`:
quit

Many thanks

 

Note: Before posting this question here, I tried to contact the author but received no response.

1 2 3 4 5 6 7 Last Page 1 of 15