"If" statement in Number of Segments hypothesis Distribution with Analytic Density

Hello,

Is it possible to use an “If-Else” clause in the Number of Segments hypothesis? For example, can I specify the following analytical distribution function?

f(t) = 1/(t+1) for t < 0.5
= 1/t^2 for t > 0.5

Hope my question is clear.
Thanking in anticipation,
Vachan

The feature does not seem to be supported as confirmed by experts. You can instead use Distribution with Table density and fill this table in your study either in the GUI or in the python script generated by SALOME.

# User function                                                                                                                                                                                                 
import numpy as np
def densityFct(t):
  if t < 0.5:
    r=t+1
  else:
    r=t*t
  return 1./r

tableFct=[]
for t in np.arange(0,1,0.01):
  tableFct+=[t,densityFct(t)]
Number_of_Segments_1.SetTableFunction( tableFct)