Alec Mihailovs

Dr. Aleksandrs Mihailovs

4475 Reputation

21 Badges

20 years, 43 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 answers submitted by Alec Mihailovs

Manually.

For example, in Classic Maple,

with(plottools):
with(plots):
display(polygon([[0,0], [3,4], [3,1]]), 
textplot({[0.4,0.3,1],[2.87,3.6,2],[2.87,1.18,3]}),
axes=none);

In Standard Maple that produces a polygon filled black, so you have to add color=white in the polygon arguments, to make it white.

Alec

parse(sprintf("%.3f",subs(x=1, rhs(pdf))));

                                2.718

plot(rhs(pdf),x=0..1);

Alec

The modern way is

with(DifferentialGeometry):
DGsetup([x],M):
ExteriorDerivative(x^2);

                                2 x dx

Alec

For example,

Ls:=n->seq(a[j],j=2..n):
Ls(5);

                        a[2], a[3], a[4], a[5]

To paste, as I did above, 2 methods are available (from Classic or command line). One - switch from Paragraph to Preformatted in the drop-down list in the editor's toolbar. Another one - click HTML in the top left corner of the editor, type <pre> before pasted text and </pre> after.

In Windows, copying can be done by selecting a region in the worksheet and clicking Ctrl+C (2 keys, Ctrl and C simultaneously), and pasting can be done by clicking Ctrl+V.

In command line in Windows - select a region and click Enter for copying it.

Copying and pasting in Standard are broken, so that shouldn't be done from Standard. It's developers have a different idea what "Copy" means than us - whether they think that it means "Evaluate", "Rewrite in a different format", or "Show a description" - who knows, but it's definitely not a copy.

Also, one can insert the entire worksheet. Save it first, then click the upload button (green arrow up at the end of the second row in the editor's toolbar), then browse, upload, and insert it - should be self-evident.

Finally, one can "view the the" (yes, with 2 the) MaplePrimes Help link over the editor.

Alec

Not sure about Maple, but it can be easily done in matplotlib. And not only horizontal-vertical, but with any angle, any font size etc. See also another example, another one, and many others in the gallery.

And it's free!

Alec

Do the following before using AllPairsDistance command,

interface(rtablesize=25):

Alec

I've just produced the following picture in Maple using cubic Hermite splines,

Is it what you wanted?

_______________
Alec Mihailovs, PhD

PS I put the procedures in a separate post. -Alec

Hire a couple of burglars who would go into the Maplesoft headquarters in the middle of the night and steal the C-code from there. 

Or torture Roman Pearce until he discloses it.

Alec

You could try a Hermite interpolation and a proper Hermite spline (which, probably, would require more data entered).

It's easier in Mathematica,

L = {3, 4, 6, 7, 2, 3, 5, 4, 6, 8, 20, 4, 5, 12, 0, 5, 5, 5, 3};

Show[Plot[ListInterpolation[L][x], {x, 1, 19}], ListPlot[L]]

Alec

A simple way is

plot3d(4-x^2,x=0..2,y=2..5, axes=box, view=[0..2,0..5,0..4]);

int(int(4-x^2,x=0..2),y=2..5);

                                  16

_______________
Alec Mihailovs, PhD

The plot can be done as follows,

plots:-display(
plot3d(sqrt(4.00001-max(x^2,y^2)),x=-2..2,y=-2..2),
plot3d(-sqrt(4.00001-max(x^2,y^2)),x=-2..2,y=-2..2),
scaling=constrained);

It is obviously not a sphere.

And the volume can be found either manually or in Maple as it is described in the Math Forum, or in many other standard ways. For example, as

16*int(int(sqrt(4-x^2),y=0..x),x=0..2);

                                128/3

_______________
Alec Mihailovs, PhD

f:=proc(k,size,h)
local L,U,s;
uses Statistics;
s:=size-1.;
L:= s-10*sqrt(2*s);
U:= s+10*sqrt(2*s);
evalf(Int(Int(CDF(Normal(0, 1), h/sqrt(s*(1/x+1/y)))*
PDF(ChiSquare(s), x), x = L .. U, method=_Dexp)^(k-1)*
PDF(ChiSquare(s), y), y = L .. U, method=_Dexp))
end:

f(8,5000,3.1);

                             0.9046870285

f(8,50000,3.1);

                             0.9047965055

_______________
Alec Mihailovs, PhD

In addition to 2 ways suggested by Kamel, that could also be done in this particular example as

h:=2*[$1..10];

              h := [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

h:=[seq(2..20,2)];

              h := [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

for i to 10 do u[i]:=2*i od:
h:=convert(u,list);

              h := [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

In many cases, Vectors are more convenient than lists. In this particular example, the corresponding Vectors can be created as

H:=Vector(10,i->2*i);

or

H:=Vector(10):
for i to 10 do H[i]:=2*i od:

_______________
Alec Mihailovs, PhD

Not a bug - you have to quote the summand to avoid the so-called "premature evaluation"

A:=Matrix(7):
sum('A[i, i]', i = 1 .. 7);

                                  0

To understand that, one has to know that usually the arguments of Maple procedures, such as sum, are evaluated (once) before executing the procedure - and in this example A[i,i] is not defined for a letter i, which produces that error message. With quotes, 'A[i,i]' evaluated once just removes the quotes resulting in A[i,i] - no error.

eval(A[i,i],1);
Error, bad index into Matrix

eval('A[i,i]',1);

                               A[i, i]

The add is an exception - the arguments of it (at least the first argument) are not evaluated before its execution, so it doesn't produce the error message.

Besides, there is a special Maple command for that,

LinearAlgebra:-Trace(A);

                                  0

_______________
Alec Mihailovs, PhD

4 5 6 7 8 9 10 Last Page 6 of 76