Ronan

1311 Reputation

14 Badges

12 years, 313 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are replies submitted by Ronan

@acer I never knew about that. Very nice.

@Christopher2222  Ahh... forgot about that.

@nm I juszt left the pc idle for 15-20mins. All the top row icons have disappeared. Just checked the screen saver which is set to 20mins. That app made maple go completly blank. 

  I have been having similar dissapearing of icons this evening. Moving the cursor across them gets most back, Also grab the Maple window and shake it. The seem to force a screen refresh.

Using Windows 10 and Nvidia P2000 card. Drivers are up to date. This is a Maple specific problem.

@Christopher2222 Thanks for letting me know.

@Christopher2222 I never thought of trying that before. Alas. Both the 2022 and 2021 programming guide are actually the 2020  guide.  So, hopefully soon.

  Look in the Resource Monitor and see if one of the mserver.exe processes reports Not Responding. 

@sursumCorda  That really helps.Works very well. Rather tricky.

@vv Thank you. That is what I needed and it automatically reduces the coefficients of the conic.

@tomleslie I definately should use the geometry package more often.

As an aside my conic was very slow to plot I presume due to the coefficients. do can map,gcd coeffs be simply used to do this.

I did this but it,s not nice, though it speeded up plotting.

c := 3879333*(x + (2515*y)/846 - 305/423)*(x + (556007*y)/45855 + 285532/45855)/17417452 + 400869*(x - (19921*y)/882 - 18785/882)*(x + (65165*y)/23634 - 4636/11817)/3349510;
         3879333  /    2515     305\ /    556007     285532\
    c := -------- |x + ---- y - ---| |x + ------ y + ------|
         17417452 \    846      423/ \    45855      45855 /

         400869  /    19921     18785\ /    65165     4636 \
       + ------- |x - ----- y - -----| |x + ----- y - -----|
         3349510 \     882       882 / \    23634     11817/


c := expand(numer(c));
                2                              2              
 c := 59638518 x  + 172369863 x y + 100205640 y  - 238554072 x

    - 660468303 y


L := coeffs(expand(c));
  L := 59638518, 172369863, 100205640, -238554072, -660468303

c := c/gcd(gcd(gcd(gcd(L[1], L[2]), L[3]), L[4]), L[5]);
                 2                    2                  
       c := 738 x  + 2133 x y + 1240 y  - 2952 x - 8173 y




 

@Mac Dude  Thank you for answering. I see how yor advice works now.  Is you print statement for debugging purposes? 

Edit:-

I would be interested in having a print feature that runs when the package is loaded the gives the global varables that can be set.

@dharr I hacked the code around to follow your advice and have the package basically functioning now.

What should I do with ModuleUnload? Is that important? At present it is giving errors in Cmaple.exe

Warning, Exception in unload function 'ModuleUnload': Error, `TT` does not
evaluate to a module
Warning, Exception in unload function 'ModuleUnload': Error, cannot determine if

Also when I read in the Rat..Trig.mpl I get a list of warnings about the Types being overwritten. Not a problem when I load/run the package though.

Below is the ModuleLoad and ModuleUnload code. (Not tidiied up yet)

ModuleLoad:= proc()
uses TT= TypeTools;
global _T1, _T2L, _T2V, _T2VR, _T3L, _T3V, _T3VC, _T3VR, _T4L, _MyType,GeomClr,Prntmsg, prjpsn;
          GeomClr:="Blue";
          Prntmsg:="y";
          prjpsn:=3;

local 
     MyTypes:= {_T1, _T2L, _T2V, _T2VR, _T3L, _T3V, _T3VC, _T3VR, _T4L},
     AllMyTypes:= MyTypes union {_MyType};
     print(AllMyTypes);

     # ModuleUnload:= proc()
     #local T;
       #   for T in AllMyTypes do if TT:-Exists(T) then TT:-RemoveType(T) end if; end do;
        #  return
     #end proc;

    # ModuleLoad:= proc()
     #local
       #   g, #iterator over module globals
       #   e
     #;
          
         # ModuleUnload();
          #op([2,6], ...) of a module is its globals.
          #for g in op([2,6], thismodule) do
            #   e:= eval(g);
               #print("e",e);
             #  if g <> e and e in AllMyTypes then
                 #   error "The name %1 must be globally available.", g
              # end if
         # end do;
          TT:-AddType(_T1, algebraic);
          TT:-AddType(_T2V, 'Vector(2, algebraic)');
          TT:-AddType(_T2VR, 'Vector[row](2, algebraic)');
          TT:-AddType(_T2L, [algebraic $ 2]);
          TT:-AddType(_T3V, 'Vector(3, algebraic)');
          TT:-AddType(_T3VC, 'Vector[column](3, algebraic)');
          TT:-AddType(_T3VR, 'Vector[row](3, algebraic)');
          TT:-AddType(_T3L, [algebraic $ 3]);
          TT:-AddType(_T4L, [algebraic $ 4]);
          TT:-AddType(_MyType, MyTypes);
          return
     end proc;
 ModuleUnload:= proc()
 uses TT= TypeTools;
     local T;
          for T in AllMyTypes do if Exists(T) then RemoveType(T) end if; end do;
          return
     end proc;

 

@dharr  I don't really understand the structure. Do you mean comment out "MyModule:= module() and it's   end module" and insert it all in ModuleLoad?

#MyModule:= module()
ModuleLoad:= proc()
uses TT= TypeTools;
global _T1, _T2L, _T2V, _T2VR, _T3L, _T3V, _T3VC, _T3VR, _T4L, _MyType,GeomClr,Prntmsg, prjpsn;
          GeomClr:="Blue";
          Prntmsg:="y";
          prjpsn:=3;

local
     MyTypes:= {_T1, _T2L, _T2V, _T2VR, _T3L, _T3V, _T3VC, _T3VR, _T4L},
     AllMyTypes:= MyTypes union {_MyType},
     ModuleLoad,
      ModuleUnload:= proc()
     local T;
          for T in AllMyTypes do if TT:-Exists(T) then TT:-RemoveType(T) end if; end do;
          return
     end proc;

    # ModuleLoad:= proc()
     local
          g, #iterator over module globals
          e
     ;
          
          ModuleUnload();
          #op([2,6], ...) of a module is its globals.
          for g in op([2,6], thismodule) do
               e:= eval(g);
               #print("e",e);
               if g <> e and e in AllMyTypes then
                    error "The name %1 must be globally available.", g
               end if
          end do;
          TT:-AddType(_T1, algebraic);
          TT:-AddType(_T2V, 'Vector(2, algebraic)');
          TT:-AddType(_T2VR, 'Vector[row](2, algebraic)');
          TT:-AddType(_T2L, [algebraic $ 2]);
          TT:-AddType(_T3V, 'Vector(3, algebraic)');
          TT:-AddType(_T3VC, 'Vector[column](3, algebraic)');
          TT:-AddType(_T3VR, 'Vector[row](3, algebraic)');
          TT:-AddType(_T3L, [algebraic $ 3]);
          TT:-AddType(_T4L, [algebraic $ 4]);
          TT:-AddType(_MyType, MyTypes);
          return
     end proc;
export
     WhichMyType:= proc(X)
     local S:= select(T-> X::T, MyTypes), n:= nops(S);
         printf("%a is ", X);
         if n=0 then printf("not any of the special types.\n")
         else printf("type %a.\n", `if`(n=1, S[], Amd(S[])))
         fi
      end proc;
export    
     Dsp:= proc(msg:=" empty",prnt:=Prntmsg )
          if prnt = "y" then print(msg); end if;
     end proc;

     ModuleLoad()    
    # end module;

 

@dharr The types are used in many of the modules. I just didn't include them here. Scoping could be the issue. I had a scoping problem back in December when I was last looking at this. I will check it out tonight.

@dharr I see. So i tried something probably dangerous so I could apply a series of mutations from a list.

L:=[w,y,w,y,w,y]
                    L := [w, y, w, y, w, y]

newPopvs:=[Px,Py,Pz,Pw]:
for i in L do
newPopvs:=Mutate1(i,newPopvs);
end do
                        [Px, Py, Pz, Pw]

 

First 10 11 12 13 14 15 16 Last Page 12 of 31