Carl Love

Carl Love

28025 Reputation

25 Badges

12 years, 311 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@emendes Interesting.... I suspect a bug in Threads. Could you send me (either email or post here) the file that contains the lists of sets A and B for this? I don't think that there's any hope of finishing the computation on my small computer; I just want to see if I can get a strange error. I hope that you can send me a file that contains only two lists of sets that I can read in with the read command.

@aoakindele Simply change your dsolve command to

sol1[k]:= dsolve(eval(odeSys union bcs1, pList), numeric, method= bvp[midrich]);

@emendes By "kernel panic" do you mean "kernel connection lost" (which usually means simply the death of the kernel)?

And by changing that one line of code as shown did you avoid the kernel problem (for the larger problem, on the server)? If so, that's very interesting and must be reported as a bug, and I'd like to see what happens if you keep the original code but don't make any kernelopts adjustment.

The code that you showed indicates that

L:= CodeTools:-Usage(SubsetPairsSparseThreaded(pair[1], pair[2])):

would work equivalently to your parse/sprintf formulation, regardless of whether pair comes from a file.

 

 

@nm You wrote:

  • But your second choice is not type equation. Maple says it is type expression sequence. 

I don't know why that makes any difference to you. In the body of your code, you can process like this:

if ic::`=` then  #ic is an equation.
   
...
else  #ic is NULL.
   
...
fi;

Also, as I've mentioned a few times before, I think that an initial condition should be declared type function(algebraic)=algebraic rather than simply type `=`.
 

@nm A null equation is indeed a valid equation; you can enter it as NULL=NULL or ()=(). Thus,

foo:= proc(..., {ic::`=`:= ()=()}) ....

However, I'd rather let NULL itself be both an allowed value and a default value. You'd do that like

foo:= proc(..., {ic::{`=`, identical()}:= ()}) ....


Footnote: In most cases (not all cases), the syntax allows NULL to be replaced with () or even just empty space. It's my preference to do this when it's allowed. The above line of code could be 

foo:= proc(..., {ic::{`=`, identical(NULL)}:= NULL}) ....

However, NULL is not identically the same thing as () because NULL is a name that must be dereferenced to obtain the value (). Using () in the first place avoids this step.

@nm Make the keyword parameter's type and default value as shown in the title of this Reply.

@emendes 

Why did you change my code? Are you using an older version of Maple which doesn't support embedded for loops? Don't you have Maple 2020 on some machine? My experience so far is that embedded for loops work better than seq. Why are you using a machine with only 4 processors? Don't you have one with 32 processors? That's where I believe you'll experience the great benefit of the threaded code. Why do you use parse/sprintf

Answers: Both your questions have the same answer: The return value of kernelopts(option= valueis the previous value of kernelopts(option).

Does the threaded version perform up to your expectations for your larger examples when run on your larger machine?

@Carl Love I just reran the Lie solution, and now I got something completely different! (I'm sorry about the plaintext format below. MaplePrimes doesn't let me display worksheets.)

restart;
dsolve(x^3*diff(y(x),x)^2+x*diff(y(x),x)-y(x) = 0,y(x),'Lie');
        1  /      /      24           21            18
y(x) = --- \RootOf\_C1 _Z   + 8 _C1 _Z   + 16 _C1 _Z  
       4 x                                            

              15             12             9             6
   - 32 _C1 _Z   - 160 _C1 _Z   - 128 _C1 _Z  + 256 _C1 _Z 

               3        4          \   /      /      24
   + 512 _C1 _Z  - 256 x  + 256 _C1/^3 \RootOf\_C1 _Z  

             21            18            15             12
   + 8 _C1 _Z   + 16 _C1 _Z   - 32 _C1 _Z   - 160 _C1 _Z  

               9             6             3        4          \ 
   - 128 _C1 _Z  + 256 _C1 _Z  + 512 _C1 _Z  - 256 x  + 256 _C1/^

       \\  
  3 - 2//, 

                                     (1/3)                    
      (4/3) /                  (1/2)\                    (1/2)
  y(x)      \1 + (1 + 4 x y(x))     /      (1 + 4 x y(x))     
  ------------------------------------------------------------
                             (1/3)                            
   /                   (1/2)\      /              (1/2)    \  
   \-1 + (1 + 4 x y(x))     /      \(1 + 4 x y(x))      + 3/  

                                                 (1/3)        
                  (4/3) /                  (1/2)\             
            3 y(x)      \1 + (1 + 4 x y(x))     /             
   - ---------------------------------------------------------
                               (1/3)                          
     /                   (1/2)\      /              (1/2)    \
     \-1 + (1 + 4 x y(x))     /      \(1 + 4 x y(x))      + 3/

   - 

                                       (1/3)                    
        (1/3) /                  (1/2)\                    (1/2)
  2 y(x)      \1 + (1 + 4 x y(x))     /      (1 + 4 x y(x))     
  --------------------------------------------------------------
                             (1/3)                              
   /                   (1/2)\      /              (1/2)    \    
   \-1 + (1 + 4 x y(x))     /      \(1 + 4 x y(x))      + 3/ x  

                                                  (1/3)         
                   (1/3) /                  (1/2)\              
             6 y(x)      \1 + (1 + 4 x y(x))     /              
   + -----------------------------------------------------------
                               (1/3)                            
     /                   (1/2)\      /              (1/2)    \  
     \-1 + (1 + 4 x y(x))     /      \(1 + 4 x y(x))      + 3/ x

   - _C1 = 0


 

The Lie soluton is a bit uglier to me than the implicit one in that it contains the square of a degree-8 RootOf. It's not horrible though. 

 

@Preben Alsholm Vote up. This was also my immediate first guess for something worth trying. So it's probably worth trying in any case where the solve returns explicit solutions (i.e., without RootOf).

@ecterrab Thus, it follows that a likely next thing to try is dsolve(..., implicit), and indeed that works.

This is the appropriate place to discuss MaplePrimes problems. That's why there's a "MaplePrimes" entry in the Question-header "Product" check boxes. 

Additional details: I have two computers---both Windows 10, but different versions---and I have this problem on both. For both, the browser I use for posting is Google Chrome.

@nm If your guess is correct, then I've been extraordinarily unlucky. Like I said, I haven't been able to display any worksheet at all for about a year although I've tried many times.

@Ronan The approach that you show is a last resort for infinite sums for which evalf won't work. Vv's Answer shows that that isn't the case here.

Vote up. But due to the presence of LinearAlgebra in your title, I'd like to clarify something that may not be obvious to all readers: Your examples display the same (whether via Latex or GUI) regardless of whether they are created with LinearAlgebra. Indeed, many users have the false impression that LinearAlgebra is required to use Vector or Matrix. No, those are top-level commands.

First 144 145 146 147 148 149 150 Last Page 146 of 708