JoyDivisionMan

5 Reputation

2 Badges

4 years, 98 days

MaplePrimes Activity


These are questions asked by JoyDivisionMan

I am doing some work in Maple.  Specifically, I run the following commands in Maple worksheet mode:

with(Statistics);
L := abs(RandomVariable(UniformDistribution(0, 1)) - RandomVariable(UniformDistribution(0, 1)));
Export("LineDensity.jpg", DensityPlot(L));
PDF(L, x);

Everything works fine.  When I export these commands into an MPL script, I get the following:

with(Statistics);
L := abs(RandomVariable(UniformDistribution(0, 1)) - RandomVariable(UniformDistribution(0, 1)));
Export("LineDensity.jpg", DensityPlot(L));
PDF(L, x);
NULL;

When I execute this script, I get the following error message:

Warning: persistent store makes readlib obsolete
Error: (in Export) exported file LineDensity.jpg could not be created

I need to do the work in MPL script form so that I can have larger problems processed.  Does anyone know why I would be having this problem with the Export function?  

I am looking to find a distribution function (both PDF and CDF) for the distance between two points on the unit square.

Each point will be uniformly distributed on the [0,1] interval for both the x and y axes.  The distance between these points (dij) will of course be:

d[i, j] := sqrt((x[i] - x[j])^2 + (y[i] - y[j])^2)

I think that using a convolution may be required, but this is over my head.  If anybody can show me (preferably via a Maple worksheet), I would be very appreciative.

Thank you.

Page 1 of 1