1152 Reputation

14 Badges

12 years, 131 days
East Grinstead, United Kingdom

MaplePrimes Activity

These are replies submitted by Ronan

@acer  Thank you. Nice to read the history and orign of such things.

@tomleslie Am using this version. Thank you.

@vv     @tomleslie explained the cause of my problem well in the first reply. I have since converted the formula.

@tomleslie  Thank you. I understand now. Had never read the details on || or cat. Also checking over replies to my series of questions this year some of the answers have become clearer. The m's formula is extendible. So I just could build it around the size of the list L which I would probably call M. So for example  (1 + m2 + 2*m3 + 3*m4 + 4*m5 + 5*m6 + 6*m7)!  would become (1+add(i * M[i], i=1..nops(M)))! , assuming my typing is correct here.

@acer I should have taken more care. Basicially I was looking for 

 5*c^3+ 21*c^2*d + 28*c*d^2 + 12*d^3 

as the 3rd degree form. I was able to get things working properly overall. 

I have combined you answer with  the answer to a previous question I asked 


@acer Yes all the table entries are copy and pasted from other equations. I was trying to make the document look similar to 

what was being done in Scientific Workplace. Basicially I am formatting the documents to print them as I find it easier to flick through printed pages than  open half a dozen Maple documents or videos to find something.

A link to one of the videos. It about developing a power series type solution to polynomials. Solving Polynomial Equations 2: The Quadratic case | Exploring Research Level Maths | Wild Egg Maths | N J Wildberger on Patreon

You might find it interesting.

@acer All the answers on this are very helpful. II missed that part of the help. I use the the help pages as I like to have something to show when I ask a question. Sometimes rushing I mass important details as  in "%".

@acer Thank you. That works well. But I dont understand the syntax. I didnt realise % made operations inert.  I haven't seen that in the help or at least I have found that.

InertForm:-Display~(M,inert=false):  I tried it with inert=true that made no difference and I left out inert altogether and that made no difference either. What am I missing here?

It would be nice to know how to get to display 2! 2!.  I couldn't get  `%*` to work.   


@Carl Love Thank you. When I first asked the question I hadn't bothered about the sign of the terms. which for all cases is (-1)^(m3+1). I got it to work abe modifying the itterator expression. It just means that P=2 doesnt work but easly work around is  coeff(%,c3,0) for P=3


Iterator:-CartesianProduct([1,1]): #Force compilation

P:= 2..3: #suffixes of m and c variables
N:= [$0..20]: #evaluation values of m variables

B:= subs(
    {_C= [$P], _V= [c||P]}, 
    local r:= add(M*~_C), s:= 1+r, t:= s-add(M);
    end proc
    seq[reduce= `+`]((-1)^(v[2]+1)*B(v), v= Iterator:-CartesianProduct(N$(rhs(P)-1)))

@Carl Love  to answer both replies here. Yes I had wondered about the For loop when I red your code yesterday but didn't get to try it then.

On the Iterator:-CartesianProduct there is quite a time delay when it is first run after a restart. Then it is really fast. Would adding this into the start up code region (not that I have ever used it) get around this? 

@tomleslie I seperated out the code onto different lines to help me understand what is happening.

The Iterator:-Cartesian product then gave an error. So I had to change $=0..4 to $ 0..4  Why?

As A an B use the arrow operator, why add(A~...   instead of  add(A(m)~......  which actually gives incorrect output.

I see the Iterator:-CartesianProduct is very fast. I gather  this auto compiles which causes some bit of a delay 1st time. Question here. Coud auto compile type routines be added to start up code so restart doesn't affect this?


 A:= m-> (2*m[1] + 3*m[2])!*c0^(1 + m[1] + 2*m[2])*c2^m[1]*c3^m[2]
          ((1 + m[1] + 2*m[2])!*m[1]!*m[2]!*c1^(2*m[1] + 3*m[2] + 1));

proc (m) options operator, arrow; factorial(2*m[1]+3*m[2])*c0^(1+m[1]+2*m[2])*c2^m[1]*c3^m[2]/(factorial(1+m[1]+2*m[2])*factorial(m[1])*factorial(m[2])*c1^(2*m[1]+3*m[2]+1)) end proc


add(`~`[A]([seq(v[], v = Iterator:-CartesianProduct(`$`([`$`(0 .. 4)], 2)))]))



B := proc (m) options operator, arrow; factorial(2*m[1]+3*m[2]+4*m[3])*c0^(1+m[1]+2*m[2]+3*m[3])*c2^m[1]*c3^m[2]*c4^m[3]/(factorial(1+m[1]+2*m[2]+3*m[3])*factorial(m[1])*factorial(m[2])*factorial(m[3])*c1^(2*m[1]+3*m[2]+4*m[3]+1)) end proc

proc (m) options operator, arrow; factorial(2*m[1]+3*m[2]+4*m[3])*c0^(1+m[1]+2*m[2]+3*m[3])*c2^m[1]*c3^m[2]*c4^m[3]/(factorial(1+m[1]+2*m[2]+3*m[3])*factorial(m[1])*factorial(m[2])*factorial(m[3])*c1^(2*m[1]+3*m[2]+4*m[3]+1)) end proc



add(`~`[B]([seq(v[], v = Iterator:-CartesianProduct(`$`([`$`(0 .. 4)], 3)))]))



add(`~`[B]([seq(v[], v = Iterator:-CartesianProduct(`$`([`$`(0 .. 25)], 3)))]))








Both are very useful answers.

@dharr Thank you.This may interest you. I was following a series of math videos form N. J. Wildberger on YouTube, on the origins of Boolean Algebra.  It rapidly leads into an efficient  canonical form of Boole's algebra. This is the link to the first in the series .A brief history of logic: Aristotle and deduction | Math Foundations 251 | NJ Wildberger - YouTube

It is great to hear that one's question is of use to another.

@Carl Love My sloppy code didn't help. I knew I should swap jm and h before I first posted.

 im := 1/2*im; istep := 1/2*istep; jm := 2*jm; h := 1/2*h; 

 I then assumed because V1 transformed back to V0 when the transform was applied to it that the code must be correct. Well done to @dharr for catching that.

Also I hadn't checked the n=3 case against the original matrix which would have caught the problem.

@Carl Love Compare the timings


n = 25:
memory used=4.00GiB, alloc change=256.00MiB, cpu time=63.14s, real time=57.23s, gc time=13.16s
V0 = RTABLE(18446746400855522110, (100110111010010011100011010100

  10hellip... 33554400 row vector entries not shown), 

  Vector[row], Handle)
V1 = RTABLE(18446746400855518854, (111000110010101001111000111101

  10hellip... 33554400 row vector entries not shown), 

  Vector[row], Handle)

Previous Nights

n = 25:
memory used=0.50GiB, alloc change=0.50GiB, cpu time=140.00ms, real time=154.00ms, gc time=0ns
V0 = RTABLE(18446746173536082150, (100110111010010011100011010100

  10hellip... 33554400 row vector entries not shown), 

  Vector[row], Handle)
V1 = RTABLE(18446746173536074798, (100110111010010011100011010100

  10hellip... 33554400 row vector entries not shown), 

  Vector[row], Handle)


First 13 14 15 16 17 18 19 Last Page 15 of 27