sand15

405 Reputation

10 Badges

6 years, 304 days

MaplePrimes Activity


These are replies submitted by sand15

@acer 

(reply from the office)

Point 1: I agree with your interpretation but this would mean that it is not necessary to click on the point you want to move in order to select it, but simply in a neighborhood of it whose extent is controlled by the value 5.
I didn't verified this but it seemed so strange that I suspected some hidden meaning (thus the search of the point closest to the click point) 

Point 2: a solid argument in favor of the tables, thanks for the tip

@Fargues Marisa 

You're right
I don't have Maple on this machine, so I translated from memory what I'd done on another one.
The correct syntax would have been

pch := plottools:-getdata(ch)[-1][-1]; 

or yours, which is the same ([-1] meaning the "last element of the list"

Apologies


By the way, in case you have 2 points with the same absissas the correrspondig vertical segment must belong to the Newton polygon
So you must replace

while pch[n, 1] > pch[n-1, 1] do

by

while pch[n, 1] >=  pch[n-1, 1] do


Some comments:

  • I've always thought that there was a unique definition of the Newton polygon (lower bound of the convex hull of the points), but looking to the French entry of the topic in WikipediaPolygone_de_Newton I discovered that some authors consider that the Newton Polygon  is the whole convex hull (maybe this is related to tomleslie's "Needs clarification" reply?).
    Unfornutately the English entry doesn't mention that.
     
  • In Newton.pdf you will see that the Newton Polygon contains 2 semi infinite vertical lines originating from the first and last point of the lower bound of the convex hull.
     
  • Finally, a better alternative to simplex:-convexhull is provided by the  PolyhedralSets package.
    Even if this package is aimed to manipulate 3D objects, it can be used for 2D ones.
    An interesting feature of it is that it represents a convex hull by a list on inequalities.
    You will find in the attached file a few examples treated with this package and, at the end of it, a 
    procedure that returns :
    • the Newton polydon as a list of inequalities which includes left and right vertical bounds (a correct mathematical description),
    • a plot of the convexhull and the Newton polygon


Newton_Polygon.mw



These file uses Maple 2015 but should work with newer versions.

@vv 

Thank you (I'm replying from my office).
 

@Carl Love 

Thanks.
I discovered MathML in the context of Maple a few months ago and found it very useful although a bit confusing at first
Avoiding parse and "..." indeed makes things more readable.

@acer 

Great!

Thank you acer, 

@acer 

(from my professional account)

Thank's for having this modification.
It was so natural that I blame myself for not having thought of it myself.

@acer 

I was aware of the existence of the ImageTools package and I had already replayed some of the examples it contains, but without digging deeper. In fact I thought it was essentially used to manipulate kind of jpeg or png images.
That's why I didn't think of it as a potentially useful tool for my problem.

Using Convolution is therefore a good advice.

Concerning the "bins" issue, the correct way to address it would be to have a 2D KernelDensity function (every trick like smoothing or filtering a "binned" scatterplot introduces artifacts that can lead to misinterpretations).
There is such a function in R and I think I could translate it into MAPLE, as I already did for a few other algorithims.
In case I do I will publish it in a specific Post.

​​​​​​​Thanks again for your involvement

@acer 

Hi, I am now answering from my office.

I just found out your last post but, in the meantime, I have done a few things on my own.
Because of our security policy it takes me some time to transfer a file from my professional network on this open one, so no file given here.
I mainly worked on smoothing the original matrix NP for a better rendering.
Here his the code I made (the look-up table F is just an example among many matrices we can use ; I'm going to look at what ImageTools proposes)
 

Filtering := proc(M::Matrix(square))
  local N, MF, F, KP, nx, ny:
  uses LinearAlgebra:
  KP := KroneckerProduct:
  N := numelems(M[1]):
  MF := copy(M):
  F := Matrix(3$2, [[1, 2, 1], [2, 4, 2], [1, 2, 1]]):
  for nx from 2 to N-1 do
    for ny from 2 to N-1 do
      MF[nx, ny] := KP(M[nx-1..nx+1, ny-1..ny+1]; F):
    end do:
  end do:
  return MF:
end proc:

NPF := Filtering(NP)

Used in plots:-surfdata, this filtered matrix NPF looks rather pretty (prtty doesn't mean correct of course).

I will continue to work on this idea with all the material you sent me.
See you later

@MapleEnthusiast 

For your particular case (S=1, because I do not know how the "conditions" write for S > 1);
(Here the result is obviously 3)
 

restart:
# These 2 lines with Sum only serve to obtain concise outputs
Expr := (J, S) -> Sum(Sum(Sum(pi[i,j,k,F], i=1..J), j=1..J), k:1..S);
Rel := (j,k,J) -> Sum(pi[i,j,k,F],i=1..J)=1;

expr := (J,S)  -> eval(Expr(J,S), Sum=sum):
rel := (j, k, J) -> eval(Rel(j, k, J), Sum=sum):  # could be a function of (j, j, J, S)

e := expr(3, 1);
for j from 1 to 3 do
  e := algsubs(rel(j, 1, 3), e)
end do;

For S > 1 you could maybe inspire yourself from this ?

@tomleslie 

Thanks for your reply but the worksheet will only shows that I'm not bullshitting.
The real issue is about the lost of connection to the mpython server.
Either it is something already identified by the development team (or any mapleprimes member) or something that is due to the way Maple is installed on my machine.
 

 

 

@acer 

Thank you acer, it's very usefull.
A classical example I often meet is the following: randomly select a column or a row of a matrix according to some probability distribution.
I almost systematically forget the necessary conversion of hfloats into integers.

@Carl Love 

Thanks for the reply.
Due to intranet  problems I couldn't use Maple when I sent you my question, so I thought that trunc did the truncation on hfloats... when in fact the conversion to a sequence does the conversion to a sfloat and trunc "only" does the truncation.
Thanks also for the last paragraph of your answer, I'm going to take a look at this package and at evalhf.

 

@Carl Love 

Hi, 

I'm always worried by the fact a discrete random variable, even when defined on integers (think to a binomial one), always returns a float (contrary to random(...) for instance).
Neither round, floor nor ceil can convert these outputs into integers, so "my" UseHardwareFloats := false.
Couldn't  it be interesting that these three functions also operate on hfloats?

@dharr


(mmcdara from my professional account)

Thanks dharr, astute way to reduce the computing time indeed.
 

@janhardo 

(mmcdara from my professional account)

Thanks for the link, I'm going to look at it right now

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