Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

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

Social Networks and Content at Maplesoft.com

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 answers submitted by Alec Mihailovs

Such (or very similar) procedure already exists in geometry package. It is called RegularPolygon. It also includes radius that you didn't mention.

Assuming, for example, that the radius is 1, the procedure that you described, can be written as

poly:=proc(n::posint,a,b) 
local p,o;
uses geometry;
RegularPolygon(p,n,point(o,a,b),1);
draw(p) end;

The list of polygons can be drawn as

plots[display](seq(poly(10,i,i),i=0..20));

Alec

Add 'assuming real' (without quotes) at the end of your last command. Without that, Maple assumes that your variables are complex.

Also, instead of exp(1)^something , it is better to use exp(something).

Alec

convert(pochhammer(z,n),GAMMA);

                             GAMMA(n + z)
                             ------------
                               GAMMA(z)

Alec

Depending on the situation, the following also might work,

ode:=p(x,a)* diff(w(x),x$2) + q(x,a)* diff(w(x),x$2) + r(x,a)* w(x);

                    / 2      \
                    |d       |           /d      \
     ode := p(x, a) |--- w(x)| + q(x, a) |-- w(x)| + r(x, a) w(x)
                    |  2     |           \dx     /
                    \dx      /

subs(diff(w(x),x$2)=1, diff(w(x),x)=0, w(x)=0, ode);

                               p(x, a)

subs(diff(w(x),x$2)=0, diff(w(x),x)=1, w(x)=0, ode);

                               q(x, a)

subs(diff(w(x),x$2)=0, diff(w(x),x)=0, w(x)=1, ode);

                               r(x, a)

Alec

The best, probably, would be just to use (Standard) Maple instead of a Maplet. While 2D-input also has various problems, it is easier than in MathML Editor. And Maple has to be used anyway to run a Maplet.

Alec

You could use readstat command, but it is better to write a simple Maplet for such a sort of an interaction.

Alec

Also, MTM:-sum can be used. It actually calls AddAlongDimension, but it is less to type,

M:= Matrix(3,[1,2,3,4,7,9,5,7,11]);

                              [1    2     3]
                              [            ]
                         M := [4    7     9]
                              [            ]
                              [5    7    11]

MTM:-sum(M,2);

                                 [ 6]
                                 [  ]
                                 [20]
                                 [  ]
                                 [23]

Alec

Well. all of this sounds as Mathematica 7 is coming on Monday. Are we too old?

Alec

Edit (11/21/08): I'm absolutely sure I didn't post that (as well as a few other posts attributed to me last Friday). Alec

The terms of the sum in your example are nonnegative and one of them (1) is positive, unless you mean complex values of x. For real x, this sum is positive, so it can not be 0.

Alec

It is more convenient to use a permgroup representation. That can be done as

with(group):

G:=grelgroup({u,v,w},{[u,v,u,1/w],[v,u,v,1/w],[u,u],[v,v],[w,w]}):

pg:=permrep(subgrel({},G));

  pg := permgroup(6, {u = [[1, 2], [3, 6], [4, 5]],

        v = [[1, 3], [2, 5], [4, 6]], w = [[1, 4], [2, 6], [3, 5]]})

g:=elements(pg);

  g := {[], [[1, 5, 6], [2, 3, 4]], [[1, 6, 5], [2, 4, 3]],

        [[1, 2], [3, 6], [4, 5]], [[1, 3], [2, 5], [4, 6]],

        [[1, 4], [2, 6], [3, 5]]}

nops(g);

                                  6

Now, the function on GxGxG can be defined using a 3-dimensional Array if one wishes. For example,

f:=Array((1..6)$3,(i,j,k)->nops(g[i])+nops(g[j])+nops(g[k])):

f(1,2,3);

                                  4

Of course, it can be defined in a usual way as well, as

F:=(i,j,k)->nops(g[i])+nops(g[j])+nops(g[k]):

F(1,2,3);

                                  4

in this example

Alec

For me, the problem with that is that I have to join LinkedIn for that, which I don't want to do. It is similar to joining Yahoo that we had to do earlier for a few Maple related groops started there by Carl DeVore.

Another possibility (that I personally prefer), is to post in Maple Wiki. One doesn't have to join any commercial organizations for that, and it is independent from Maplesoft.

By the way, it would be good if Maplesoft added a link to Maple Wiki somewhere on its site. That could attract a few more people interested in wiki to it.

Alec

 

When I studied that in high school, it was done as follows. First, few plots y=2^x, y=3^x, y=4^x etc. were plotted, together with their tangents at 0, and one could see visually that the slope, i.e. the derivative of y=2^x at 0 is less than 1, and the derivative of y=4^x at 0 is greater than 1. Then, one can prove that if the derivative of y=b^x (with b>0) at 0 is c, then the derivative of y=b^(kx) at 0 is kc (by substituting kh instead of h in the limit for the derivative of y=b^x at 0.) 

If c<>0. for k=1/c that gives the derivative 1 at 0. That can be used as a definition of e as the unique positive number such that the derivative of e^x at 0 is 1.

Now, for b=e, the derivative of e^(kx) at 0 is k, and since a=e^(ln a), that gives the value ln(a) for the derivative of y=a^x at 0.

Alec

 

Do you have some initial conditions?

Such as values y[1](0), y[2](0),...

What is beta?

Alec

One can write a procedure for doing usual plot first, then changing plotsetup and outputting it as a file. The problem, however, is with file names. Something like iolib(25) can be used for that, but then you would have problems with finding the correct plot. It is better, probably, just export them after plotiing (click right mouse button, then Export etc.)

Another (maybe, better) option is to export the whole worksheet as HTML, after you finish it (from the File menu). Then all plots will be exported as gifs, 2D-output (and, maybe, input if you used it), also will create gifs though. I didn't try HTML with MathML option. This might export only plots as gifs and put all the 2D-stuff inside HTML as MathML.

Alec

Did you try phi instead?

plot(x^2, legend = phi)

Or type varph and click Ctrl+Space

Alec

First 48 49 50 51 52 53 54 Last Page 50 of 76