emendes

455 Reputation

6 Badges

8 years, 150 days

MaplePrimes Activity


These are replies submitted by emendes

@Carl Love Many thanks for your help and patience.  Yes, I need further help with it.   How do I control the time and memory used in IndicesOfMatches?   I mean, I don't want to spend more than a few msec each time IndicesOfMatches(gb1) is called.  Is there a way to force Maple to abort the calculations if the memory or time is above some threshold? 

I will not use the extension mw except in case of a proper Maple worksheet. I did not know that there is a code of conduct in this case.   Many thanks for pointing it out.

@emendes Hopefully an example of the list will be attached to this post. The list is called gb1.  Many thanks.

 

example1.mw

 

@emendes I forgot to explain the reason of the title "exceeds limit of 100000".  The msg came out when I appiled IndiceofMatches to a list that does not conform to the one in the original post. Here is an excerpt of the list.

 

[[x3,x2*x1,x1*x0],[x3*x0,x1*x2,x0*x0], ....]

 

Again MakeUnique works and remnoves the repeated elements.

@Carl Love Thanks again.  Please forgive my stupidity, but how do I use something different from Maple's 2d-input? Is that tab "C 2D input" not the standard input?   I am asking this because I had to change from () to NULL which means I have been using Maple's 2d-input.   I haven't test the procedure as yet since the testing list takes ages to be built.

@Carl Love Many thanks but Classify it is not available on Maple 14.  I have Maple 2016 installed on two computers but my floating license is for Maple 14.   The other answer is ok for small lists but as you have correctly pointed out is not for large list which is my case (250.000 elements).  

@emendes I noticed that the solution does not seem to work unless I use expand(p).   Does it make sense?

@Carl Love many many thanks.  I have wrapped it up in a procedure using the helpful tips you have listed when answering my previous question.  If I may, could you tell me how I can limit the time and memory Maple spends in a procedure? One of my procedures uses groebner basis and depending on the set of polynomials, it crashes my 30 GB (ram) desktop.

@Carl Love Many many thanks.  The examples are very helpful and I have managed to get some of old procedures modified to use the ideas in the examples.

@Carl Love Many thanks.   I am positive that I didn't get it.  Suppose I want to write a procedure with two parameters, say, f and vars.  Both are list and the second parameter, vars, should have the length of f (the only two conditions I need to test).  I confess that I don't know even where to start. 

@Carl Love Mnay thanks.   Can you explain the options you have added to the calling args of the function, specially the variable v?

@Carl Love Many thanks.  Nice explanation. Some of the syntax used is unknown to me.  Any tutorial, book and so on that might be useful to grasp the usage and meaning of them?  Again, thank you.

@John Fredsted Thank you ever so much for the solutions and I will stick with eval (no predilection for subs).   I found my mistake in all other examples: I have type r*x (1-x) instead of r*x*(1-x).

@John Fredsted Many thanks but that it is exactly what i am trying to avoid, that is, the function using l[1], l[2] and etc.  f will be used inside of a proc.

If instead of what you proposed I define  f:=(x,y,z) -> [y, y z - x, -15 x y - x z - x], (f@@4)  returns an error message.  

It seems that f:=()->[] and f:=()-> (), unless defined as you did,  are not the answer.  Same goes for the solution using eval.   All of them work if the list has more than one element, that is, [x,y,z] but they don't work if the list is [x]. I hope I am wrong.

It seems that my only alternative is to use subs if I want to stick with list. 

 

 

@John Fredsted what I would like to achieve is f...f(f(f(f(x)))), where x is always a list.  Let me simplify the last example to hopefully clarify where I am facing the problem.

ee := [r*x(1-x)];
                                               [r x(1 - x)]
eval(ee, [x]=~[x]);
                                               [r x(1 - x)]
eval(ee, [x]=~eval(ee,[x]=~[x]));
                                               [r r(1 - r x(1 - x)) x(1 - x)(1 - r x(1 - x))]

ff := x-> [r*x(1-x)];
                                                x -> r x(1 - x)
ff(op([x]));
                                                [r x(1 - x)]
ff(op([r*x(1-x)]));
                                                [r r(1 - r x(1 - x)) x(1 - x)(1 - r x(1 - x))]
subs(x = x, [r*x(1-x)]);
                                                [r x(1 - x)]
subs(x = op([r*x(1-x)]), r*x(1-x));
                                                [r (r x(1 - x))(1 - r x(1 - x))]

 

subs gives what I need but I don't know why the other two commands give different results. What bothers me is if I do something similar using the orginal problem, the result is the same as in subs.

 

bb := [y, y*z-x, -15*x*y-x*z-x]:

eval(bb, [x, y, z]=~[x, y, z]);
                                               [y, y z - x, -15 x y - x z - x]

eval(bb, [x, y, z]=~bb));
                                               [y z - x, (y z - x) (-15 x y - x z - x) - y,-15 y (y z - x) - y (-15 x y - x z - x) - y]

subs([x = bb[1], y = bb[2], z = bb[3]], bb);
                                               [y z - x, (y z - x) (-15 x y - x z - x) - y,-15 y (y z - x) - y (-15 x y - x z - x) - y]

 

I must be missing something.  

@emendes Please tell me what I am doing wrong.

G := createFunc([r*x(1-x)], [x]);

s1 := G(op([x]));

G(op([x+~T/2*~s1]));

 

The last command returns something different from r (1-x-1/2 r T (1-x) x) (x+1/2 r T (1-x) x) which is just to plug x+1/2 r T (1-x) x into the place of x in r*x(1-x).   

First 17 18 19 20 21 Page 19 of 21