## 802 Reputation

11 years, 10 days

## Definitely from copy and paste...

@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 "%".

## % and inert=false...

@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.

## My addition to impressive code...

@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

```restart;

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]},
proc(M)
r!*c0^t*mul(_V^~M)/t!/mul(M!~)/c1^s
end proc
):
CodeTools:-Usage(
seq[reduce= `+`]((-1)^(v[2]+1)*B(v), v= Iterator:-CartesianProduct(N\$(rhs(P)-1)))
)

```

## CartesianProduct compiles...

@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?

## Some questions...

@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?

 > restart;
 > 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));
 (1)
 >
 (2)
 >
 (3)
 >
 >
 (4)
 >
 >
 (5)
 >

## The source of the information...

@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.

## My error too...

@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.

## Tonight's version is much slower...

@Carl Love Compare the timings

Tonight's

```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)
```

## Amazing...

@Carl Love That code is amazing. I had no idea something could be improved so vastly. Thank you for the clarifiaction on the 1D input.

## Tried ID. Still not transforming the vec...

@Carl Love Ok. I'm using Maple 2019.2. Is a different syntax required because 1D still did not like the +=. In the loops you have "to n do" Should I change these to "for i to n do" etc? It getting late here 2am. I will give it another shot tomorrow evening.

LAM_BM_Transform-1D.mw

## Fast!...

@dharr That is very fast.

Can a compiled procedure be saved to disk? And then used in apackage?

## Code not transforming the vector....

@Carl Love  I tried the code but it does not transform the vector, I could be doing something wrong. I corrected "istart+=h" because was getting an error message about unterminated loop, to "istart:=istart+h". I ran this for n=3 so the vector only has 8 elements.

why do you have to make a copy of the vector inside the procedure?

`LAM:-Copy(2, V, 1..-1, R, 1..nv);`

I tried copy and pasting the whole code but would probably only introduce more errors tidying it up.

LAM_BM_Transform.mw

## A Stewart Gough Platform...

Hello,

Nice work. At some point I will have to study up on the Draghilev method. I gather it applies to dynamic systems.

Here is an SG platform I post a few years ago. It only deals with a static version of the reverse kinematics. It would be interesting to see the method applied to it.

https://www.mapleprimes.com/posts/208301-Stewart-Gough-Reverse-Kinematics

 First 6 7 8 9 10 11 12 Last Page 8 of 20
﻿