sand15

1643 Reputation

16 Badges

11 years, 197 days

MaplePrimes Activity


These are replies submitted by sand15

@Mac Dude 

Meanwhile here is slight variant of my Histogram3D procedure described in my previous reply (usable for both dependent and independent random variables).

I also included a new feature to draw the equivalent of what plots:-densityplot does for functions. The code is very simple but strongly benefits from @acer's help, see HERE.

NOTE: In my code (I forgot to mention it uses Maple 2015) I used the first method acer proposed (in the code below his piece of code is reproduced in green highlighted b
lue font: it should be easy for you to locate it and replace it by one of the other solutions acer proposed, depending on your Maple version).

3DHist_3DDensity_2.mw



As I told you before one can get far better rendering for both the histogram and, in case this would interest you, the density plot.
But doing so requires some time to develop a proper code based upon PLOT/POLYGONS and/or plottools built-in functions. The plots:-matrixplot I used is a quick shortcut to drax the histogram you have in mind, but it is versatile enough to produce pretty outputs.
The same observationholds for plots:-sparsematrixplot as a workaround to a "discrete" plots:-densityplot.

To jump on your initial remark "I could of course program one myself, but as I am lazy and this seems like a common kind of plot (at least in statistics and in physics), someone may well have done such a thing. DDG search did not find anything, at least not wrt. Maple."
I'm sure you can and I understand your reluctance to do it.
And yes, it's a very common plot in Statistics and that's unfortunate Maple doesn't offer any feature to draw 3D histograms and density plotof a cloud of points (as a lot of other languages do).


This is the kind of result you can obtain using an Histogram3D procedure based upon plottools:
3DHist_using_plottools.mw

@Mac Dude

Code: 3DHist_dependent.mw

Scatterplot of a sample drawn from a couple ofdependent random variables:
 
3D histogram of this same sample

Watchout: I assumed xvec and yvec are samples of two independent random variables X and Y

In my initial answer the procedure Histogram3D might produce an error when xtally or ytally were sparse (meaning for instance that some indices did not existed in one or two of these tables).
The new Histogram3D procedure in worksheet 3DHist_robustified.mw accounts for this situation (see text in [courier black] font).

Example 
             3D histogram over a 30-by-30 grid                                     sparse structure of the 30-by-30 grid

@dharr 

It works for me (Mac OSX, Firefox).
Maybe you could try this one  https://arxiv.org/abs/2111.03817
The one in my comment is      https://arxiv.org/pdf/2111.03817

@Alfred_F 

The largest octahedron (up to some symmetries) is necessarily the octahedron whose the base is the largest square S  contained in the cube.
From Prince Rupert's cube (Prince Rupert of the Rhine 1619-1682) is "the largest cube that can pass through a hole cut through a unit cube without splitting it into separate pieces". This is thus the cube which passes through the square hole S.

The solution, as those of several other Prince Rupert's passages, can be found in Bezdek, Guan, Huojter and Joos: S is a square of side length  a = 3*sqrt(2)/4.
The volume V = sqrt(2)/2*a3 of the largest octahedron is thus V = 9/16.

@dharr 
Given this property of the largest octahedron you could probably simplify your code by searching this mximal square S instead of the octahedron.
Not long ago Kitonum published this post on a closely similar problem.

@C_R 

What I get.
Which is obviously not an answer to your initial question, simply my observing what happens with an older maple version.

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

one := ``(1);

``(1)

(2)

lprint(%)

``(1)

 

lprint((2))

``(1)

 

lprint(one)

``(1)

 

one;
lprint('%')

``(1)

 

``(1)

 

one;
lprint(`%`)

``(1)

 

``(1)

 

 

``(1)

``(1)

(3)

lprint(%)

``(1)

 

one := ``(1)

``(1)

(4)

lprint(%)

``(1)

 

Download With_Maple_2015_loaded_with_Maple_2026_reloaded_with_Maple_2015.mw

With_Maple_2015.mw

(file can be uploaded)

There exists an infinity of "triangle spirals" (look here  for instance) and without more information it is impossble to go futher on.
If I'm not mistaken you speak French, so you can also look to this issue of the APMEP journal (Théodore's spirals).

So you have to provide us the the transformation which defines a triangle given its predecessor and 
the intitial triangle.

By the way, you write  "I am looking to improve my animation..." which, I guess, mean that you already wrote some Maple code? It would be helpful if you could upload it.

@WD0HHU 


Change

dM1 := diff~(dM1, [a, c, d]);

into

dM1 := diff~(M1, [a, c, d]);

 

@WD0HHU 

Use the big green up arrow in the menubar to upload your worksheet (mw file).
Be careful, the name of mile must not contain special characters to be uploaded.

@WD0HHU 

Are the outputs of dM1 in your worksheet and mine (Maple 2015) the same?

If it is so try to replace this

Sol := solve(%, [a, c, d]):

by this

Sol := solve(dM1, [a, c, d]);

and tell me what you get.
Idealy upload your worksheet and send it to me.

@Alfred_F 

Observing that b is almost equal to 1, a lot of work can be done in a formal way.
It shows you that there is at least 2 solutions [a=+A, b=1, c=C, c=D] and [a=-A, b=1, c=C, c=D]. (note the + and - signs before A): 
(
I wasn't capable to find a closed form expression for 
)

NonlinearFit_details.mw






Note that if [a=A, b=B, c=C, c=D] is a soution, then  [a=A, b=B, c=C+2ℤ𝝅, c=D] is a solution too and 
[a=-A, b=B, c=C+2ℤ𝝅+𝝅, c=D] is another solution

 and writeto and save/read (see @acer 's answer) commands work exactly the same whatever your OS Unix/Linux,  Mac OSX, and even Windows.
More of this their related help pages are very clear and I can assure you I'm not an Unix guru.

About the with(plots) (p, not P) stuff: if you don't want to do some "special" plots invoking your polynomial function, or combine several of these plots, you don't need to load the plots package.
There is no in joke here.

This is the same thing for the Digits:=20 command (default is Digits := 10). Why do you use 20 digits? Is that because of some precision requirement, or did you started from some worksheet you found somewhere without thinking about the implications of this command (it enlarges the size of the machine representation of the polynomial and maay augment the computation time)?

Without this domain you can take xend=0 (which trivialy verifies constr) and find that wn(a, ..., xend) is identically null. So max(wn) = min(wn) = 0 whatever a, b, c,d, f, g.

@erik10 

Example of a torus

Feel free to uncomment the two first lines and comment the third one in

 #r := [seq(rand(0. .. 1.)(), i=1..3)]:
 #r := 2 *~ r /~ sqrt(add(r^~2)):

  r := [1.461755141, .1237707985, 1.359394240];

ProjectedBoundary.mw

1 2 3 4 5 6 7 Last Page 2 of 42