Ronan

1207 Reputation

14 Badges

12 years, 211 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I would like to open a specially formatted document from start/new document. I set  up one with a fixed width table to make it easy to print to A4. I find the very useful for taking notes.

Currently I just save it as  a usual document. The attached shows the basic setup I use. Contents arn't too relivant.

restart

``

 

 

 

"R(m2,m3,m4,...)≡((2 m2+3 m3+4 m4+...)!)/((1+m2+2 m3+3 m4+...)!m2!m3!m4!...)"

 

 

  

Xterm := factorial(2*m+3*n+4*p+5*q)*c[2]^m*c[3]^n*c[4]^p*c[5]^q/(factorial(1+m+2*n+3*p+4*q)*factorial(m)*factorial(n)*factorial(p)*factorial(q))

factorial(2*m+3*n+4*p+5*q)*c[2]^m*c[3]^n*c[4]^p*c[5]^q/(factorial(1+m+2*n+3*p+4*q)*factorial(m)*factorial(n)*factorial(p)*factorial(q))

(1)

k := 5

5

(2)

x := add(add(add(add(Xterm, q = 0 .. 4*k), p = 0 .. 3*k), n = 0 .. 2*k), m = 0 .. k)

nops(x)

22176

(3)

NULL

nops(TestPoly)

1

(4)

ldegree(TestPoly)

1

(5)

NULL

NULL

NULL
NULL

mtaylor(TestPoly, [c[2], c[3], c[4], c[5]], k+2)

TestPoly

(6)

C1 := 1; C2 := -2; C3 := 3; C4 := -4; C5 := 5

5

(7)

Poly1 := expand((y+C1)*(y+C2)*(y+C3)*(y+C4)*(y+C5))

y^5+3*y^4-23*y^3-51*y^2+94*y+120

(8)

NULL

Poly1 := Poly1/coeff(Poly1, y, 0)

(1/120)*y^5+(1/40)*y^4-(23/120)*y^3-(17/40)*y^2+(47/60)*y+1

(9)

NULL

Poly1 := expand((y+C1)*(y+C2)*(y+C3)*(y+C4)*(y+C5))

y^5+3*y^4-23*y^3-51*y^2+94*y+120

(10)

NULL

Poly1 := Poly1/coeff(Poly1, y, 0)

(1/120)*y^5+(1/40)*y^4-(23/120)*y^3-(17/40)*y^2+(47/60)*y+1

(11)

fsolve(Poly1, y)

-5., -3., -1., 2., 4.

(12)

coeff(Poly1, y, 1)

47/60

(13)

Poly2 := algsubs(y = -z/coeff(Poly1, y, 1), Poly1)

-(6480000/229345007)*z^5+(324000/4879681)*z^4+(41400/103823)*z^3-(1530/2209)*z^2-z+1

(14)

"(->)"

-0.28254e-1*z^5+0.66398e-1*z^4+.39876*z^3-.69262*z^2-1.*z+1.

(15)

"(->)"

 

solve(Poly2, z)

-47/30, -47/15, 47/12, 47/20, 47/60

(16)

-%/coeff(Poly1, y, 1)

2, 4, -5, -3, -1

(17)

NULL

 

 

``

``

NULL

Download A4_format.mw

   Is there a way to export routines from a package. The reason I ask, I was answering a question here and I needed two routines I have, that I put together a couple of years ago in a package. I used showstat copied, pasted and edited. Worked, but not great and would utterly fail with anything complicated. e.g. In the two routines pasted  below SignedArea on line 3 c[1]  is c   [1] that caused a minor problem.  

restart

NULL

"RonanRoutines:-SignedArea := proc(a::{Vector, list}, b::{Vector, list}, c::{Vector, list, null} := null)  local M, A;     1   if c = null then     2       A := 1/2*a[1]*b[2]-1/2*a[2]*b[1]         else     3       A := 1/2*(b[2]-c[2])*a[1]+1/2*(-b[1]+c[1])*a[2]+1/2*c[2]*b[1]-1/2*c               [1]*b[2]         end if;     4   return A  end proc:"

NULLNULL

"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:  "

NULL

Download Export_from_Package.mw

In the attached, I had to find the required coefficient. Now this has a relatively straight forward set of equation (which apparently form a closed group), so it was easy enough tee see what to do. In a more complicated situation that may be very difficult to see. I was a wondering is there is a better approach to use here?
 

restart

Prove/show the coefficient of c[0] in c[1]^11 is 1/12*(1-1/5^10)NULL

eq1 := c[1]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

c[1]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

(1)

eq2 := c[1]*c[2] = (2/5)*c[1]+(2/5)*c[2]+(1/5)*c[3]

c[1]*c[2] = (2/5)*c[1]+(2/5)*c[2]+(1/5)*c[3]

(2)

eq3 := c[1]*c[3] = c[2]

c[1]*c[3] = c[2]

(3)

eq4 := c[2]*c[3] = c[1]

c[2]*c[3] = c[1]

(4)

eq5 := c[2]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

c[2]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

(5)

eq6 := c[3]^2 = c[0]

c[3]^2 = c[0]

(6)

 

expand(eq1^5)

c[1]^10 = (1/3125)*c[0]^5+(32/3125)*c[1]^5+(32/3125)*c[2]^5+(16/625)*c[0]*c[1]^4+(16/625)*c[0]*c[2]^4+(2/625)*c[0]^4*c[1]+(2/625)*c[0]^4*c[2]+(8/625)*c[0]^3*c[1]^2+(8/625)*c[0]^3*c[2]^2+(16/625)*c[0]^2*c[1]^3+(16/625)*c[0]^2*c[2]^3+(32/625)*c[1]*c[2]^4+(32/625)*c[1]^4*c[2]+(64/625)*c[1]^3*c[2]^2+(64/625)*c[1]^2*c[2]^3+(64/625)*c[0]*c[1]^3*c[2]+(96/625)*c[0]*c[1]^2*c[2]^2+(64/625)*c[0]*c[1]*c[2]^3+(16/625)*c[0]^3*c[1]*c[2]+(48/625)*c[0]^2*c[1]^2*c[2]+(48/625)*c[0]^2*c[1]*c[2]^2

(7)

C111 := lhs(%)*c[1] = expand(rhs(%)*c[2]*c[3])

c[1]^11 = (1/3125)*c[2]*c[3]*c[0]^5+(32/3125)*c[2]*c[3]*c[1]^5+(32/3125)*c[2]^6*c[3]+(16/625)*c[2]*c[3]*c[0]*c[1]^4+(16/625)*c[2]^5*c[3]*c[0]+(2/625)*c[2]*c[3]*c[0]^4*c[1]+(2/625)*c[2]^2*c[3]*c[0]^4+(8/625)*c[2]*c[3]*c[0]^3*c[1]^2+(8/625)*c[2]^3*c[3]*c[0]^3+(16/625)*c[2]*c[3]*c[0]^2*c[1]^3+(16/625)*c[2]^4*c[3]*c[0]^2+(32/625)*c[2]^5*c[3]*c[1]+(32/625)*c[2]^2*c[3]*c[1]^4+(64/625)*c[2]^3*c[3]*c[1]^3+(64/625)*c[2]^4*c[3]*c[1]^2+(64/625)*c[2]^2*c[3]*c[0]*c[1]^3+(96/625)*c[2]^3*c[3]*c[0]*c[1]^2+(64/625)*c[2]^4*c[3]*c[0]*c[1]+(16/625)*c[2]^2*c[3]*c[0]^3*c[1]+(48/625)*c[2]^2*c[3]*c[0]^2*c[1]^2+(48/625)*c[2]^3*c[3]*c[0]^2*c[1]

(8)

c[1]^11 = simplify(rhs(C111), [eq2, eq3, eq4, eq5, eq6])

c[1]^11 = (1/9765625)*(4070573*c[3]+4067448)*c[2]+(813802/9765625)*c[0]+(813802/9765625)*c[3]

(9)

coeff(rhs(%), c[0], 1)

813802/9765625

(10)

eval(1/12*(1-1/5^10))

813802/9765625

(11)

NULL


 

Download Graphs_steps.mw

Recently I have wanted to add some questions/answers to "Favourites" . I added some posts a few years ago. Now I can't figure out how do do it. A good example is this evenings question on setting up a library. How to install a library on Maple? - MaplePrimes

The answer has useful links. And this is a particular topic I tend to have difficulty with.

This is a just a general type question. Often reading questions posted to do with modules and packages I see "foo" used. I have put together some simple packages for routines I find useful. I am week in general programming knowledge. I would like to know is "foo" something special or a generic name used for testing? Is is an acronym? ...

First 14 15 16 17 18 19 20 Last Page 16 of 32