##### Personal tools
You are here: Home Use Find an analytic density function

# Find an analytic density function

Up to Use

### Find an analytic density function

Posted by Thibaut Moy at November 09. 2016

Hello,

I am trying to reproduce a 3D mesh that has a non-uniform distribution in one direction. However, it doesn't have a constant ratio between each elements, and I was thinking of using the analytic density function of Salome.

I have access to the coordinates of each point of this distribution and I would like to know if there is a way to directly obtain the analytic density function that will exactly reproduce this distribution.

Thanks in advance,

Thibaut

### Re: Find an analytic density function

Posted by Abraham Vivas at February 17. 2020

Dear Thibaut,

I ask myself exactly the same riddle... eventually had you got a satisfactory answer? There is a way to obtain an analytic distribution that gives a constant ratio node distribution?

Thanks in advance,

Abraham.

### Re: Find an analytic density function

Posted by Abraham Vivas at February 18. 2020

Hi All,

I found a solution to my riddle... Given this thread that expands the understanding on the workings of "distribution with analytic density" on "Number of Segments" hypothesis, i made the following reasoning:

1) The integral ( I )  of the analytic density function ( f(t) ) can be expressed as:  I = F(1) - F(0)   , where F(t) is the antiderivative of f(t)

2) The nth node on the distribution ( xn ) must follow: integral from 0 to xn of f(t) dt = n * I / N , where N is the number of segments. Then we can express it as: F(xn) - F(0) = n/N*I

3) Combining step 1) and 2) we can find the following expression: F(xn) = n/N*F(1) + (1 - n/N)*F(0) ... so, knowing the desired xn node distribution, its a matter of finding the function F(t) that respects the given relation.

4) The desired node distribution can be obtained from the dimensionless summation of a geometric series: xn =  a* (1 - r^n)/(1 - r) / (a* (1 - r^N)/(1 - r) ) => xn = (1 - r^n)/(1 - r^N) = (r^n - 1)/(r^N - 1)

5) Finally, testing some functions on the relation 3) and comparing with 4) it can be found that f(t) = 1/(a*t +b) where a = r^N - 1 and b=1 . By integration F(t) = 1/a * ln(a*t + b).

Answer: f(t) = 1 / ( (r^N - 1)*t + 1) = 1 / (C*t  + 1) , where C is a constant.

Even more, you can have a symmetric distribution combining the expression on 5)  with its mirrored self as:

f(t) = 1/((r^N - 1)*t + 1) + 1/( -(r^N - 1)*(t - 1) +1)

Which you ensure that the fastest change in node ratio is r.

Hope this help others with same or similar riddles.

Abraham.

Powered by