Ronan

1331 Reputation

14 Badges

13 years, 41 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I use a procedure called Isee  to print to screen procedures from my packages.

However if the procedure is overloaded it Isee doesn't print it. Is there a way around this.
I have inserted screen shots to show the outputs for the package.

restart

Test:=proc(a::{vector})
print(a);
end proc;

proc (a::{vector}) print(a) end proc

(1)

Test1:=overload([ proc(a::{vector})
                  option overload;
                  print(a);
                  end proc,

                  proc(a::{Matrix})
                  option overload;
                  print(a);
                  end proc
                ])

proc () option overload; [proc (a::{vector}) option overload; print(a) end proc, proc (a::{Matrix}) option overload; print(a) end proc] end proc

(2)

Isee := proc(a)
interface(verboseproc = 3);
printf("%P", eval(a));
end proc;

proc (a) interface(verboseproc = 3); printf("%P", eval(a)) end proc

(3)

Isee(Test)

proc(a::{vector})
    print(a);
end proc

 

Isee(Test1)

proc()
    option overload;
    [proc(a::{vector}) option overload; print(a); end proc,
        proc(a::{Matrix}) option overload; print(a); end proc];
end proc

 

#with(Routines);
#

#An non overloaded procedure in a package

Isee(ConicMatrix);
#

 

                                  ConicMatrix

 

#An overloaded procecure in a package

Isee(FactReduce);
#

                                  FactReduce

 
 

 

Download 2024-08-12_print_overloaded_procedure.mw

I know this question has been asked time and time again. Starting of with the expr . That is the end goal I want to achieve.  How would I reduce the expansion to get it into 1-f(x,y,z)/g(x,y,z) format?. I have tried all sorts of approaches.
 

restart

#

expr:=1 - (x__1*x__2 + y__1*y__2 - z__1*z__2)^2/((x__1^2 + y__1^2 - z__1^2)*(x__2^2 + y__2^2 - z__2^2))

1-(x__1*x__2+y__1*y__2-z__1*z__2)^2/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

(1)

normal( (1) );

(x__1^2*y__2^2-x__1^2*z__2^2-2*x__1*x__2*y__1*y__2+2*x__1*x__2*z__1*z__2+x__2^2*y__1^2-x__2^2*z__1^2-y__1^2*z__2^2+2*y__1*y__2*z__1*z__2-y__2^2*z__1^2)/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

(2)

simplify( (2) );

((y__2^2-z__2^2)*x__1^2-2*x__2*(y__1*y__2-z__1*z__2)*x__1+(y__1^2-z__1^2)*x__2^2-(y__1*z__2-y__2*z__1)^2)/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

(3)

radnormal(%)

(x__1^2*y__2^2-x__1^2*z__2^2-2*x__1*x__2*y__1*y__2+2*x__1*x__2*z__1*z__2+x__2^2*y__1^2-x__2^2*z__1^2-y__1^2*z__2^2+2*y__1*y__2*z__1*z__2-y__2^2*z__1^2)/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

(4)

Test:=combine(%)

(x__1^2*y__2^2-x__1^2*z__2^2-2*x__1*x__2*y__1*y__2+2*x__1*x__2*z__1*z__2+x__2^2*y__1^2-x__2^2*z__1^2-y__1^2*z__2^2+2*y__1*y__2*z__1*z__2-y__2^2*z__1^2)/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

(5)

 

n:={op(numer(Test))}

{x__1^2*y__2^2, x__2^2*y__1^2, -x__1^2*z__2^2, -x__2^2*z__1^2, -y__1^2*z__2^2, -y__2^2*z__1^2, -2*x__1*x__2*y__1*y__2, 2*x__1*x__2*z__1*z__2, 2*y__1*y__2*z__1*z__2}

(6)

d:={op(expand(denom(Test)))}

{x__1^2*x__2^2, x__1^2*y__2^2, x__2^2*y__1^2, y__1^2*y__2^2, z__1^2*z__2^2, -x__1^2*z__2^2, -x__2^2*z__1^2, -y__1^2*z__2^2, -y__2^2*z__1^2}

(7)

d subset n

false

(8)

d intersect n

{x__1^2*y__2^2, x__2^2*y__1^2, -x__1^2*z__2^2, -x__2^2*z__1^2, -y__1^2*z__2^2, -y__2^2*z__1^2}

(9)

add(%[i],i=1..nops(%))

x__1^2*y__2^2-x__1^2*z__2^2+x__2^2*y__1^2-x__2^2*z__1^2-y__1^2*z__2^2-y__2^2*z__1^2

(10)

factor( (10) );

x__1^2*y__2^2-x__1^2*z__2^2+x__2^2*y__1^2-x__2^2*z__1^2-y__1^2*z__2^2-y__2^2*z__1^2

(11)

n minus d

{-2*x__1*x__2*y__1*y__2, 2*x__1*x__2*z__1*z__2, 2*y__1*y__2*z__1*z__2}

(12)

 


 

Download 2024-07-20_Q_Simplify_Reformat.mw

I am trying to improve the positioning of the gammas in the diagram (at bottom) as they are too close to the points and lines. gamma1 and gamma2 have been assigned values. This best I could come up with is shown below.

restart;

with(plots):with(plottools):

with(Typesetting):

`gamma2`:=<3|5|2>

Vector[row](3, {(1) = 3, (2) = 5, (3) = 2})

(1)

Pgamma2:=[3/2,5/2]

[3/2, 5/2]

(2)

display(point(Pbeta2,symbol=solidcircle,symbolsize=14),textplot([Pgamma2[],Typeset((`gamma2` )),align={above}]))

 

 

 

Download 2024-07-10_Typeset_gamma.mw

I have a command called Dual in a SubPackage. RationalTrigonometry:-UHG:-Dual(..). I cannot get the hyperlink from the overview page to work.i.e RationalTrigonometry,UHG,Dual If I use Dual on its own it finds another Maple command to do with boolean logic. What syntax should I use here? I have used RationalTrigonometry,Spread without a problem to avoid another Maple command.

 

I have had this a few times this week since updating to 2024.1 on Windows 10.

I get sudden freezes in a worksheet. The !!! button greys out. The ! button is ok, so the worksheet can be run by using ctrl A and click !

Has anyone else experienced this?

3 4 5 6 7 8 9 Last Page 5 of 35