John May

Dr. John May

2351 Reputation

17 Badges

12 years, 75 days
Maplesoft
Guru
Pasadena, California, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I am a Senior Developer in the Mathematical Software Group and have been with Maplesoft since 2007. I am also an Adjunct Assistant Professor in the School of Computer Science at the University of Waterloo.

I have a Ph.D in Mathematics from North Carolina State University as well as Masters and Bachelors degrees from the University of Oregon. I have been working on research in computational mathematics since 1997.

My main research interests in are computational linear and polynomial algebra, especially numerical polynomial algebra. I currently work on the exact algebraic solvers as well as other subsystems of Maple.

MaplePrimes Activity


These are replies submitted by John May

It should be noted that the conditions can be simplified: the `and` is unnecessary since piecewise branches are evaluated from first to last:

Compare:

(**) n:=3;
(**) simplify(  piecewise(seq(op([q-1<=t and t<q, f[q](t+1-q)[i][j]]),q=1..n), 0) );
(**) piecewise(t<0, 0, seq(op([t<q, f[q](t+1-q)[i][j]]),q=1..n), t>=n, 0);

It should be noted that the conditions can be simplified: the `and` is unnecessary since piecewise branches are evaluated from first to last:

Compare:

(**) n:=3;
(**) simplify(  piecewise(seq(op([q-1<=t and t<q, f[q](t+1-q)[i][j]]),q=1..n), 0) );
(**) piecewise(t<0, 0, seq(op([t<q, f[q](t+1-q)[i][j]]),q=1..n), t>=n, 0);

This appears to be a bug in the '!!!' button.  I will make sure it is reported.  

This appears to be a bug in the '!!!' button.  I will make sure it is reported.  

Just to expand a little.  It is possible to discover the equivalence of "find" and ?ArrayTools[SearchArray] using ?Matlab,FromMatlab

(**) Matlab:-FromMatlab("find(X)", evaluate=false);
#                          ArrayTools:-SearchArray(X)

Just to expand a little.  It is possible to discover the equivalence of "find" and ?ArrayTools[SearchArray] using ?Matlab,FromMatlab

(**) Matlab:-FromMatlab("find(X)", evaluate=false);
#                          ArrayTools:-SearchArray(X)

Ah! I tried every possible entry method except 1-D input in Document mode.

Ah! I tried every possible entry method except 1-D input in Document mode.

I can't replicate this in my local install of Maple 14 in 64 bit Linux:



kernelopts(version);

(1)

restart; printlevel:=100; for i from 1 to 2 do for j from 1 to 2 do k:=i+j end do end do;

 

 

 

 

(2)

 

 

 

 

(3)

 



Download printlevel_test.mw

What platform are you using?

 

I can't seem to replicate this as a bug. In Maple 14,

solve({b4*y^3+b1*x*y^2+b2*x^2*y+b3*x^3, a*y+a1*x+a2*x*y+a3*x^2+a4*y^2}, {x,y});

gives me the same answer as Maple 13 in both 32 and 64 bit Linux.  Are you on a different platform?

I can't seem to replicate this as a bug. In Maple 14,

solve({b4*y^3+b1*x*y^2+b2*x^2*y+b3*x^3, a*y+a1*x+a2*x*y+a3*x^2+a4*y^2}, {x,y});

gives me the same answer as Maple 13 in both 32 and 64 bit Linux.  Are you on a different platform?

Without declaring A first, the assignment "A[i,j]:=lcm(i,j):" implicitly creates a table.  In a case like this example, you know how big your data is, and you know you want it in a Matrix in the end, so you can avoid all the post-processing and table creation overhead by either 1. declaring A to be a matrix before the loop (i.e. "A := Matrix(10,10, 0);") or 2. (preferred) construct A using the Matrix constructor:

A := Matrix(10,10,lcm);

and avoid the loop entirely.

@Clare So I'll be impressed if you can render pac-man navigating his entire maze.

@Robert Israel Oops!  There appears to have been a cut and paste malfunction.  PP actually has a small circle in the middle of the path, so it is a little more complicated than that:

PP := 
[piecewise(t < 0, -(1/8)*t^2,
           t < .8*Pi, -(2/15)*cos(t)*(30*sin(t)+60*sin(t)*cos(t)^6-90*sin(t)*cos(t)^4),
           t < Pi, (1/10)*sin(10*t-8.0*Pi)+.5242497001,
                  -(2/15)*cos(t+.2*Pi)*(-30*sin(t+.2*Pi)-60*sin(t+.2*Pi)
*cos(t+.2*Pi)^6+90*sin(t+.2*Pi)*cos(t+.2*Pi)^4)), piecewise(t < 0, t, t < .8*Pi, 4*sin(t)^2, t < Pi, (1/10)*cos(10*t-8.0*Pi)+.381966011,
 4*sin(t+.2*Pi)^2), piecewise(t < 0, t, 0) ];

I also editted my original post with the correct value of PP to create the plot

@hirnyk I was hoping for daily birth data from Australia, but I used the monthly data you posted to plot Austrailian births from 1998-2007 (2008 Decemeber numbers looked incomplete) renormalized, fit with a curve (using ?CurveFitting,Spline ), and overlaid on the US data:

To my eye it looks a little less seasonal perhaps due to seperate winter and Christmas/New Year conception spikes? (the white month labels at the bottom are the approximate months of conception)

Heres the new worksheet: birthday-distributi.mw

5 6 7 8 9 10 11 Last Page 7 of 19