Ronan

772 Reputation

14 Badges

10 years, 326 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are replies submitted by Ronan

@acer Thank you. Maple could make the hyper insertion box select a bit more general. Shall study those links tonight.

@dharr  Oh mine ".ggb" opened with Geogebra fine. Also tested a PDF which opened with Adobe too. Thanks for the explination.

 

@dharr Thank you. This works fine for me.  file://localhost\C:\Users\Ronan\Documents\GeoGebra\UHG 4.ggb

but file:\\localhost\C:;\Users\.......   forces to  http://file:\\localhost\C:\Users\Ronan\Documents\GeoGebra\UHG 4.ggb which does not work.

I notice you used all forward slashes "/ " which also work. 

Is there a particular rule on the use of  \ and / in directory and file naming. I know I have had problems  on this before with Maple and library's

@acer Ideally I would like the link to open the file in geogebra,  or for the sake of the principle, open a MS Office file with Word, Excel, etc.

@Carl Love Yes, I do understand. I appreciate you help. I was wandering around trying different things.Easy miss the typos doing that.  That is what I was trying to communicate. 

@Carl Love Yes. I had tried the sequence of strings which worked in one test. Then when I hit problem I thought it might be the commands.  Yes I was trying the unevaluation quotes too. Just my bad typing.

@tomleslie  Thank you. The Isee came about because sometimes I want to use one of my routines from inside a package to answer a question here. showstat puts in line numbers and Describe doesnt normally give the whole procedure

Make it easy to copy and paste.

Isee(CrossingNumber);
proc(A::list, B::list, C::list, E::list)
    local s1, s2, s3, s4;
    description " Determines if AB crosses CE.   Returns 1 or -1 if cros\
    ses, 0 if does not cross or undefined if alined";
    s1 := RonanRoutines:-SignedArea(A, B, C);
    s2 := RonanRoutines:-SignedArea(A, B, E);
    s3 := RonanRoutines:-SignedArea(C, E, B);
    s4 := RonanRoutines:-SignedArea(C, E, A);
    if s1 = 0 and s2 = 0 and s3 = 0 and s4 = 0 then
        'undefined';
    elif 0 <= signum(s1) and signum(s2) <= 0 then
        if 0 <= signum(s3) and signum(s4) <= 0 then -1; end if;
    elif signum(s1) <= 0 and 0 <= signum(s2) then
        if signum(s3) <= 0 and 0 <= signum(s4) then 1; end if;
    else
        0;
    end if;
end proc
showstat(CrossingNumber);

RonanRoutines:-CrossingNumber := proc(A::list, B::list, C::list, E::list)
local s1, s2, s3, s4;
   1   s1 := RonanRoutines:-SignedArea(A,B,C);
   2   s2 := RonanRoutines:-SignedArea(A,B,E);
   3   s3 := RonanRoutines:-SignedArea(C,E,B);
   4   s4 := RonanRoutines:-SignedArea(C,E,A);
   5   if s1 = 0 and s2 = 0 and s3 = 0 and s4 = 0 then
   6       'undefined'
       elif 0 <= signum(s1) and signum(s2) <= 0 then
   7       if 0 <= signum(s3) and signum(s4) <= 0 then
   8           -1
           end if
       elif signum(s1) <= 0 and 0 <= signum(s2) then
   9       if signum(s3) <= 0 and 0 <= signum(s4) then
  10           1
           end if
       else
  11       0
       end if
end proc
Describe(CrossingNumber);

#  Determines if AB crosses CE. Returns 1 or -1 if crosses, 0 if does not cross 
# or undefined if alined
s=00000289E0D8ED68, invalid component 8,3 of PROC

 

@Carl Love @acer  Thank you for your answers. I see the single row matricec can be multiplied as a cross product just the same a vectors and the answer is a vector.  I guess it would be sloppy and bad practice to use single row martices as vectors. Also when using whattype  which I am.  Are there any other obvious dangers?

This is a good thread on your question. It might give you some ideas.

Basins of attraction - MaplePrimes

@acer Thank you. I willl probably have to break it down into something more inefficient to understand what the the different components do.

@Christian Wolinski I have hilighted what I thing look odd to me

(add@map)(proc(E) ``(lcoeff(E))*normal(E/lcoeff(E)) end@add, [Q(expand(pn))]);

@Carl Love Thank you.

@Christian Wolinski  Thank you.. Idid notice the '' no idea what they do.
I had tried end proc but it is the @dd I don't get either.

 

@Christian Wolinski Thank you. That produces the lists nicely. I admit I don't understand the ListTools part of the code. Could you please explain it? I did look in the Help on it but right now don't quite get it.
  There is some error  in the last line of the code.  I presume it is intended to maintain the order of the lists under addition.


 

restart

pn := expand((a[1]+a[2]+a[3]+a[4])^5)

a[1]^5+5*a[1]^4*a[2]+5*a[1]^4*a[3]+5*a[1]^4*a[4]+10*a[1]^3*a[2]^2+20*a[1]^3*a[2]*a[3]+20*a[1]^3*a[2]*a[4]+10*a[1]^3*a[3]^2+20*a[1]^3*a[3]*a[4]+10*a[1]^3*a[4]^2+10*a[1]^2*a[2]^3+30*a[1]^2*a[2]^2*a[3]+30*a[1]^2*a[2]^2*a[4]+30*a[1]^2*a[2]*a[3]^2+60*a[1]^2*a[2]*a[3]*a[4]+30*a[1]^2*a[2]*a[4]^2+10*a[1]^2*a[3]^3+30*a[1]^2*a[3]^2*a[4]+30*a[1]^2*a[3]*a[4]^2+10*a[1]^2*a[4]^3+5*a[1]*a[2]^4+20*a[1]*a[2]^3*a[3]+20*a[1]*a[2]^3*a[4]+30*a[1]*a[2]^2*a[3]^2+60*a[1]*a[2]^2*a[3]*a[4]+30*a[1]*a[2]^2*a[4]^2+20*a[1]*a[2]*a[3]^3+60*a[1]*a[2]*a[3]^2*a[4]+60*a[1]*a[2]*a[3]*a[4]^2+20*a[1]*a[2]*a[4]^3+5*a[1]*a[3]^4+20*a[1]*a[3]^3*a[4]+30*a[1]*a[3]^2*a[4]^2+20*a[1]*a[3]*a[4]^3+5*a[1]*a[4]^4+a[2]^5+5*a[2]^4*a[3]+5*a[2]^4*a[4]+10*a[2]^3*a[3]^2+20*a[2]^3*a[3]*a[4]+10*a[2]^3*a[4]^2+10*a[2]^2*a[3]^3+30*a[2]^2*a[3]^2*a[4]+30*a[2]^2*a[3]*a[4]^2+10*a[2]^2*a[4]^3+5*a[2]*a[3]^4+20*a[2]*a[3]^3*a[4]+30*a[2]*a[3]^2*a[4]^2+20*a[2]*a[3]*a[4]^3+5*a[2]*a[4]^4+a[3]^5+5*a[3]^4*a[4]+10*a[3]^3*a[4]^2+10*a[3]^2*a[4]^3+5*a[3]*a[4]^4+a[4]^5

Q := proc (E) local X; if type(E, `+`) then X := ([op])('E') else X := ['E'] end if; ListTools:-Categorize(proc (x, y) lcoeff(x) = lcoeff(y) end proc, X) end proc

proc (E) local X; if type(E, `+`) then X := ([op])('E') else X := ['E'] end if; ListTools:-Categorize(proc (x, y) lcoeff(x) = lcoeff(y) end proc, X) end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a[3]+5*a[1]^4*a[4]+10*a[1]^3*a[2]^2+20*a[1]^3*a[2]*a[3]+20*a[1]^3*a[2]*a[4]+10*a[1]^3*a[3]^2+20*a[1]^3*a[3]*a[4]+10*a[1]^3*a[4]^2+10*a[1]^2*a[2]^3+30*a[1]^2*a[2]^2*a[3]+30*a[1]^2*a[2]^2*a[4]+30*a[1]^2*a[2]*a[3]^2+60*a[1]^2*a[2]*a[3]*a[4]+30*a[1]^2*a[2]*a[4]^2+10*a[1]^2*a[3]^3+30*a[1]^2*a[3]^2*a[4]+30*a[1]^2*a[3]*a[4]^2+10*a[1]^2*a[4]^3+5*a[1]*a[2]^4+20*a[1]*a[2]^3*a[3]+20*a[1]*a[2]^3*a[4]+30*a[1]*a[2]^2*a[3]^2+60*a[1]*a[2]^2*a[3]*a[4]+30*a[1]*a[2]^2*a[4]^2+20*a[1]*a[2]*a[3]^3+60*a[1]*a[2]*a[3]^2*a[4]+60*a[1]*a[2]*a[3]*a[4]^2+20*a[1]*a[2]*a[4]^3+5*a[1]*a[3]^4+20*a[1]*a[3]^3*a[4]+30*a[1]*a[3]^2*a[4]^2+20*a[1]*a[3]*a[4]^3+5*a[1]*a[4]^4+a[2]^5+5*a[2]^4*a[3]+5*a[2]^4*a[4]+10*a[2]^3*a[3]^2+20*a[2]^3*a[3]*a[4]+10*a[2]^3*a[4]^2+10*a[2]^2*a[3]^3+30*a[2]^2*a[3]^2*a[4]+30*a[2]^2*a[3]*a[4]^2+10*a[2]^2*a[4]^3+5*a[2]*a[3]^4+20*a[2]*a[3]^3*a[4]+30*a[2]*a[3]^2*a[4]^2+20*a[2]*a[3]*a[4]^3+5*a[2]*a[4]^4+a[3]^5+5*a[3]^4*a[4]+10*a[3]^3*a[4]^2+10*a[3]^2*a[4]^3+5*a[3]*a[4]^4+a[4]^5

"  (add@map)(proc(E) (lcoeff(E))*normal(E/lcoeff(E)) end@add, [Q(expand(pn))]);  #`some typo here end@add, Don't know how to correct at present`"

Error, invalid proc termination

"  (add@map)(proc(E) (lcoeff(E))*normal(E/lcoeff(E)) end@add, [Q(expand(pn))]);  #`some typo here end@add, Don't know how to correct at present`"

Just my experimentation

([op])(pn)

[a[1]^5, 5*a[1]^4*a[2], 5*a[1]^4*a[3], 5*a[1]^4*a[4], 10*a[1]^3*a[2]^2, 20*a[1]^3*a[2]*a[3], 20*a[1]^3*a[2]*a[4], 10*a[1]^3*a[3]^2, 20*a[1]^3*a[3]*a[4], 10*a[1]^3*a[4]^2, 10*a[1]^2*a[2]^3, 30*a[1]^2*a[2]^2*a[3], 30*a[1]^2*a[2]^2*a[4], 30*a[1]^2*a[2]*a[3]^2, 60*a[1]^2*a[2]*a[3]*a[4], 30*a[1]^2*a[2]*a[4]^2, 10*a[1]^2*a[3]^3, 30*a[1]^2*a[3]^2*a[4], 30*a[1]^2*a[3]*a[4]^2, 10*a[1]^2*a[4]^3, 5*a[1]*a[2]^4, 20*a[1]*a[2]^3*a[3], 20*a[1]*a[2]^3*a[4], 30*a[1]*a[2]^2*a[3]^2, 60*a[1]*a[2]^2*a[3]*a[4], 30*a[1]*a[2]^2*a[4]^2, 20*a[1]*a[2]*a[3]^3, 60*a[1]*a[2]*a[3]^2*a[4], 60*a[1]*a[2]*a[3]*a[4]^2, 20*a[1]*a[2]*a[4]^3, 5*a[1]*a[3]^4, 20*a[1]*a[3]^3*a[4], 30*a[1]*a[3]^2*a[4]^2, 20*a[1]*a[3]*a[4]^3, 5*a[1]*a[4]^4, a[2]^5, 5*a[2]^4*a[3], 5*a[2]^4*a[4], 10*a[2]^3*a[3]^2, 20*a[2]^3*a[3]*a[4], 10*a[2]^3*a[4]^2, 10*a[2]^2*a[3]^3, 30*a[2]^2*a[3]^2*a[4], 30*a[2]^2*a[3]*a[4]^2, 10*a[2]^2*a[4]^3, 5*a[2]*a[3]^4, 20*a[2]*a[3]^3*a[4], 30*a[2]*a[3]^2*a[4]^2, 20*a[2]*a[3]*a[4]^3, 5*a[2]*a[4]^4, a[3]^5, 5*a[3]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], 60*a[1]^2*a[2]*a[3]*a[4]}

NULL


 

Download 30-7-22_Q_sort_equation_by_numerical_coeffs_ver_2.mw

@Ronan Sorry about that! 

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