Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 340 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

Now, how can that be done in Maple? In Classic Maple (that doesn't work in Standard Maple),
with(plots): display(textplot([[0,1,"a"],[0,0.3,"a"]],font=[TIMES,ITALIC,160]),
  textplot([[1,0.8,"1"],[1,0.1,"2"]],font=[TIMES,ROMAN,80]),
  textplot([[-1.5,0.3,"["],[2,0.3,"]"]],font=[TIMES,ROMAN,320]),
  view=[-1.5..2.5,0..1.4],axes=none);
Now, put the mouse pointer over the plot, click the right button, and click on export as jpg. I saved it as "humor.jpg". Note that setting plotdevice as jpg, bmp, or tiff (and they are the only formats supported by ImageTools) won't work - their drivers ignore the font size and produce a completely different picture because of that. So one has to export plot manually. Now,
with(ImageTools):
A:=Read("humor.jpg");

                   [ 1..483 x 1..483 x 1..3 3-D Array ]
              A := [ Data Type: float[8]              ]
                   [ Storage: rectangular             ]
                   [ Order: C_order                   ]

B:=Array(1..483,1..483,1..3,(i,j,k)->A[484-j,i,k],datatype=float[8]);

                   [ 1..483 x 1..483 x 1..3 3-D Array ]
              B := [ Data Type: float[8]              ]
                   [ Storage: rectangular             ]
                   [ Order: Fortran_order             ]

Write("humor1.jpg",B):

display(Preview(B),axes=none);
The actual size of that plot in Maple is smaller than here - I used humor.jpg (slightly edited by deleting some white space) and humor1.jpg in this post. _____________ Alec Mihailovs http://mihailovs.com/Alec/

If the code is properly formatted, then it generally doesn't matter - either fi, or end, or end if are equally readable, I think. That matters mainly if the block is located in one line (or, maybe, two lines). But in this case - for a oneliner, the length is important - in this case I prefer fi. Also, you know, after using fi and od for many years, it becomes automatic... If I published a code in an article, or a book, I would use end if and end do, probably, but if I do some short calculations in Maple for myself, I would definitely, without any doubts, use fi and od. _________ Alec Mihailovs http://mihailovs.com/Alec/

If the code is properly formatted, then it generally doesn't matter - either fi, or end, or end if are equally readable, I think. That matters mainly if the block is located in one line (or, maybe, two lines). But in this case - for a oneliner, the length is important - in this case I prefer fi. Also, you know, after using fi and od for many years, it becomes automatic... If I published a code in an article, or a book, I would use end if and end do, probably, but if I do some short calculations in Maple for myself, I would definitely, without any doubts, use fi and od. _________ Alec Mihailovs http://mihailovs.com/Alec/

Well, it is possible - I think I posted something about that in MUG 4 or 5 years ago (you can search MUG archives for x-bar and p-hat) but that requires a lot of work, and the result might be not worth it. Why do you want to do that in Maple? Maple is mainly a computational engine, not typesetting. It can't be used for publishing anyway - you need LaTeX for that, as you mentioned. __________ Alec Mihailovs http://mihailovs.com/Alec/
Well, it is possible - I think I posted something about that in MUG 4 or 5 years ago (you can search MUG archives for x-bar and p-hat) but that requires a lot of work, and the result might be not worth it. Why do you want to do that in Maple? Maple is mainly a computational engine, not typesetting. It can't be used for publishing anyway - you need LaTeX for that, as you mentioned. __________ Alec Mihailovs http://mihailovs.com/Alec/
Axel, Wow, that's very interesting - especially getting 104-digit numbers into Maple. Thank you for posting it here. __________ Alec Mihailovs http://mihailovs.com/Alec/
There is no other way, in general, to plot symbolic values (except choosing numbers other than 1, 3, 4), plot is a numerical procedure in Maple. K can be added to the tickmarks; for example, 1=K after 0=0, and view of the y-axis in this case can be increased to, say, 0..1.5 instead of 0..1 - you can experiment to find a better looking value. By the way, according to Maple calculations, it should be K*Pi instead of K, but that depends on the units. P.S. Did you use Classic Maple or Standard? What version? __________ Alec Mihailovs http://mihailovs.com/Alec/
There is no other way, in general, to plot symbolic values (except choosing numbers other than 1, 3, 4), plot is a numerical procedure in Maple. K can be added to the tickmarks; for example, 1=K after 0=0, and view of the y-axis in this case can be increased to, say, 0..1.5 instead of 0..1 - you can experiment to find a better looking value. By the way, according to Maple calculations, it should be K*Pi instead of K, but that depends on the units. P.S. Did you use Classic Maple or Standard? What version? __________ Alec Mihailovs http://mihailovs.com/Alec/
It works in Maple 10. In earlier Maple versions, one should first close a window and then run another one (otherwise 'Main' window becomes a child of 'First', and when 'First' is closed, all its children are closed, too). You might try to do that in the code - interchange CloseWindow('First') and RunWindow('Main') in the Action command. Also uses should be replaced with use ... in in earlier Maple versions, with adding end use just before the end of the procedure, see ?use . I have shown this transformation recently in Where to insert this procedure thread. _________ Alec Mihailovs http://mihailovs.com/Alec/
It works in Maple 10. In earlier Maple versions, one should first close a window and then run another one (otherwise 'Main' window becomes a child of 'First', and when 'First' is closed, all its children are closed, too). You might try to do that in the code - interchange CloseWindow('First') and RunWindow('Main') in the Action command. Also uses should be replaced with use ... in in earlier Maple versions, with adding end use just before the end of the procedure, see ?use . I have shown this transformation recently in Where to insert this procedure thread. _________ Alec Mihailovs http://mihailovs.com/Alec/

Readability depends on who is reading - if ... fi is a standard construction in many shells (bash, for instance). od (i.e. overdose) on the other hand, is not that standard, Unix shells use done instead. Still, it sounds better than the end to me. __________ Alec Mihailovs http://mihailovs.com/Alec/

Readability depends on who is reading - if ... fi is a standard construction in many shells (bash, for instance). od (i.e. overdose) on the other hand, is not that standard, Unix shells use done instead. Still, it sounds better than the end to me. __________ Alec Mihailovs http://mihailovs.com/Alec/

Some people use hastype instead of type, too:)
See Testing objects for equivalence, for example. By the way, I just recently did a time comparison (at the end of PointList constructor thread), and it has appeared that :: is faster than type. For example,
r := proc(x) if x::'table' then true else false fi end:
is faster than q - not that that matters :) __________ Alec Mihailovs http://mihailovs.com/Alec/
Exactly as in the example just above your post,
PDEtools[declare](X(t),theta(t),prime=t):
                  
Y:=X(t) + L1*sin(theta[1](t))+ L2*sin(theta[1](t)-theta[2](t));

       Y := X + L1 sin(θ1) + L2 sin(θ1 - θ2)

diff(Y,t);

  X' + L1 cos(θ1) θ1' + L2 cos(θ1 - θ2) (θ1'  - θ2')
__________ Alec Mihailovs http://mihailovs.com/Alec/
The first formula needs to be corrected - the sum in the left hand side should be not from 1 to n, but from 1 to n-1. For that corrected formula B1 = -1/2 gives the correct answer. There is another way to correct the formula, leaving the sum from 1 to n in the left hand side, but multiplying the summand in the right hand side by (-1)pwr+1-i. That leaves terms Bm with even m unchanged and changes the sign of the term with B1. Anyway, the standard value of B1 is -1/2. __________ Alec Mihailovs http://mihailovs.com/Alec/
First 148 149 150 151 152 153 154 Last Page 150 of 180