emendes

440 Reputation

6 Badges

8 years, 20 days

MaplePrimes Activity


These are replies submitted by emendes

@emendes Just an update.   I installed Maple 2023 over the weekend and the problem persists.   

@Carl Love That is weird! Maple 2002.2 on Mac M1 started freezing on Monday for no reason. Most of the time I had  to kill the process related to it.  Maple 2022.2 on Linux did not show the same problem though.  

@acer Many many thanks.   Please correct me if i am worng.  These new fancy ways open a door of  new possibilities.  Suppose I want to find the indices of a list that corresponds to elements less than 9.   Would the following command be efficient for long lists?

[for t,v in eval(T) do `if`(v<=9,t,NULL); end do];

@acer Thank you ever so much.   No problem to understand your solution.   The problem is: why I did not think of that?  If you have the time and patience, please post the fancy ways with comments.  

@Kitonum Many thanks. I think I can follow all the steps of your solution but if you think that there is something that stands out, please let me know.  

@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))



 

2 3 4 5 6 7 8 Last Page 4 of 20