MaplePrimes Questions

I often use DocumentTools:-Tabulate or  DocumentTools:-Layout do display a vector or matrix of plots instead of plots:-display. because I find the latter less practical.
But it seems that the 'background' option is not correctly managed with DocumentTools:-Tabulate or  DocumentTools:-Layout.
The attached file shows that:

  • the 'background' option is correctly managed if each "view" contains a single plot,
  • but not correctly as soon as at least one "view" contains morethan one plot.

DocumentTools_and_Background.mw

How can I get with DocumentTools:-Tabulate  /  DocumentTools:-Layout the same rendering I get with plots:-display?

Hi,

I'm looking for a harmonized layout for my weighted probability trees. Are there any possibilities to improve this code?

Thanks

Arbrepondéré.mw

Good day everyone, 

How can I extract the values of x and y for plotting? 

The worksheet is attached below. Thanks

dont_get_it.mw

I couldn't locate a command to change the default frames per second (fps) of 10.  Is there an option?

The solve function is able to solve inequalities and return solutions that satisfy the inequalities. Unfortunately, it appears that for some toy problems, this command does not always perform efficiently
 

restart;

eqns__1 := {x >= 0, y >= 0, z >= 0, x*y*z+x^2+y^2+z^2 <= 2*(x*y+x*z+y*z), 2*(x^2+y^2+z^2) < x^2*y+x*z^2+y^2*z-27}

eqns__2 := {x > 0, y > 0, z > 0, x*y*z+x^2+y^2+z^2 <= 2*(x*y+x*z+y*z), 2*(x^2+y^2+z^2) <= x^2*y+x*z^2+y^2*z-27}

timelimit(0.1e2, :-solve(eqns__1, [x, y, z], AllSolutions))

timelimit(0.1e2, :-solve(eqns__2, [x, y, z], AllSolutions))

Error, (in RegularChains:-TRDcadEvalBox) time expired

 

Error, (in RegularChains:-TRDexquo) time expired

 

timelimit(0.1e2, MTM:-solve(eqns__1[], [x, y, z][]))

timelimit(0.1e2, MTM:-solve(eqns__2[], [x, y, z][]))

Warning, solving 5 equations for 3 variables

 

Error, (in sdmp:-mul) time expired

 

Warning, solving 5 equations for 3 variables

 

Error, (in RegularChains:-TRDcadMultiplyInterval) time expired

 

timelimit(0.1e2, RealDomain:-solve(eqns__1, [x, y, z]))

timelimit(0.1e2, RealDomain:-solve(eqns__2, [x, y, z]))

Error, (in RegularChains:-TRDcadIsIntervalNormal) time expired

 

Error, (in RegularChains:-TRDnext_sub_resultant2) time expired

 

timelimit(0.1e2, PDEtools:-Solve(eqns__1, [x, y, z]))

timelimit(0.1e2, PDEtools:-Solve(eqns__2, [x, y, z]))

Error, (in RegularChains:-TRDsub_resultant_chain_monomial_basis) time expired

 

Error, (in modp1/DistDeg) time expired

 

plots['implicitplot3d']([x*y*z+x^2+y^2+z^2 <= 2*(x*y+x*z+y*z), 2*(x^2+y^2+z^2) < x^2*y+x*z^2+y^2*z-27], x = 0 .. 6, y = 0 .. 6, z = 0 .. 6, lightmodel = "light1", orientation = [125, 105, 180], style = "patchnogrid")

 


 

Download x=y=z=3.mw

So none of them is capable of giving a complete description of the region defined by or  with a time limit of "ten seconds". (I believe that completing the evaluation may take a much long time; actually, if there is no constraint on the real time allowed, the symbolic solver will be stuck.) (Note that here it is not hard to find individual instances of values of variables that satisfy them (for example, via the 3-D region boundary plot above), yet they provide less insight into all solutions that exist.)
But in my view,  are too long for these two special systems.

Can Maple solve them more quickly at present? 

> eqns__1 := {x^2+y^2+z^2+x*y*z <= 2*(y*z+z*x+x*y), 2*(x^2+y^2+z^2) < y^2*z+z^2*x+x^2*y-27, x >= 0, y >= 0, z >= 0};
> eqns__2 := {x^2+y^2+z^2+x*y*z <= 2*(y*z+z*x+x*y), 2*(x^2+y^2+z^2) <= y^2*z+z^2*x+x^2*y-27, x > 0, y > 0, z > 0};

(It seems that a potential difficult part for Maple is likely attributable to proving completeness of the solution ….)

Hi,

I am testing a graph with the annotation option. In example.1, When I hover over the curve of 'f,' the expression appears instead of the name.

Ideas ? thanks

AnnotationDérivées.mw

(While using Maple 2015 this question concerns any other Maple versions)

I hesitated on the title to write and my first idea was to write "How to modify a built-in functions without making a mess?".
I finally changed my mind in order not to orient the answers in a wrong way.

So this question is about the construction of multi-variate distributions and concerns only the Statistics package.
Here are some of the attributes of a univariate random variable that Maple recognizes, and it is quite normal to expect that the construction of a multi-variate random variable (MVRV for short) distribution should get, at least, some of them.

X := RandomVariable(Normal(a, b)):
map(a -> printf("%a\n", a), [exports(attributes(X)[3])]):
Conditions
ParentName
Parameters
CharacteristicFunction
CDF
CGF
HodgesLehmann
Mean
Median
MGF
Mode
PDF
RousseeuwCrouxSn
StandardDeviation
Support
Variance
CDFNumeric
QuantileNumeric
RandomSample
RandomSampleSetup
RandomVariate
MaximumLikelihoodEstimate

If the distribution is continuous the PDF is fundamental in the sense it enables constructs all the other statistics (=attributes) of a MVRV.
But it is nice to use integrated functions, such as Mean, Support, PDF, and so on, to get the expressions or values of these statistics instead of computing them from this PDF.
Let's that I prefer doing this

MyNormal := proc(m, v)
  description "Reparameterized Normal randomvariable, m=mean, v=variance":
  Distribution(
    PDF = (t -> exp(-1/2*(x-m)^2/v)/sqrt(2*Pi*v))
    , Conditions = [Sigma > 0]
    , Mean =m
  )
end proc:

X := RandomVariable(MyNormal(mu, Sigma)):
Mean(X)
                              m

than doing this

MyNormal := proc(m, v)
  description "Reparameterized Normal randomvariable, m=mean, v=variance":
  Distribution(
    PDF = (t -> exp(-1/2*(x-m)^2/v)/sqrt(2*Pi*v))
    , Conditions = [Sigma > 0]
  )
end proc:

X := RandomVariable(MyNormal(mu, Sigma)):
Mean(X);  # of course undefined
mean := int(PDF(X, x), x=-infinity..+infinity) assuming Sigma > 0
                           undefined
                           mean := 1

So, while all the statistics can be recover from the CDF (provided it exists), it's nicer to define these statistics within the Distribution structure (as in the first construction above).

Now some problems appear when you want to construct the Distribution structure for a MVRV.
The attached file contains the construction of MVRV whose ecah components are mutually independent (to keep the things simple) and both have a Unifom distribution.

MV_Uniform.mw

Here are some observations:

  • Defining a multi-variate PDF goes without problems.
  • Defining the Mean (or many other algebraic or numeric statistics) presents a difficulty related to the type of the arguments the build-in function Mean is aimed to recieve.
    But a workaround, not very elegant, can be found.
  • The case of the Support seems unsolvable: I wasn't able to find any workaround to define the support of a MVRV.
  • I did not consider the Conditions attribute, but I'm not sure that, in the case of, let's say, a bi-gaussian random variable I would be capable to set that the variance is a symmetric positive-definite matrix?

I feel like the main restriction to define such MVRV distributions is the types used in the buid-in functions used in the Distribution structure.

Does anyone have an idea to tackle this problem?

  • Are we doomed to use workarounds like the one I used for defining the MVRV mean?
  • Can we modify the calling sequence of some build-in functions without making a mess and keep them working on build-in distributions?
  • Must we overload the construction of these build-in functions?
    Doing for instance:
    restart:
    with(Statistics):
    local Mean:
    Mean := proc(...) ... end proc

Thanks in advance for any suggestion and help.

I’m on a Mac running Ventura 13.4.1 and Maple 2022. 

My plots now have axes and labels that are tiny. It seems like that possibly happened with one of the recent OS updates
Below is a graph of
with(plots): implicitplot3d(3x+2y+4z=2);

It renders the same if I use 
implicitplot3d(3x+2y+4z=2, axesfont=["TimesNewRoman", 12], labelfont = ["TimesNewRoman", 12]);

I can to change the 12 to much larger to see them. But I never used to have to do that before. Does anyone know if this is an OS issue? Is there a global setting I can change? 

So far I have only noticed them for special functions.