John Fredsted

2238 Reputation

15 Badges

20 years, 167 days

MaplePrimes Activity


These are replies submitted by John Fredsted

@Fzen: You are absolutely right, my apology. Here is the improved version:

permUnique := (L::list) -> ListTools:-MakeUnique(L,1,(x,y) -> evalb(
   simplify(x - eval(y,{a = b,b = c,c = a})) = 0 or
   simplify(x - eval(y,{a = c,b = a,c = b})) = 0
)):
# Applied to the examples you give
permUnique([a,b,a^2,b^2,c,c + 2*a,a - b,c^2,a + 2*b,b + 2*c]);
permUnique([a*b,b*c,a - b^2,b - c^2,a^2,c - a^2]);
permUnique([(a-b)^2,(a-c)^2,(a-c+b)^2,(2*a-b-c)^2]);

PS: No need to call me sir.

@Fzen: I am confused. Two questions:
1.) Do you expect permUnique to return anything else than ds itself, for the ds you have just provided? As far as I can tell, it should not.
2.) What does sgm mean?

@Bendesarts: In the language of object-oriented programming, the difference between using variables and functions is using attributes or methods. When doing simple things, or things that depend only on the input to the module itself, at creation time, I guess I would choose the variables/attributes approach. Note, however, that you may do the following, using then the function/method approach:

CreeMonPackage:=proc(Input::list)
   module()
   option package;
   export f;
   f := (n::posint) -> add(i^n,i=Input);
end module
end proc:
M := CreeMonPackage([1,2]):
M:-f(1);
M:-f(2);

the variables f1 and f2 thus becoming specific output values of the function f.

@Bendesarts: Your line

CreeMonPackage([1,2]):-f1;

should read

CreeMonPackage([1,2]):-f1();

@Carl Love: I second you concerning Google indexation.

PS: It is somewhat a riddle to me why the MaplePrimes administrators do not even seem to bother answering a community member so active as you, as if they do not really acknowledge the probably huge amount of time you invest in this forum.

@Christopher2222: It would indeed be helpful to be able to interrupt execution while some large output is being passed to the display.

@vv: I see. That is of course not possible generally.

@Carl Love. Thanks for that 'recipe'. I think I will make a desktop link to it, to have it readily available next time. I already knew about the Task Manager, the sorting of tasks, and mserver.exe being the Maple server program. But I have never tried, or thought that it is was possible, to save my worksheet that way.

PS: It has become a habit of mine to frequently hit Ctrl+S, not least because of the frustating problem reported in the thread Maple gets stuck some time ago, so the loss of work of killing the Maple program itself in the Program tab of the Windows Job List has mostly been moderate, although still annoying.

@one man: No, the break command is of no use to me in those circumstances. An example of a situation in which I would like to stop execution is if I suddenly discover an error in my code while it is executing. Anyway, thanks for your suggestion.

@Markiyan Hirnyk: Thanks for your feedback.

@tomleslie: Thanks for your feedback. Interesting observation concerning the resizing of the window. If one has a couple of hours to kill, then one could throw oneself into a loop-like repetition activity there :-). I will try resizing the window next time, but only once, I think.

@Christopher2222: That is far better than my solution, thumbs up, for then my expr1 and expr2 are just given by

Physics[diff](L,diff(theta2(t),t));
Physics[diff](L,     theta2(t)   );

I was not aware that Physics[diff] could handle functional derivatives.

PS: Perhaps you should write an email to loicva to make sure that your solution is getting attention.

Thanks all three of you. That cleared up matters.

@tomleslie: On my system, Maple 17, comp(3.14,Pi,0.01); returns just

i.e., the boolean expression unevaluted. Is evaluation something post Maple 17, or what?

PS: If evalf is used at various places, then boolean evaluation can, unsurprisingly, be forced.

@loicva: Happy to hear that.

First 12 13 14 15 16 17 18 Last Page 14 of 68