sand15

460 Reputation

11 Badges

8 years, 2 days

MaplePrimes Activity


These are replies submitted by sand15

Defining H this way

H := `#mrow(mo("["),msup(mo("H"),mo("+")),mo("]"))`

will make the equality

 V__b=V__a*(( C__a/(1+H/K__a)-H+K__w/H)/(C__b/(1+K__w/H/K__b)+H-K__w/H))

to appear exactly as in pour post.


H is an atomic variable you can manipulate in all the ways you want, for instance tomleslie's

@nm 

Thank you nm, I vote up.

Here is a simplified version of the previous answer I gave as mmcdara.
More of this I corrected an error due to the fact that the maximum values of the PDF are not equal to 1;
so please disregard my answer as mmcdara
 

restart:
	
Projector := proc(f, R, N, k)
  local a := op(1, R):
  local b := op(2, R):
  local T, S:
  uses Statistics:

  if k > 0 and k < N then
    T := RandomVariable(Triangular(a+(b-a)*(k-1)/N, a+(b-a)*(k+1)/N, a+(b-a)*k/N)):
    return Mean(f(T)) * ((b-a)/N)
  elif k=0 then
    T := RandomVariable(Triangular(a, a+(b-a)/N, a)):
    return Mean(f(T)) * ((b-a)/N/2)
  elif  k=N then
    T := RandomVariable(Triangular(b-(b-a)/N, b, b)):
    return Mean(f(T)) * ((b-a)/N/2):
  else
    error cat("k must be an integer between 0 and ", N, " (given value ", k, ")")
  end if:
end proc:
  	
Array(0..6, k -> Projector(x -> sin(Pi*x), 0..1, 6, k))

 

@tomleslie 

Thank you Tom for this detailed answer.

I will indeed stick to your last advice.

@Thomas Richard 

Using strict inequalities is indeed a good advice.

Converning your last remark "The help file (?convert,Heaviside) indicates that proper conversion is not always possible." :
yes, @acer has recently told me something about this recently.
But his advice was about using And/Or/Not instead of and/or/not (thus my code), but it seems we must be even more careful.

@tomleslie 

Thanks, I've just sent the suspicious file to @Thomas Richard

@Thomas Richard 

Thanks for your reply.

Did you install the last update for Maple 2020?
I use  the version 2020.2 with W10. It has been installed by the technical support of my company in november 2020.
Looking at the link you give it seems that I am using the latest update.
If this is not the case I will soon have Maple 2021, which will solve the problem if I understand correctly.

Here is the file? I hope you will be able to read it (we have very little permissive firewalls and it has already happened that files are not loaded correctly)

Heaviside_issue.mw

@acer 

No explanation but a very usefull workaround.
Thank you very much acer.

@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

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