emendes

370 Reputation

6 Badges

6 years, 162 days

MaplePrimes Activity


These are replies submitted by emendes

@Carl Love Many many thanks.   I have checked the help file on anames and there is nothing that explicitly mention procedure there. It would be helpful if Maple included it there.  

@dharr As I said in my first post to this question,  I use Grid, solve, simplify and subs extensively. What I noticed was that if there is at least one cpu running at 100%, there is a chance that the calculations will end eventually. However if no cpu is at 100%, it is a bug for sure.   I constantly run something overnight or even for days.  

@nm Sorry for taking so long to post the results.  I tried with 300, 500 and 700 and time results were 25896.743, 22570.095 and 24704.806 respectively.  In all the runs the output was always "Timed out OK".  

Now I will try with 2000 and see what happens.   I forgot to mention that I am using Maple 2021.2 for mac intel.   

@nm First of all thanks for posting such a question.   I must confess I don't understand how timelimit actually works.  In the example you sent my old mac had no problem to run the code: "Time out ok" in 120.736 (quite close to twice the estipulated time) . However when I use timelimit with subs, simplify and solve alongside Grid:-Map or Grid:-Seq, I have no idea how it behaves.  I have one example that runs solve 11165 times with timelimit set to 5.   I am not sure the calculations will end since it has been running for more than a day (Grid:Seq sent out "done sending all partitations" last night).  What seems odd to me is that none of the cpus are at 100%, at least one of them should.   In another example,  Maple has been running for a week (at least in this case I see that one cpu is running at 100% all the time).

(!) never worked for me in the examples I have.   The only solution is "Quit Maple 2022" or "Force quit".   

Finally, I totally agree with what you said in the last two paragraphs.   

@Joe Riel Many thanks.   How about the use of  any Grid procedure ( in a user made procedure) within a module.  Can it be done?  And how?  As said I have tried to do it but without success.  

@Joe Riel Many thanks.  I tested your solution on a large set and works just fine.   

Why don't I need to issue Grid:-Set(CleanExpr,'coefmodel') in this case?   I thought I had to issue Grid-Set for all new procedures and variables used in them.  I use Grid:-Map extensively and if I am not careful to define all procedures and variables using Grid:-Set, Maple complains and aborts the calculations.   

I have also tried to put all Grid:-Map procedures in a module but Maple complains as if I didn't issue Grid:-Set at all (I tried to place Grid:-Set inside and outside of the module but to no avail).   

In what follows the first set of  " ... should like to see" is copied from the one sent last year.  

My wish has to do with Grid and Threads packages:

1) Efficient usage of memory -   Once a grid command finishes the memory allocated should return to Maple (I am not sure whether this is possible or not). There is a post in the list showing that, in some calculations using Grid, Maple hangs for no apparent reason.

2) A clear explanation in the help files (examples) on which variables should be Grid:-Set and which don't.  (Although I have received help from top users on the list and from maple support, the answers are not the same in some cases).

3) CodeTools:-ThreadSafetyCheck - Some of the functions that are threadsafe checked by this command cause Maple to hang.  Is the list of threadsafe functions updated?  

Timelimit

1) Once the time to finish is set, maple will terminate the operation no matter what.

@acer Thank you.   I don't know how I miss that but I did.  No excuse.   

@Rouben Rostamian  No problem.  Thanks for the help.

@Carl Love Many thanks.  Below is a piece of code without alias that sends out a result.  It is not elegant, does not use the Physics package (the notation is beyond my understanding)  and the result is not in the form I want (z2=Grad(F_1).F).

 

restart:
#alias(x=x(t),y=y(t),f1=f1(x(t),y(t)),f2=f2(x(t),y(t))):
F:=[f1(x(t),y(t)),f2(x(t),y(t))];
phi:=[x(t),phi1(x(t),y(t))];
sys:=[diff(x(t),t)=F[1],diff(y(t),t)=F[2]];
vars:=[diff(x(t),t),diff(y(t),t)];
             F := [f1(x(t), y(t)), f2(x(t), y(t))]

                phi := [x(t), phi1(x(t), y(t))]

        [ d                          d                       ]
 sys := [--- x(t) = f1(x(t), y(t)), --- y(t) = f2(x(t), y(t))]
        [ dt                         dt                      ]

                          [ d         d      ]
                  vars := [--- x(t), --- y(t)]
                          [ dt        dt     ]

s1:=convert(op(solve(sys,vars)),list):map(print,s1):
                    d                       
                   --- x(t) = f1(x(t), y(t))
                    dt                      

                    d                       
                   --- y(t) = f2(x(t), y(t))
                    dt                      

s2aux:=map(w->diff(w,t),s1):
s2:=map(w->lhs(w)=simplify(subs(s1,rhs(w))),s2aux):map(print,s2):
          2                                            
         d                                             
        ---- x(t) = D[1](f1)(x(t), y(t)) f1(x(t), y(t))
           2                                           
         dt                                            

           + D[2](f1)(x(t), y(t)) f2(x(t), y(t))


          2                                            
         d                                             
        ---- y(t) = D[1](f2)(x(t), y(t)) f1(x(t), y(t))
           2                                           
         dt                                            

           + D[2](f2)(x(t), y(t)) f2(x(t), y(t))


z__1:=rhs(s1[1]);   #  d(Lf(x))/dt = F[1]   
z__2:=rhs(s2[1]);   #  d(Lf(Lf(x)))/dt = Grad(F[1]).F
                     z__1 := f1(x(t), y(t))

          z__2 := D[1](f1)(x(t), y(t)) f1(x(t), y(t))

             + D[2](f1)(x(t), y(t)) f2(x(t), y(t))



 

@Rouben Rostamian  Many thanks for the quick answer. 

 

I need further help to understand how the package works.  In the example below (pseudocode) I did all the calculations by going back or forward to avoid the time dependence and I wonder whether the Physics package will do the same elegantly. 

f:=[f1(x(t),y(t),f2(x(t),y(t)];
sys:={diff(x,t)=f[1],diff(y,t)=f[2]);
newsys:=subs({x=phi[1],y=phi[2]},sys);  # A transformation of Coordinates - Can we use the Physics package here?
# And another transformation of coordinates
z__1:=x;
z__2   # Lf(z__1) - Lie derivative of z__1 in f
z__3  # Lf(z__2) 
.....

Many thanks

 

@Carl Love and @mmcdara Many thanks.   

@Carl Love I remember reading in one of your answers only one of the time outputs of Usage matters when using Grid or Threads but I don't remember which one.  Could you remind me?

I did not have time to run a memory demanding example but a small (not that small) example showed me that Carl's solution is blazing fast.   

@Carl Love Since your solution is very concise, could you be so kind to open it up to show the details (curry, splitranks,..)?  

 

 

 

@Carl Love Many thanks.   Before reading your reply I tried exactly what you suggested (first option) and it worked.   

@tomleslie Many thanks.   Grid:-Set(UtilsIORelation) did the trick for removing the error message.  Now I have to check how to deal with the other issues.  

@Carl Love Many thanks.  I have just sent you an email with a link to the file with only two variables (parms10 and parms11).  

The Grid version of my procedure is running so far without any problem.   I hope Grid does not choke (as it does in other calculations for no reason).  

 

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