Ronan

1401 Reputation

16 Badges

14 years, 29 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are replies submitted by Ronan

@acer That is exactly what I was trying to achieve with the test proc. It is to differentiate between types of inputs. I have a rather large procedure for creating lines and planes with optional parallel or perpendicular lines through a point. But the procedure will not run outside of the package. I have been trying to make it more efficient.  Attached a pdf of the help page for it just to give you an idea of what it does. In the meantime this evening I figured out a variation of what you have done. Yours is far neater though.

l2::{satisfies(s->`ifelse`((type(s,`=`) and not(type(rhs(s),list))),true,false )  or type(s,`+`) or type(s,`*`) or type(s,symbol) or type(s,procedure))})   

Help_Lines_and_Plane.pdf

@acer  I had another typo from editing the module. It works now. The additional question didn't arise untill I considered how I would approach changing the basic approached I took in the RationalTrigonometry pagkage which has about 60 procedures in it. Thank you for you help.

@acer Sorry. I meant I renamed the TM to TestModule and then tried using TM:-Cartvars:=Cartvars inside it instead of TestModule:-Cartvars:=Cartvars  for example

The real package is called RationalTrigonometry.  inside that I want to use RT:-Cartvars:=Cartvars  instead of RationalTrigonometry:-Cartvars:=Cartvars  if possible.

@acer Oh that is nicer. Off hand I dont know if I need to see some locals but it could be useful. So that would be good to see how.

One other question the arises from this. This moduel is TM. so TM:-Cartvars is ok. The real package is called RaionalTrigonometry. Is there a way at the start of the package  to set TM = RationalTrigonometry

I have tried in this case changing to TestModule then trying to apply TM=TestModule. via uses, alias and macro but to no avail.

@acer Rereading my question, I didn't explain myself at all correctly/clearly. You acutally answered this in late 2024 Global and local in module - MaplePrimes . Then I didn't see how to apply it elsewhere. So if I setup a Settings export procedure that is much better practice. With the settings command my aim is to

1) maintain current spelling throughout where possible.

2) each setting in an optional input
To do this, I have had to use some dummy inputs "a::0", "b::0"    and "a::1"   Is there a better way than this?

I have added a couple of extra defaults for testing putposes. In reality I have about 15 global settings. 

restart;

kernelopts(version);

`Maple 2026.0, X86 64 WINDOWS, Mar 05 2026, Build ID 2001916`

(1)

TM := module()
  export Cartline,Parmline,Settings;
  local Cartvars,Parmvars,GeomClr,Prntmsg;
  Cartvars := [:-x,:-y,:-z];  
  Parmvars := [:-alpha,:-beta,:-rho];
  GeomClr := "Blue";
  Prntmsg := true;

  Settings :=overload([
                    proc(a::0,b::0,
                         {Cartvars::list:=TM:-Cartvars},
                         {Parmvars::list:=TM:-Parmvars},
                         {GeomClr::string:=TM:-GeomClr},
                         info::boolean:=TM:-Prntmsg)
                    option overload;
                       TM:-Cartvars:=Cartvars;
                       TM:-Parmvars:=Parmvars;
                       TM:-GeomClr:=GeomClr;
                       TM:-Prntmsg:=info;
                       #TM:-Settings(1);
                      return NULL
                   end proc,
                   proc(a::1,$)
                    option overload;
                       print("current setting");
                        print("Cartvars ",TM:-Cartvars);
                        print("Parmvars ",TM:-Parmvars);
                        print("GeomClr ",TM:-GeomClr);
                        print("Prntmsg ",TM:-Prntmsg);
                  end proc
                   ]);

  Cartline := proc(p1::list,p2::list,{vars::list:=TM:-Cartvars},Prntmsg:=TM:-Prntmsg)
    local l;
    l := (p2[2]-p1[2])*vars[1]+(p1[1]-p2[1])*vars[2]
         -p2[2]*p1[1]+p1[2]*p2[1];
    if Prntmsg then print("Cartesian line format"); end if;
    return l;
  end proc;

  Parmline := proc(p1::list,p2::list,{varp:=TM:-Parmvars},Prntmsg:=TM:-Prntmsg)
    local l;
    l := p1+~varp[1]*<p2-p1>;
    if Prntmsg then print("Parametric line format"); end if;
    return l;
  end proc;
end module:

 

TM:-Cartline([4,3],[-8,4]);

"Cartesian line format"

 

x+12*y-40

(2)

TM:-Cartline([4,3],[-8,4],vars=[s,t],false);

s+12*t-40

(3)

TM:-Parmline([4,3],[-8,4]);

"Parametric line format"

 

Vector[column](%id = 36893489586312503772)

(4)

TM:-Parmline([4,3],[-8,4],varp=[Lambda]);

"Parametric line format"

 

Vector[column](%id = 36893489586312506172)

(5)

TM:-Settings(1)

"current setting"

 

"Cartvars ", [x, y, z]

 

"Parmvars ", [alpha, beta, rho]

 

"GeomClr ", "Blue"

 

"Prntmsg ", true

(6)

TM:-Settings(0,0,Cartvars=[X,Y,Z],false)

TM:-Settings(1)

"current setting"

 

"Cartvars ", [X, Y, Z]

 

"Parmvars ", [varkappa, vartheta, sigma]

 

"GeomClr ", "Blue"

 

"Prntmsg ", false

(7)

TM:-Cartline([4,3],[-8,4]);

X+12*Y-40

(8)

TM:-Cartline([4,3],[-8,4],true);

"Cartesian line format"

 

X+12*Y-40

(9)

TM:-Settings(0,0,Parmvars=[varkappa,vartheta,sigma],true,Cartvars=[A,B,C])

TM:-Settings(1)

"current setting"

 

"Cartvars ", [A, B, C]

 

"Parmvars ", [varkappa, vartheta, sigma]

 

"GeomClr ", "Blue"

 

"Prntmsg ", true

(10)

Download 2026-03-27_Q_Module_Generic_Variables_ac-R1.mw

@acer Thank you. Late last night I found another way. Which is what I what to achieve. Could you comment on potential pitfalls incase I am missing something.

restart

interface(version)

`Standard Worksheet Interface, Maple 2026.0, Windows 10, March 05 2026 Build ID 2001916`

(1)

TM := module () export Cartline, Parmline; global Cartvars, Parmvars;  Cartvars := [:-x, :-y, :-z]; Parmvars := [:-alpha, :-beta, :-rho]; Cartline := proc (p1::list, p2::list, { vars := Cartvars }) local l; global Cartvars; l := (p2[2]-p1[2])*vars[1]+(p1[1]-p2[1])*vars[2]-p2[2]*p1[1]+p1[2]*p2[1]; return l end proc; Parmline := proc (p1::list, p2::list, { varp := Parmvars }) local l; global Parmvars; l := `~`[`+`](p1, varp[1]*`<,>`(p2-p1)); return l end proc end module

maplemint(TM)

TM:-Cartline([4, 3], [-8, 4])

x+12*y-40

(2)

TM:-Cartline([4, 3], [-8, 4], vars = [x, y])

x+12*y-40

(3)

NULL

TM:-Parmline([4, 3], [-8, 4])

Vector[column](%id = 36893490302681822020)

(4)

TM:-Parmline([4, 3], [-8, 4], varp = [kappa])

Vector[column](%id = 36893490302722994652)

(5)

Change globally 

Cartvars := [X, Y, Z]; Parmvars := [eta, mu, nu]

[eta, mu, nu]

(6)

TM:-Cartline([4, 3], [-8, 4])

X+12*Y-40

(7)

TM:-Cartline([4, 3], [-8, 4], vars = [r, s])

r+12*s-40

(8)

TM:-Parmline([4, 3], [-8, 4])

Vector[column](%id = 36893490302722985724)

(9)

NULL

Download 2026-03-26_Q_Module_Generic_Variables-R1.mw

Can you see where the shortcut points to for the "old/former" interface.  The see if you can find a similat executable in the Maple 2026 folders.

Edit:- for windows 10 you can probe the shortcuts in the start menu from here.

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Maple 2024

@dharr  @sand15  Thank you. Bothe answere are very helpful. And I like the link to @acer  comment.

I am getting the same error. What browser are you using? I am using edge on win10 & 11.

I have also noticed the site has been wery slow and hangs a lot since at least mid December. Has anyony else being experiencing this?

edit:- I get this message a lot

@minhthien2016  Like this

sort((x - 1)^2 + (y + 4)^2 + (z - 3)^2 - 56 = 0, [x, y, z])
(x - 1)^2 + (y + 4)^2 + (z - 3)^2 - 56 = 0

Would this help?

with(CurveFitting);

   [ArrayInterpolation, BSpline, BSplineCurve, Interactive, 
     LeastSquares, Lowess, PolynomialInterpolation, 
     RationalInterpolation, Spline, ThieleInterpolation]

@sand15 I see you are using an older version of Maple. In2024.2 this is the processing time.

memory used=69.41MiB, alloc change=0 bytes, cpu time=687.00ms, real time=745.00ms, gc time=0ns

You might get some help from the official Solidworks site or Cadmunity CADmunity 

@salim-barzani Thank you. I appreciate the acknowledgement.

  If an answer is liked/voted up by the OP, how about an astricks or some symbol appear automatically or the color change to say light blue for each answer liked by the Op.

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