Stretto

240 Reputation

5 Badges

5 years, 25 days

MaplePrimes Activity


These are replies submitted by Stretto

@mmcdara 

I'm not sure if this is quite right. I can't follow all the code but I think I get the gist.

What I'm getting at is essentially this: One starts with a free monoid. This is effectively just a matrix representation

M[i,j] = a[i] . a[j]

where a is a list of operators/symbols.

this monoid tells us how to multiply our symbols. Of course, since it is free it is relatively useless but we can use it to reduce strings to binary products. e.g., a[3].a[5].a[6].a[34]

It's just a "mutiplication" table. In this case we cannot reduce anything because there is no relationships between elements.

But if we have some rules/relations between elements or classes of elements then we might be able to simplify:

E.g.,

if a[3].a[5] = a[13] and a[3k].a[17k] = a[k]

Then allows us to reduce our string to a[3].a[5].a[6].a[34] = a[13].a[2]

Of course we might want the associativity law to apply which it might not in my example but.

So starting with a sort of "infinite table" which is an arbitrary "multiplication table" we can introduce "known products" and we would want the table to simplify using those products. It should simplify to the simplest representation(and maybe even check for consistency).

It seems what you have done is simply enable an arbitrary operator(such as cat, modp, matrix mul, etc).

But what I want is to be able to simplify the table given known relationships between elements.

E.g., suppose we have an indentity(which we should in monoid.

Then if a[1] = id, M[1,j] = id.a[j] = a[j] and M[i,j] = a[i]

Then when we display the matrix our first column and row will not show a[1].a[j] but just a[j] and same for first row.

I do like the ability to supply arbitrary operators but that isn't really what I'm afte.

E.g., I might want M[i,i] = a[i].a[i+1]

I currently do this with something like:

matrix(n,n,(i,j)->piecewise(i = 1, a[j], j = 1, a[i], i = 3 and j = 3, a[3], etc....))

and this lets me fill in some of the simplifications but it's messy and I have to do all the work by hand. I also use subs and it works to some degree but it doesn't actually simplify things algorithmically by applying the rules as one would want so I might have to repeat the process many times and figure out what the rules need to be to get a total simplication of the table(e.g., closure, that is, no entry actually is a product because it's all been simplified).

e.g.,

i = 3 and j = 3, a[3],

says that a[3].a[3] = a[3]^2 = a[3] which says that a[3] is an idempotent. So if the 3rd element is an idempotent I can specify it this way.

In some ways I probably just just specify the generating rules and create a proc that generates all the possible combinations of rules and basically build the table from the ground up.

@vv 

Thanks, this does seem to work but doesn't address the "bug" issue. I know there are other ways to solve the problem to find a continuous argument. I guess yours is equvalent to using the total derivative. But the main issue here is that my code should work(unless I have a bug) as it's fairy simple and yet it doesn't work as it should. This would be a relatively simple thing to do in Matlab or any other standard programming language. Because of the way maple seems to do certain things though either it's has a relatively serious bug in it or I'm not understanding one of it's quirks.

@Preben Alsholm 

Actually I don't, they are irrelevant to the problem.

@vv Thanks.

 

CoeffList := proc(f,v,N)
    PolynomialTools:-CoefficientList(convert(series(f,v,N),polynom),v);
end proc;

 

Put it in a function to siimplify since I hate long lines.

@acer 

dataplot(Matrix([[0,0],[1,2],[2,3],[3,2],[4,4]]),points,annotation=Array(["January","February\nsdfsad","March","April","May"]));

I'll be trying something like that. Seems like it will work. Hopefully won't be too slow.

@acer Yes, I meant plot. Don't know why I said print. Clearly though I meant plot because printing already would show that info and printing has nothing to do with mouse hovering. Deduction my dear Watson... sometimes it's required in an imperfect world.

@Carl Love 

I was hoping for something simpler, I made a procedure that would let me subs sets of lists which I imagine is functionally identical to yours. I was thinking maybe maple had some very simple way to do it(one liner).

 

@Carl Love 

Not sure now, I used some hack IIRC. I didn't know one could do an op on inert expressions so as long as it doesn't break down in more complex exprssions it could work.

how do you overload functions in maple? Specify a type on the parameter?

@tomleslie 

Thanks. Obviously this isn't a javascript specific problem. I haven't checked it's accuracy though but it looks like it should work fine.

How does one get it to reference from UTC instead of GMT? You seem to be specifying UTC but it's showing GMT in the output.  Says it defaults to UTC too.

@Carl Love 

lol, I meant javascript, sorry. Wasn't thinking there would be any amibiguity for some reason. This is not necessarily a javascript specific problem but I mentioned javascript because ticks are relative and so some conversions use different reference points.

@Kitonum 

 

Thanks. This works. I wonder if there is a way to significantly speed it up? I'd like to use it in animation.

@Carl Love 

 

Cool, that works. Is there a way, maybe, to allow for selecting a "2d" parameter using a grid by dragging along, say, a square and having the xy coordinate translate in to parameters? This way I can translate two parameters simultanously rather than having to move one or the other at a time.

There seems to be no way to modify the printing font or scale. Seems pretty ridiculous.

@acer 

Thanks a lot! This seems to be what I want! I haven't tested it extensively but so far so good. As long as it generally works and doesn't end up in any weird infinite loops and such then it should work. I don't need necessarily to see every step but it does seem to follow the order of operations.

I'm mainly just using it to check standard arithmetic expressions when trying to track down bugs in formulas. It seems to see how things evaluate progressive to see exactly what is going on. It could be used for other things though such as teaching the order of operations(to some degree at least).

Ideally any AST could be expressed and it would simply progressively evaluate the AST as far as possible and work with general algebraic expressions. This is not something I'd be using any time soon though.

@tomleslie 

This does work, it's a little bulky but I think I can shorten the function name and it won't be too bad.

Thanks.

 

1 2 3 4 5 6 7 Page 1 of 7