DoubleLoopRBDOAlgorithm

class otrobopt.DoubleLoopRBDOAlgorithm(*args)

Double-loop reliability-based design optimization.

This class is experimental and may change in future releases.

The algorithm solves the reliability-based design optimization problem

\min_{x} f(x)
\quad \text{subject to} \quad
\ProbCond{\cD}{g(x;\Theta) \ge 0} \ge \alpha,

where f is a scalar classical function and the chance constraint is given by a JointChanceMeasure. The distribution parameter is kept fixed. An outer deterministic optimization calls an inner reliability analysis in the standard space of the distribution.

Two inner formulations are available through setMethod():

  • DoubleLoopRBDOAlgorithm.RIA minimizes the distance to the limit state. The outer constraint is \beta(x)-\beta_t \ge 0, where the signed reliability index \beta is negative when the origin of the standard space belongs to the failure domain.

  • DoubleLoopRBDOAlgorithm.PMA minimizes the limit state on the sphere of radius \beta_t. The outer constraint is the performance measure at the target point.

The target index is \beta_t=F_{\mathrm{std}}^{-1}(p_s), where p_s is the safe-event probability and F_{\mathrm{std}} is the one-dimensional marginal of the standard distribution of \Theta (\Phi when the standard space is normal). For a Greater operator the safe event is \{g \ge 0\} and p_s=\alpha. For a Less operator the safe event is the complementary event \{g < 0\} and p_s=1-\alpha. Both formulations therefore require 0.5 < p_s < 1.

A vector limit state is handled with the setJointChanceTreatment() option. EXACT uses the exact joint event: the intersection \{\min_j g_j \ge 0\} for a Greater operator and the complementary union for a Less operator. BONFERRONI replaces the joint event by component events with the conservative target 1-(1-p_s)/n_g; it is less tight but avoids a nonsmooth scalarization. The treatment is always explicit and is reported by getJointChanceTreatment().

Available constructors:

DoubleLoopRBDOAlgorithm(problem, solver, innerSolver)

DoubleLoopRBDOAlgorithm(problem, solver)

DoubleLoopRBDOAlgorithm()

Parameters:
problemRBDOProblem

Reliability-based design optimization problem.

solveropenturns.OptimizationAlgorithm

Outer deterministic optimization algorithm.

innerSolveropenturns.OptimizationAlgorithm

Inner reliability algorithm applied to the scalarized limit state. It must support the constraints used by the selected method. The default is Cobyla.

Methods

getApproximateProbability()

FORM approximation of the safe probability at the solution.

getCheckStatus()

Accessor to check status flag.

getClassName()

Accessor to the object's name.

getInnerOptimizationAlgorithm()

Accessor to the inner reliability algorithm.

getJointChanceTreatment()

Accessor to the joint chance treatment.

getMaximumAbsoluteError()

Accessor to maximum allowed absolute error.

getMaximumCallsNumber()

Accessor to maximum allowed number of calls.

getMaximumConstraintError()

Accessor to maximum allowed constraint error.

getMaximumIterationNumber()

Accessor to maximum allowed number of iterations.

getMaximumRelativeError()

Accessor to maximum allowed relative error.

getMaximumResidualError()

Accessor to maximum allowed residual error.

getMaximumTimeDuration()

Accessor to the maximum duration.

getMethod()

Accessor to the inner reliability formulation.

getName()

Accessor to the object's name.

getOptimizationAlgorithm()

Accessor to the outer deterministic optimization algorithm.

getPerformanceMeasure()

Performance measure at the solution.

getPhysicalSpaceDesignPoint()

Physical-space design point at the solution.

getProblem()

Accessor to optimization problem.

getRBDOProblem()

Accessor to the reliability-based design optimization problem.

getReliabilityIndex()

Signed reliability index at the solution.

getResult()

Accessor to optimization result.

getStandardSpaceDesignPoint()

Standard-space design point at the solution.

getStartingPoint()

Accessor to starting point.

getStartingSample()

Accessor to starting sample.

getTargetReliabilityIndex()

Target reliability index defined by the chance constraint.

hasName()

Test if the object is named.

run()

Launch the optimization.

setCheckStatus(checkStatus)

Accessor to check status flag.

setInnerOptimizationAlgorithm(solver)

Set the inner reliability algorithm.

setJointChanceTreatment(treatment)

Set the joint chance treatment.

setMaximumAbsoluteError(maximumAbsoluteError)

Accessor to maximum allowed absolute error.

setMaximumCallsNumber(maximumCallsNumber)

Accessor to maximum allowed number of calls

setMaximumConstraintError(maximumConstraintError)

Accessor to maximum allowed constraint error.

setMaximumIterationNumber(maximumIterationNumber)

Accessor to maximum allowed number of iterations.

setMaximumRelativeError(maximumRelativeError)

Accessor to maximum allowed relative error.

setMaximumResidualError(maximumResidualError)

Accessor to maximum allowed residual error.

setMaximumTimeDuration(maximumTime)

Accessor to the maximum duration.

setMethod(method)

Set the inner reliability formulation.

setName(name)

Accessor to the object's name.

setOptimizationAlgorithm(solver)

Set the outer deterministic optimization algorithm.

setProblem(problem)

Accessor to optimization problem.

setProgressCallback(*args)

Set up a progress callback.

setRBDOProblem(problem)

Set the reliability-based design optimization problem.

setResult(result)

Accessor to optimization result.

setStartingPoint(startingPoint)

Accessor to starting point.

setStartingSample(startingSample)

Accessor to starting sample.

setStopCallback(*args)

Set up a stop callback.

Notes

The inner optimization is performed in the standard space of the distribution. The standard-space limit state is built from the inverse isoprobabilistic transformation of the distribution, and the origin of the standard space is the median point of the distribution.

For a normal or a non-elliptical distribution the standard space is the standard normal space and \beta_t=\Phi^{-1}(p_s). For an elliptical distribution with a non-normal standard representative, for example a Student distribution, the standard space is the same-kind spherical space of the generalized Nataf transformation: \beta_t is the quantile of its one-dimensional marginal S_\nu, and the FORM probability is S_\nu(\beta). This is the generalized reliability index of Lebrun and Dutfoy; the normal-space formulas are recovered with S_\nu=\Phi. See the theory page for details.

The algorithm requires the limit-state function to expose a parameter gradient when a gradient-based inner solver is used. The default Cobyla inner solver does not require it.

The reliability analysis is a first-order one. It assumes that the limit state is continuously differentiable, that its zero set has probability zero and that the minimum of the scalarized limit state over the ball of radius \beta_t is reached on its boundary. These assumptions are the standard FORM and PMA assumptions. In particular, the safe event of a Less operator is the open set \{g < 0\}, so the boundary \{g = 0\} is not safe: a limit state that vanishes on a set of positive probability, such as \max(u-x, 0), is outside the scope. A limit state that is negative inside the target sphere while non-negative on its boundary is not detected by the PMA sphere test either.

The default inner solver tolerances can be changed with the ResourceMap keys DoubleLoopRBDOAlgorithm-DefaultInnerMaximumCallsNumber, DoubleLoopRBDOAlgorithm-DefaultInnerMaximumConstraintError and DoubleLoopRBDOAlgorithm-DefaultInnerMaximumAbsoluteError. The inner reliability solves record their evaluations to recover the best iterate when OpenTURNS reports no optimal point; the ResourceMap key RBDOAlgorithmTools-InnerEvaluationHistoryMaximumSize bounds the number of recorded evaluations.

The result is available through the inherited getResult method. It is associated with the RBDO problem rather than with the internal canonical problem, so that a saved algorithm keeps its result across a study round trip. The reliability analysis at the solution is reported by getReliabilityIndex(), getPerformanceMeasure(), getStandardSpaceDesignPoint(), getPhysicalSpaceDesignPoint() and getApproximateProbability().

Examples

>>> import openturns as ot
>>> import otrobopt
>>> limitState = ot.ParametricFunction(
...     ot.SymbolicFunction(["x", "theta"], ["theta - x"]), [1], [0.0]
... )
>>> measure = otrobopt.JointChanceMeasure(
...     limitState, ot.Normal(), ot.GreaterOrEqual(), 0.9
... )
>>> problem = otrobopt.RBDOProblem(
...     ot.SymbolicFunction(["x"], ["x^2"]), measure
... )
>>> algo = otrobopt.DoubleLoopRBDOAlgorithm(
...     problem, ot.Cobyla()
... )
>>> algo.setMethod(otrobopt.DoubleLoopRBDOAlgorithm.PMA)
>>> algo.run()
>>> result = algo.getResult()
__init__(*args)
getApproximateProbability()

FORM approximation of the safe probability at the solution.

Returns:
probabilityfloat

The value F_{\mathrm{std}}(\beta), where F_{\mathrm{std}} is the one-dimensional marginal of the standard distribution. It is \Phi(\beta) when the standard space is normal and, for example, S_\nu(\beta) for a Student distribution. It is not available when no finite reliability index could be computed.

Raises:
RuntimeError

If the algorithm has not been run.

Notes

With the EXACT joint chance treatment \beta is the joint index, so the value approximates the joint safe probability. With the BONFERRONI treatment the components are solved at the common component target and \beta is the worst component index: the value is then the worst component probability, that is an upper bound of the joint safe probability, not the joint probability itself.

getCheckStatus()

Accessor to check status flag.

Returns:
checkStatusbool

Whether to check the termination status. If set to False, run() will not throw an exception if the algorithm does not fully converge and will allow one to still find a feasible candidate.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getInnerOptimizationAlgorithm()

Accessor to the inner reliability algorithm.

Returns:
solveropenturns.OptimizationAlgorithm

Inner reliability algorithm applied to the scalarized limit state.

getJointChanceTreatment()

Accessor to the joint chance treatment.

Returns:
treatmentint

Either DoubleLoopRBDOAlgorithm.EXACT or DoubleLoopRBDOAlgorithm.BONFERRONI.

getMaximumAbsoluteError()

Accessor to maximum allowed absolute error.

Returns:
maximumAbsoluteErrorfloat

Maximum allowed absolute error, where the absolute error is defined by \epsilon^a_n=\|\vect{x}_{n+1}-\vect{x}_n\|_{\infty} where \vect{x}_{n+1} and \vect{x}_n are two consecutive approximations of the optimum.

getMaximumCallsNumber()

Accessor to maximum allowed number of calls.

Returns:
maximumCallsNumberint

Maximum allowed number of function evaluations, including direct calls through the () operator and indirect calls through finite difference gradients.

getMaximumConstraintError()

Accessor to maximum allowed constraint error.

Returns:
maximumConstraintErrorfloat

Maximum allowed constraint error, where the constraint error is defined by \gamma_n=\|g(\vect{x}_n)\|_{\infty} where \vect{x}_n is the current approximation of the optimum and g is the function that gathers all the equality and inequality constraints (violated values only)

getMaximumIterationNumber()

Accessor to maximum allowed number of iterations.

Returns:
maximumIterationNumberint

Maximum allowed number of iterations.

getMaximumRelativeError()

Accessor to maximum allowed relative error.

Returns:
maximumRelativeErrorfloat

Maximum allowed relative error, where the relative error is defined by \epsilon^r_n=\epsilon^a_n/\|\vect{x}_{n+1}\|_{\infty} if \|\vect{x}_{n+1}\|_{\infty}\neq 0, else \epsilon^r_n=-1.

getMaximumResidualError()

Accessor to maximum allowed residual error.

Returns:
maximumResidualErrorfloat

Maximum allowed residual error, where the residual error is defined by \epsilon^r_n=\frac{\|f(\vect{x}_{n+1})-f(\vect{x}_{n})\|}{\|f(\vect{x}_{n+1})\|} if \|f(\vect{x}_{n+1})\|\neq 0, else \epsilon^r_n=-1.

getMaximumTimeDuration()

Accessor to the maximum duration.

Returns:
maximumTimefloat

Maximum optimization duration in seconds.

getMethod()

Accessor to the inner reliability formulation.

Returns:
methodint

Either DoubleLoopRBDOAlgorithm.RIA or DoubleLoopRBDOAlgorithm.PMA.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getOptimizationAlgorithm()

Accessor to the outer deterministic optimization algorithm.

Returns:
solveropenturns.OptimizationAlgorithm

Outer optimization algorithm.

getPerformanceMeasure()

Performance measure at the solution.

Returns:
performanceMeasurefloat

Minimum of the scalarized limit state on the target sphere.

Raises:
RuntimeError

If the algorithm has not been run.

getPhysicalSpaceDesignPoint()

Physical-space design point at the solution.

Returns:
designPointPoint

Image of the standard-space design point by the inverse isoprobabilistic transformation.

Raises:
RuntimeError

If the algorithm has not been run.

getProblem()

Accessor to optimization problem.

Returns:
problemOptimizationProblem

Optimization problem.

getRBDOProblem()

Accessor to the reliability-based design optimization problem.

Returns:
problemRBDOProblem

Reliability-based design optimization problem.

getReliabilityIndex()

Signed reliability index at the solution.

The index is measured in the standard space of the distribution. For an elliptical distribution it is the generalized reliability index of Lebrun and Dutfoy, whose FORM probability is F_{\mathrm{std}}(\beta).

Returns:
reliabilityIndexfloat

Reliability index \beta. It is negative when the origin of the standard space belongs to the failure domain.

Raises:
RuntimeError

If the algorithm has not been run.

getResult()

Accessor to optimization result.

Returns:
resultOptimizationResult

Result class.

getStandardSpaceDesignPoint()

Standard-space design point at the solution.

Returns:
designPointPoint

Most probable point in the standard normal space.

Raises:
RuntimeError

If the algorithm has not been run.

getStartingPoint()

Accessor to starting point.

Returns:
startingPointPoint

Starting point.

getStartingSample()

Accessor to starting sample.

Returns:
startingSampleSample

Starting sample.

getTargetReliabilityIndex()

Target reliability index defined by the chance constraint.

The index is F_{\mathrm{std}}^{-1}(p_s) for the exact treatment and the Bonferroni component index for the conservative treatment, where F_{\mathrm{std}} is the one-dimensional marginal of the standard distribution. It is \Phi^{-1}(p_s) when the standard space is normal.

Returns:
targetIndexfloat

Target reliability index \beta_t.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

run()

Launch the optimization.

setCheckStatus(checkStatus)

Accessor to check status flag.

Parameters:
checkStatusbool

Whether to check the termination status. If set to False, run() will not throw an exception if the algorithm does not fully converge and will allow one to still find a feasible candidate.

setInnerOptimizationAlgorithm(solver)

Set the inner reliability algorithm.

Parameters:
solveropenturns.OptimizationAlgorithm

Inner reliability algorithm applied to the scalarized limit state.

setJointChanceTreatment(treatment)

Set the joint chance treatment.

Parameters:
treatmentint

Either DoubleLoopRBDOAlgorithm.EXACT for the exact joint event or DoubleLoopRBDOAlgorithm.BONFERRONI for the conservative componentwise split.

setMaximumAbsoluteError(maximumAbsoluteError)

Accessor to maximum allowed absolute error.

Parameters:
maximumAbsoluteErrorfloat

Maximum allowed absolute error, where the absolute error is defined by \epsilon^a_n=\|\vect{x}_{n+1}-\vect{x}_n\|_{\infty} where \vect{x}_{n+1} and \vect{x}_n are two consecutive approximations of the optimum.

setMaximumCallsNumber(maximumCallsNumber)

Accessor to maximum allowed number of calls

Parameters:
maximumCallsNumberint

Maximum allowed number of function evaluations, including direct calls through the () operator and indirect calls through finite difference gradients.

setMaximumConstraintError(maximumConstraintError)

Accessor to maximum allowed constraint error.

Parameters:
maximumConstraintErrorfloat

Maximum allowed constraint error, where the constraint error is defined by \gamma_n=\|g(\vect{x}_n)\|_{\infty} where \vect{x}_n is the current approximation of the optimum and g is the function that gathers all the equality and inequality constraints (violated values only)

setMaximumIterationNumber(maximumIterationNumber)

Accessor to maximum allowed number of iterations.

Parameters:
maximumIterationNumberint

Maximum allowed number of iterations.

setMaximumRelativeError(maximumRelativeError)

Accessor to maximum allowed relative error.

Parameters:
maximumRelativeErrorfloat

Maximum allowed relative error, where the relative error is defined by \epsilon^r_n=\epsilon^a_n/\|\vect{x}_{n+1}\|_{\infty} if \|\vect{x}_{n+1}\|_{\infty}\neq 0, else \epsilon^r_n=-1.

setMaximumResidualError(maximumResidualError)

Accessor to maximum allowed residual error.

Parameters:
maximumResidualErrorfloat

Maximum allowed residual error, where the residual error is defined by \epsilon^r_n=\frac{\|f(\vect{x}_{n+1})-f(\vect{x}_{n})\|}{\|f(\vect{x}_{n+1})\|} if \|f(\vect{x}_{n+1})\|\neq 0, else \epsilon^r_n=-1.

setMaximumTimeDuration(maximumTime)

Accessor to the maximum duration.

Parameters:
maximumTimefloat

Maximum optimization duration in seconds.

setMethod(method)

Set the inner reliability formulation.

Parameters:
methodint

Either DoubleLoopRBDOAlgorithm.RIA or DoubleLoopRBDOAlgorithm.PMA.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setOptimizationAlgorithm(solver)

Set the outer deterministic optimization algorithm.

Parameters:
solveropenturns.OptimizationAlgorithm

Outer optimization algorithm.

setProblem(problem)

Accessor to optimization problem.

Parameters:
problemOptimizationProblem

Optimization problem.

setProgressCallback(*args)

Set up a progress callback.

Can be used to programmatically report the progress of an optimization.

Parameters:
callbackcallable

Takes a float as argument as percentage of progress.

Examples

>>> import sys
>>> import openturns as ot
>>> rosenbrock = ot.SymbolicFunction(['x1', 'x2'], ['(1-x1)^2+100*(x2-x1^2)^2'])
>>> problem = ot.OptimizationProblem(rosenbrock)
>>> solver = ot.OptimizationAlgorithm(problem)
>>> solver.setStartingPoint([0, 0])
>>> solver.setMaximumResidualError(1.e-3)
>>> solver.setMaximumCallsNumber(10000)
>>> def report_progress(progress):
...     sys.stderr.write('-- progress=' + str(progress) + '%\n')
>>> solver.setProgressCallback(report_progress)
>>> solver.run()
setRBDOProblem(problem)

Set the reliability-based design optimization problem.

Parameters:
problemRBDOProblem

Reliability-based design optimization problem.

setResult(result)

Accessor to optimization result.

Parameters:
resultOptimizationResult

Result class.

setStartingPoint(startingPoint)

Accessor to starting point.

Parameters:
startingPointPoint

Starting point.

setStartingSample(startingSample)

Accessor to starting sample.

Parameters:
startingSampleSample

Starting sample.

setStopCallback(*args)

Set up a stop callback.

Can be used to programmatically stop an optimization.

Parameters:
callbackcallable

Returns an int deciding whether to stop or continue.

Examples

>>> import openturns as ot
>>> rosenbrock = ot.SymbolicFunction(['x1', 'x2'], ['(1-x1)^2+100*(x2-x1^2)^2'])
>>> problem = ot.OptimizationProblem(rosenbrock)
>>> solver = ot.OptimizationAlgorithm(problem)
>>> solver.setStartingPoint([0, 0])
>>> solver.setMaximumResidualError(1.e-3)
>>> solver.setMaximumCallsNumber(10000)
>>> def ask_stop():
...     return True
>>> solver.setStopCallback(ask_stop)
>>> solver.run()