emendes

515 Reputation

6 Badges

8 years, 335 days

MaplePrimes Activity


These are replies submitted by emendes

@dharr Thank you very much. There are at least twenty such procedures, and I need to save them all to a single file. Is there a way to find all the user-created procedures and save them to one file?

I have checked the result of issuing the command save.  The output is:

d_remset := proc (ps, as, ord) local ind, i; if _npassed <> 3 then ERROR(
`wrong number of arguments`); elif nops(ps) < 1 or nops(as) < 1 then ERROR(
`no polynomials specified`); elif nops(ord) < 1 then ERROR(
`no indeterminates specified`); elif not type(ord,list) then ERROR(ord,
`must be a list`); end if; if member(false,map(type,ord,name)) then ERROR(
`bad variable list`); end if; ind := 0; for i to nops(as) do if d_class(as[i],
ord) <= ind then ERROR(`second argument must be a non-contradictory (weak-, qua\
si-) ascend            ing set`); else ind := d_class(as[i],ord); end if; end 
do; if type(ps,{list, set}) then if member(false,map(type,ps,polynom(polynom(
rational),ord))) or member(false,map(type,as,polynom(polynom(rational),ord))) 
then ERROR(`input must be polynomials over Q in`,ord); end if; d_remseta(ps,as,
ord); else if member(false,map(type,as,polynom(polynom(rational),ord))) then 
ERROR(`input must be polynomials over Q in`,ord); end if; d_premas(ps,as,ord);
end if; end proc;

Is there any way to get a properly indented output?

On a side note, is there a way to permanently turn off the Maple suggestions that appear when issuing a command (the small window with an example)?

@mmcdara Many thanks. Both options work for me. The second option will also be helpful for another problem.

@mmcdara Thanks a lot! That approach does mimic the original code, but it ends up breaking the other procedures. I really appreciate your help so far, and I’d be grateful if you could stick with me to sort this out too.

Here is an example

PS1 := {df(z,n=1)*df(y,n=1)*df(y,n=2)+3*df(x,n=2), df(z,n=1)*df(y,n=2)+6*x*y,x*df(y,n=1)-2*df(x,n=2)*y};

I need to extract only the base variables. When I use indets(PS1), I get {x, y, y', z', x", y"}, but I need only {x, y, z}. Is there an easy way to do that?

@nm Many thanks.   That result comes from a package written in 1996, so that expression was likely valid at the time. I am trying to update the functions with minimal effort, which means making as few changes as possible to the original code. Somehow, the author was able to use ' as a time derivative. Below is an excerpt from the help file that comes with the package.

with(dcharsets):
X := [t,x,y,z]; depend(X):

y*z*df(z^2+y)*df(y,2)+6*df(x,4)*y^2;    yields

y*z*(2*z*z'+y')*y''+6*y^2*x''''

To my understanding, z′, y′, y′′, and x′′′′ become new indeterminates in the polynomial elimination problem. depend and df are fucntions of the package.  df calls ddf shown above in the question.  

Since there are over 30 functions in the package and that notation is necessary for further calculations, I wonder if there is a way to make this notation valid in the new version of Maple, as it was back in 1996.

Here is one solution. 
 

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):
	 qs := [op(ps),'cat(`@z`,j)*js[j]-1' $ ('j' = 1 .. nops(js))];print("qs = ",%):
         zz := ['cat(`@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:

The error that comes out is deu to another problem.

 

@Rouben Rostamian  Many thanks. I followed your earlier instructions. At the end of the file, instead of guessing the variables, I included a SaveAll function (I believe @Carl Love is the author—the procedure follows after the text). After running make -f Makefile, a charsets.m file was created. In a Maple session, I executed read("charsets.m"); and then with(charsets); and this was the output:

with(charsets);
                 [cfactor, charser, charset, csolve, ecs, eics, ics, iniset, ivd, mcharset, mcs, mecs, pid, qics, remset, triser]

Although the source file contains many more defined procedures, how could the author determine which procedures are available and which are local? 

When I tried to use a function of the package with the given example but  I run into trouble.  Then I commented the last few lines (save, load help ...) and loaded the package again. 

read("charsets.txt");
with(charsets);
                 [cfactor, charser, charset, csolve, ecs, eics, ics, iniset, ivd, mcharset, mcs, mecs, pid, qics, remset, triser]
PS := [x1*x3-3*x2-1, -2*x4*x1-x3*x2*x4+2*x3, x2*x4^2-x4*x1+x3]:
charser(PS,[x1,x2,x3,x4]); 

But again it did not return the answer given by the author. 
 

Some questions:

  1. Why does the author use charsets/index := proc(...) ... end proc;? Wouldn't it be better to write a module with the functions instead?

  2. Some functions contain the statement options remember, system;. Would that cause any issues when converting to a module?

  3. The author defined several procedures with names that clash with standard Maple procedures. Sometimes he uses the standard functions, and other times he does not. Would this also be a problem?

  4. The author uses statements like "global charsets/@qs, charsets/@fact". What does this mean? Is there an alternative approach in newer releases?

  5. The help file as it is can not be loaded into Maple 2024, correct? 

 

@Rouben Rostamian  Many thanks.  My ifst impression is that DifferentialPrem won't meet my needs, but I'll try a copule of examples to see how it goes.  
As for 2) here is the link: Charsets 

@acer Thank you for adding the details that you would eventually ask here in the forum.

[edit] Something odd is going on with this site. Yesterday, I could not send my reply to both of you since the site was down. I had the distinct impression that Carl answered first, hence my vote for his answer. Please tell me if I am wrong, and I will change it.

 

@Carl Love Many thanks. As usual, your answers are very clear and detailed. Thank you for your patience and help.

@acer Thank you very much for the thorough explanation. That was what I had in mind but I had no clue that freeze and thaw were available.    

@acer Many thanks.  Would you mind explaining what freeze does and why it is necessary?  

@ecterrab 

Thank you ever so much. Your explanation shed more light on a subject that I had been away from for decades.

Would you mind sharing your thoughts on the following PDE, based on what you wrote earlier, please?

PDE:=(sin(w)*alpha*b + alpha*y)*diff(H(x, y, z, w), x) + (x + z - b*sin(w))*diff(H(x, y, z, w), y) - c*y*diff(H(x, y, z, w), z) + (d*(y - x) + Gamma*y)*diff(H(x, y, z, w), w) = 0

My attempt by hand to find H led me to a quadratic function on x, y and z and a cos(w) that is almost a solution. 

@mmcdara Sorry for a late reply but I need to go through the material you sent me.  Thank you very much.

I already have the set of ODEs that was used to build the PDE.   What I need is the expression of u(x,y,v,w), which seems impossible to obtain in this case. (But your answer helped me gain insight into another problem). 

@mmcdara Thank you very much for the thorough explanation. The actual values for the parameters are {7, 1/10, 171/20, 1/10}. I have some questions, but I don't think sending them here is appropriate since they are mostly not Maple-related. If I may, I would like to contact you directly.

@ecterrab Many thanks.  One go is just what i need.   

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