Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

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

What's wrong with using R?

Alec

`&/`:=(a,b)->b(a):

int(sin(x),x=0..Pi)&/evalf;

                                  2.

int(sin(x),x=0..Pi/4)&/evalf[20];

                        0.29289321881345247560

123456789 &/ifactor;
                            2
                         (3)   (3803)  (3607)

In general, the parentheses may be necessary (because one can't set priorities of new operators in Maple)

(x^4+4)&/factor;
                      2              2
                    (x  - 2 x + 2) (x  + 2 x + 2)

((x+1)^2) &/expand;
                              2
                             x  + 2 x + 1

Alec

For example,

Student:-Calculus1:-RiemannSum(sin(x),x=0..Pi/4,
output=sum,method=right);
                              / 10            \
                              |-----          |
                              | \        i Pi |
                      1/40 Pi |  )   sin(----)|
                              | /         40  |
                              |-----          |
                              \i = 1          /

evalf(%);

                             0.3205106625

int(sin(x),x=0..Pi/4.);

                             0.2928932188

Alec

Why not? End your expression with : evalf(%);

For example,

sin(2)+sin(3): evalf(%);

                             1.050417435

Alec

Click right button on the launch.ini in Windows explorer, select Properties, then Security. Click Edit and add write permissions for yourself.

Alec

  1.  Type the equation in the worksheet, using / for over and right arrow to return back from it.
  2. With mouse pointer over the equation, click the right mouse button and select Manipulate Equation

Then, in the first case, do "Group terms on the left side", then "Clear denominators", then "Add 85 to equation", then "Multiply equation by 1/96".

In the second case, "Clear denominators" and "Multiply equation by -1"

Alec

What do you mean by base 5?

Alec

Here is the implementation of the wikipedia's Method 1,

fBm:=proc(H,t)
local X,G,s,v,n;
uses Statistics, LinearAlgebra;
n:=Count(t);
X:=RandomVariable(Normal(0,1));
G:=Matrix(n,(i,j)->(t[i]^(2*H)+t[j]^(2*H)-abs(t[i]-t[j])^(2*H))/2);
s:=LUDecomposition(G,method=Cholesky);
v:=Sample(X,n);
s.v^%T
end;

t here is a list or a Vector of t1, t2, ..., tn. For example,

t:=[$1..100]:
S:=fBm(0.75,t);

                       [ 100 Element Column Vector ]
                  S := [ Data Type: float[8]       ]
                       [ Storage: rectangular      ]
                       [ Order: Fortran_order      ]

plot(t,S);

Alec

It works for any H from 0 to 1.

The correlation matrix is always positive (semi)-definite, even if some of its elements are negative.

Alec

Wikipedia article has 2 methods of fBm simulation (at the end.) The first one can be easily programmed in Maple. Did you try it?

Alec

 

Try that with y*x instead of yx.

Alec

I almost suggested to read the help page ?plot,details , but then read it myself and found it rather confusing. Also, with a typo - plot([expr1, expr2, t=c..d) at the beginning of the Using the Parametric Form section, should contain ]  close to the end, plot([expr1, expr2, t=c..d]). Not surprising that people have problems understanding that.

Alec

Set infolevel to something like

infolevel[all]:=10;

If that is not enough, printlevel also can be increased,

printlevel:=100;

or

printlevel:=1000;

Alec

Here is an example of a procedure creating a midi (type 0) file from a list of integers from 0 to 7,

midi0:=proc(f,L)
local m,n,c;
n:=nops(L);
c:=[60, 62, 64, 65, 67, 69, 71, 72];
m:=[77, 84, 104, 100, 0, 0, 0, 6, 0, 0, 0, 1, 0, 128, 77, 84, 114, 107, 
ListTools:-Reverse(convert(2^32+7*n+5,base,256))[2..-1][], 
0, 144, c[L[1]+1], 96,
seq([129,0,c[L[i]+1],0,0,c[L[i+1]+1],96][],i=1..n-1),
129,0,c[L[-1]+1],0,0,255,47,0];
writebytes(f,m);
close(f)
end;

It works as midi0("filename.mid",listname). For example,

L := [3,2,1,2,3,3,3,2,2,2,3,5,5];

midi0("mymidi.mid",L);

Alec

PS See also my blog entry with slightly modified procedure, allowing to change the instrument from the default (piano), to a guitar, a violin, etc. -Alec

The simplest way, probably, is to write a midi file in binary. Maple can be used for that.

The Skytopia crash course (written by Daniel White) rather clearly explains how the resulting midi file should look.

Alec

 

First 42 43 44 45 46 47 48 Last Page 44 of 76