Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 337 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

In Maple 11, you could also use zip to avoid typing the recolor command several times,

plots:-display(zip(recolor,[p1,p2],[red,yellow]));

Alec

Hi Jennifer,

Thank you for your nice follow-up.

I thought that I was logged-in (as a Maplesoft member) leaving the comment, so my email should be available. That, actually, seems like a good idea to have a field for the email address in the form, so that the email sent to developers from the form was cc'd to that email address. That might have some relay (and anonymous spamming) problems though, so emailing to the email in the database for logged-in members seems more safe. Certainly, I could copy my comment and email it to myself manually (and the same after filling an SCR), but such a feature would save some time and effort.

Not that I demand a personal response, just I'd like to have a copy of my comment, so that the formulas (and other things) from it could be easily copied and pasted somewhere else if necessary.

MSDN is a good example - not only the comment get emailed, but it also stays on the help page (in the Comments section), so that other people, not only developers, could use it immediately, reply to it etc.

Edit: I've read the Friday's email. Thank you for emailing it. It has the login information at the bottom. including email, as I expected.

Best wishes,
Alec

The following seems to be also working,

removecolor:=p->eval(p,COLOUR=NULL);

as well as

removecolor:=rcurry(eval,COLOUR=NULL);

COLOR=NULL also can be aded if necessary. The latter form can be used on several plots without ~, as removecolor(p1, p2) for example (see my recent eval with rcurry post).

The disadvantage of that is that only one new color can be added by the display command, so for changing colors in both p1 and p2 to different colors, one has to use display with removecolor and color for p1, then display with removecolor and color for p2, and then another display for displaying both of them. Joe Riel's recolor procedure allows using display command only once.

Alec

The following seems to be also working,

removecolor:=p->eval(p,COLOUR=NULL);

as well as

removecolor:=rcurry(eval,COLOUR=NULL);

COLOR=NULL also can be aded if necessary. The latter form can be used on several plots without ~, as removecolor(p1, p2) for example (see my recent eval with rcurry post).

The disadvantage of that is that only one new color can be added by the display command, so for changing colors in both p1 and p2 to different colors, one has to use display with removecolor and color for p1, then display with removecolor and color for p2, and then another display for displaying both of them. Joe Riel's recolor procedure allows using display command only once.

Alec

Which can be also done without using the display command, as

plot([sin,cos],color=[blue,green]);

Alec

Which can be also done without using the display command, as

plot([sin,cos],color=[blue,green]);

Alec

Using PDF, the expected value can be calculated as

f:=piecewise(x<-10,0,Statistics:-CDF(Normal(0,10),x));
pdf:=diff(convert(f,Heaviside),x);

E:=int(pdf*x,x=-infinity..infinity);

                                1/2                 1/2
                               2       5 exp(-1/2) 2
               E := -5 + 5 erf(----) + ----------------
                                2             1/2
                                            Pi

evalf(%);

                             0.833154704

Using integration by parts, the formula for the general 'Stop' case can be written as E=Stop+int(1-CDF(x),x=Stop..infinity). In this example that gives

-10+int(1-f,x=-10..infinity);

                  /     1/2                                \
                  |    2       1/2     1/2              1/2|
                5 |erf(----) Pi    + Pi    + exp(-1/2) 2   |
                  \     2                                  /
          -10 + --------------------------------------------
                                     1/2
                                   Pi

expand(%);

                             1/2                 1/2
                            2       5 exp(-1/2) 2
                 -5 + 5 erf(----) + ----------------
                             2             1/2
                                         Pi

The same answer.

Alec

Using PDF, the expected value can be calculated as

f:=piecewise(x<-10,0,Statistics:-CDF(Normal(0,10),x));
pdf:=diff(convert(f,Heaviside),x);

E:=int(pdf*x,x=-infinity..infinity);

                                1/2                 1/2
                               2       5 exp(-1/2) 2
               E := -5 + 5 erf(----) + ----------------
                                2             1/2
                                            Pi

evalf(%);

                             0.833154704

Using integration by parts, the formula for the general 'Stop' case can be written as E=Stop+int(1-CDF(x),x=Stop..infinity). In this example that gives

-10+int(1-f,x=-10..infinity);

                  /     1/2                                \
                  |    2       1/2     1/2              1/2|
                5 |erf(----) Pi    + Pi    + exp(-1/2) 2   |
                  \     2                                  /
          -10 + --------------------------------------------
                                     1/2
                                   Pi

expand(%);

                             1/2                 1/2
                            2       5 exp(-1/2) 2
                 -5 + 5 erf(----) + ----------------
                             2             1/2
                                         Pi

The same answer.

Alec

I've just noticed the number of reads in forums, too, under the first post in the thread. My track (in my account) has more than 40 pages, with 25 different threads on a page. Some of them were viewed more than 10,000 times. Few random chosen showed just 3,000 or 4,000. The recent ones less, for obvious reasons, but still close to a 1,000 (again, randomly chosen). If this site wasn't that damn slow, it wouldn't be that hard to get the exact total count (using Sockets package). My estimate still is that it would be a few millions.

Alec

That works even without collect and simplify,

evalc((a+b*I)^k+(a-b*I)^k) assuming positive;

                             2    2
             2 exp(1/2 k ln(a  + b )) cos(k arctan(b/a))

expand(%);

                     2    2 (k/2)
                 2 (a  + b )      cos(k arctan(b/a))

In the second example that can be done as

with(inttrans):

invztrans(ztrans(a^k*cos(w*k),k,z),z,k);
                                k                              k
     1/2 (cos(w) a - a sin(w) I)  + 1/2 (cos(w) a + a sin(w) I)

evalc(%) assuming a>0, w>0, w<Pi/2;

                        2  2    2       2
     exp(1/2 k ln(cos(w)  a  + a  sin(w) )) cos(k arctan(tan(w)))

simplify(%,symbolic);

                              k
                             a  cos(w k)

Alec

That works even without collect and simplify,

evalc((a+b*I)^k+(a-b*I)^k) assuming positive;

                             2    2
             2 exp(1/2 k ln(a  + b )) cos(k arctan(b/a))

expand(%);

                     2    2 (k/2)
                 2 (a  + b )      cos(k arctan(b/a))

In the second example that can be done as

with(inttrans):

invztrans(ztrans(a^k*cos(w*k),k,z),z,k);
                                k                              k
     1/2 (cos(w) a - a sin(w) I)  + 1/2 (cos(w) a + a sin(w) I)

evalc(%) assuming a>0, w>0, w<Pi/2;

                        2  2    2       2
     exp(1/2 k ln(cos(w)  a  + a  sin(w) )) cos(k arctan(tan(w)))

simplify(%,symbolic);

                              k
                             a  cos(w k)

Alec

Under the first post in the blog, too (right over the Comments).

Alec

As Robert Israel pointed out in another thread, for the beginners (with Maple), it is better, probably, use 1D input instead of 2D, unless it is absolutely necessary.

Alec

As Robert Israel pointed out in another thread, for the beginners (with Maple), it is better, probably, use 1D input instead of 2D, unless it is absolutely necessary.

Alec

In blog posts.

In particular, my 35 blog posts were viewed 114,226 times, averaging 3263.6 views per post. Not quite 2,000,000, but it is only 35 posts out of my 2,000+ total posts here.

Alec

First 47 48 49 50 51 52 53 Last Page 49 of 180