Hi everyone! I am new to this forum, but I hope someone has some ideas about my current problem. I am a PhD student working on reliability assessment of deteriorating structures. Sadly I cannot (at least yet) share my entire code with you.
Methodoloy wise, I want to use the FORM method to assess the reliability of my structure.
In my case, the limit state function LSF (in the code zFunc) is:
g: Point = ot.Point(1)
g\[0\] = n - nkrit
where nkrit is a deterministic value, constant for every simulation, and n is a function of 24 variables (and highly non linear).
In my case, solvers like Abdo-Rackwitz do not seem to work at all. Here are the settings I used (without any fin-tuning) and the errors:
model_F = ot.PythonFunction(len(dist_params)+len(deterministic_values), 1, zFunc)
modelx = ot.ParametricFunction(model_F,\[2,3,11,13,14,15,16,21,23,25\],deterministic_values)
vect = ot.RandomVector(distribution)
G_F = ot.CompositeRandomVector(modelx, vect)
event_F = ot.ThresholdEvent(G_F, ot.Less(), 0.0)
initialPoint = distribution.getMean()
solver = ot.AbdoRackwitz()
solver.setMaximumCallsNumber(1000000)
solver.setMaximumIterationNumber(1000000)
solver.setCheckStatus(False)
solver.setMaximumConstraintError(1e-4)
solver.setMaximumAbsoluteError(1e-5)
solver.setMaximumRelativeError(1e-5)
solver.setMaximumResidualError(1e-5)
algo = ot.FORM(solver, event_F, initialPoint)
algo.run()
AttributeError: 'NoneType' object has no attribute '__name__'. Did you mean: '__ne__'?
WRN - Switch to finite difference to compute the gradient at point=[0.582754,0.277257,0.192627,0.300659,0.189392,0.0498757,0.0498757,0.0990211,0.0990211,0,0.0990211,0.0892835,0.0349572,0.0349572,0,0]#16
AttributeError: 'NoneType' object has no attribute '__name__'. Did you mean: '__ne__'?
Traceback (most recent call last):
File "c:\Users\20225573\Project_Codes\FracMap4_OT_2025\FORM_main.py", line 137, in <module>
algo.run()
File "C:\Users\20225573\Project_Codes\FracMap4_OT_2025\env\Lib\site-packages\openturns\analytical.py", line 902, in run
return _analytical.FORM_run(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: InternalException : Python exception: None
The Cobyla solver does instead work (partially). This are the settings I used are the same as earlier, except for the solver.
As an order of magnitude, let’s consider nkrit=7.5e5 and the value of n obtained in the first iteration (i.e. using the mean values of the parameters) is 8.955e8.
When I run this set of simulations, the following error is obtained:
RuntimeError: Exception : Obtained design point is not on the limit state: its image by the limit state function is 115.189, which is incompatible with the threshold: 0 considering the limit state tolerance of the optimization algorithm: 0.0001
The maximum number of iterations or calls had not bean reached, so I guessed I might be just too far from the 0 that my function got stuck somewhere else, so I tried getting a bit closer by modifying the limit state function normalizing it by n (g[0] = (n – nkrit)/n ), and I run the same simulation, obtaining:
RuntimeError: Exception : Obtained design point is not on the limit state: its image by the limit state function is 0.00689068, which is incompatible with the threshold: 0 considering the limit state tolerance of the optimization algorithm: 0.0001
t this point, I tried increasing the denominator of my function of a factor k (tuned by hand) and if k is sufficiently large (in this case k=500) I get a solution which is comparable to the expected one (beta = 3.3012 instead of 3.31629).
However, this is not a correct procedure because the function I am now assessing ((n – nkrit)/(k n)) is not the function I want to evaluate (n – nkrit) and k becomes different for every different values of nkrit that I choose an sets of inputs.
Removing k, and releasing the tolerance (i.e. solver.setMaximumConstraintError(1e-3) ) also proved to result in the same errors as earlier described. A more strict value of maximum Absolute, Relative and Residual errors does not bring any benefit.
I considered using a different starting point, but I would have no scientific reason to choose one instead of another, and it could be either a best case scenario (i.e. I start from points which provide a solution) or a worse case scenario (where I go even further away from the zero of my LSF).
Does anyone have any ideas on 1) why the Abdo-Rackwitz solver does not work at all and 2) what the problem could be with the Cobyla method and how I could solve it, without modifying my LSF?
Many thanks for whoever will try to help!