Michael

217 Reputation

11 Badges

18 years, 11 days

MaplePrimes Activity


These are replies submitted by Michael

Thank you very much. That works as I wanted.

 

Please:

 

What is the difference between

... assuming n::integer;

AND

... assuming n,integer;

 

The second form works as expected, but only sometimes, and I can never figure out when it is going to work.

What is that form supposed to do?

Thanks.

You (or whoever worries about these things) might want to consider that the installation instructions are kind of misleading - the wording states that MSVC++ is "required" for installation.

 

Anyway, its installed now and working OK.

Thanks again.

Thanks.

You (or whoever worries about these things) might want to consider that the installation instructions are kind of misleading - the wording states that MSVC++ is "required" for installation.

 

Anyway, its installed now and working OK.

Thanks again.

Whoops - you are correct - I forgot that statements within a procedure aren't printed, without a print command.

So, that explains that.

Thank you.

Whoops - you are correct - I forgot that statements within a procedure aren't printed, without a print command.

So, that explains that.

Thank you.

Thank you.

I tried that and it works well, except in a procedure (which of course is exactly where I need to use it).

The help file talks about levels of recursion inside procedures, but there is no way to set a level when the second parameter of "eval" is already in use otherwise. See the example below.

Is there any way to do what I am trying to do,which is to substitute a function anme and transform the parameters all at the same time?

> restart;
> M1:=proc(X1,X2);
> f(X1,X2);
> end proc;

                M1 := proc(X1, X2) f(X1, X2) end proc

> try1:=M1(A,B);
> try2:=G(A,B);
> eval(try2,G=M1);

                           try1 := f(A, B)


                           try2 := G(A, B)


                               f(A, B)

> test:=proc(U,V) global M1; local try1, try2;
> try1:=M1(U,V);
> try2:=G(U,V);
> eval(try2,G=M1);
> print ("try1=",try1);
> print ("try2=",try2);
> end proc;

 ...

 

> test(a,b);

                           "try1=", f(a, b)


                           "try2=", G(a, b)

Thank you.

I tried that and it works well, except in a procedure (which of course is exactly where I need to use it).

The help file talks about levels of recursion inside procedures, but there is no way to set a level when the second parameter of "eval" is already in use otherwise. See the example below.

Is there any way to do what I am trying to do,which is to substitute a function anme and transform the parameters all at the same time?

> restart;
> M1:=proc(X1,X2);
> f(X1,X2);
> end proc;

                M1 := proc(X1, X2) f(X1, X2) end proc

> try1:=M1(A,B);
> try2:=G(A,B);
> eval(try2,G=M1);

                           try1 := f(A, B)


                           try2 := G(A, B)


                               f(A, B)

> test:=proc(U,V) global M1; local try1, try2;
> try1:=M1(U,V);
> try2:=G(U,V);
> eval(try2,G=M1);
> print ("try1=",try1);
> print ("try2=",try2);
> end proc;

 ...

 

> test(a,b);

                           "try1=", f(a, b)


                           "try2=", G(a, b)

I just figured out that "apply" is used incorrectly in the above example, and that the statement "eval(try2)" will do what I want, but I still don't understand why.

Can anyone explain?

Thank you

I may be naive, but wouldn't you think that evaluating the following:

 sin(Pi (j + 1))/j/(j-1) 


for j=0 and/or j=1 should trigger some sort of exception, since it leads to 0/0 in both cases.

From what I can see, the "try...catch" commands were created precisely to handle this
kind of situation.

I'd rather receive an error message than get the wrong answer and spend hours
trying to figure out why, or, worse yet, never notice.
 
(The example I gave was buried deep in a long complicated expression I was trying to
reduce to something useful).

So, I call it a bug.

Could you please clarify - what is the "specialization problem" you refer to and
why is it so hard to fix.

The example shows that it's not hard to detect.

Thank you.

I may be naive, but wouldn't you think that evaluating the following:

 sin(Pi (j + 1))/j/(j-1) 


for j=0 and/or j=1 should trigger some sort of exception, since it leads to 0/0 in both cases.

From what I can see, the "try...catch" commands were created precisely to handle this
kind of situation.

I'd rather receive an error message than get the wrong answer and spend hours
trying to figure out why, or, worse yet, never notice.
 
(The example I gave was buried deep in a long complicated expression I was trying to
reduce to something useful).

So, I call it a bug.

Could you please clarify - what is the "specialization problem" you refer to and
why is it so hard to fix.

The example shows that it's not hard to detect.

Thank you.

@Thomas Richard 

 

Yes, that is the one. The virtual machine is not limited to XP - you can load all the other old Windows operating systems if you are so inclined - I haven't tried.

Your recommendation makes no sense - you state that Maple is slower on virtual XP. That may be true but "slower" is still faster than "not at all".

By the way - I always use the classic worksheet anyway (I have troglodytic tendancies), and have noticed no speed issues between what runs on XP and what runs on Win 7 (when it does run).

Its probably the fancy front end that runs slowly on XP and notatall on Win 7 (just a guess).

The alternative of course is a yearly upgrade to the newest Maple version.

@Thomas Richard 

 

Yes, that is the one. The virtual machine is not limited to XP - you can load all the other old Windows operating systems if you are so inclined - I haven't tried.

Your recommendation makes no sense - you state that Maple is slower on virtual XP. That may be true but "slower" is still faster than "not at all".

By the way - I always use the classic worksheet anyway (I have troglodytic tendancies), and have noticed no speed issues between what runs on XP and what runs on Win 7 (when it does run).

Its probably the fancy front end that runs slowly on XP and notatall on Win 7 (just a guess).

The alternative of course is a yearly upgrade to the newest Maple version.

Well, that is a very nice bit of semantics. I think it would be helpful if some authority from MapleSoft could intercede at this point and present the developer's definition - when is a bug not a bug? Personally, I find it very frustrating (and I suspect that Alex does too) to continually run into "ordering problems"? Whose "problems"? And why do we never see such characteristics discussed in the Maple advertising or reviews? Why do reviewers not discuss "weaknesses" in this sense? Do "ordering problems" exist in other symbolic codes? Is there a literature on the subject?
Well, that is a very nice bit of semantics. I think it would be helpful if some authority from MapleSoft could intercede at this point and present the developer's definition - when is a bug not a bug? Personally, I find it very frustrating (and I suspect that Alex does too) to continually run into "ordering problems"? Whose "problems"? And why do we never see such characteristics discussed in the Maple advertising or reviews? Why do reviewers not discuss "weaknesses" in this sense? Do "ordering problems" exist in other symbolic codes? Is there a literature on the subject?
Hi: First of all, many thanks for spending so much time with a very thorough reply. Now that I have been thinking about it, let me try again from the viewpoint of a Maple user who is trying to solve a problem, as opposed to a computer algebra theorist. You start a calculation, work on it many hours and decide to quit for the day, so you save your worksheet and turn off the program. Next day you fire up Maple and run your worksheet to the point where you left off, and ... guess what? The answer you get isn't the same as the answer you had yesterday. So you track it down and discover that today Maple is writing (1-x) as -(x-1) and your substitutions didn't catch that one. So, you change your program, spend some more quality time with your problem, quit for the day and start again tomorrow. And to your horror, tomorrow you discover that (a-b) has become -(b-a), and the solution you wanted to the 10x10 matrix inversion is no longer the 5'th, but the second element. Well, you get the picture. So, let me try the question again from a very practical point of view - thanks to your explanation, I now understand why Maple may decide to reorder things according to its own random quirks as a calculation progresses, but surely there must be some way of restarting everything fresh when you go back to the beginning, so the code will always do its quirky thing reproducibly. That's the way computers are supposed to work. I have painfully discovered that starting every worksheet with a preemptive "restart" command isn't enough so there must be more to it than that. In short - how do you invoke a "clean" restart?
1 2 3 4 5 Page 3 of 5