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
where
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.RIAminimizes the distance to the limit state. The outer constraint is, where the signed reliability index
is negative when the origin of the standard space belongs to the failure domain.
DoubleLoopRBDOAlgorithm.PMAminimizes the limit state on the sphere of radius. The outer constraint is the performance measure at the target point.
The target index is
, where
is the safe-event probability and
is the one-dimensional marginal of the standard distribution of
(
when the standard space is normal). For a
Greateroperator the safe event isand
. For a
Lessoperator the safe event is the complementary eventand
. Both formulations therefore require
.
A vector limit state is handled with the
setJointChanceTreatment()option.EXACTuses the exact joint event: the intersectionfor a
Greateroperator and the complementary union for aLessoperator.BONFERRONIreplaces the joint event by component events with the conservative target; 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:
- problem
RBDOProblem Reliability-based design optimization problem.
- solver
openturns.OptimizationAlgorithm Outer deterministic optimization algorithm.
- innerSolver
openturns.OptimizationAlgorithm Inner reliability algorithm applied to the scalarized limit state. It must support the constraints used by the selected method. The default is
Cobyla.
- problem
Methods
FORM approximation of the safe probability at the solution.
Accessor to check status flag.
Accessor to the object's name.
Accessor to the inner reliability algorithm.
Accessor to the joint chance treatment.
Accessor to maximum allowed absolute error.
Accessor to maximum allowed number of calls.
Accessor to maximum allowed constraint error.
Accessor to maximum allowed number of iterations.
Accessor to maximum allowed relative error.
Accessor to maximum allowed residual error.
Accessor to the maximum duration.
Accessor to the inner reliability formulation.
getName()Accessor to the object's name.
Accessor to the outer deterministic optimization algorithm.
Performance measure at the solution.
Physical-space design point at the solution.
Accessor to optimization problem.
Accessor to the reliability-based design optimization problem.
Signed reliability index at the solution.
Accessor to optimization result.
Standard-space design point at the solution.
Accessor to starting point.
Accessor to starting sample.
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
. 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:
is the quantile of its one-dimensional marginal
, and the FORM probability is
. This is the generalized reliability index of Lebrun and Dutfoy; the normal-space formulas are recovered with
. 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
Cobylainner 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
is reached on its boundary. These assumptions are the standard FORM and PMA assumptions. In particular, the safe event of a
Lessoperator is the open set, so the boundary
is not safe: a limit state that vanishes on a set of positive probability, such as
, 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-DefaultInnerMaximumConstraintErrorandDoubleLoopRBDOAlgorithm-DefaultInnerMaximumAbsoluteError. The inner reliability solves record their evaluations to recover the best iterate when OpenTURNS reports no optimal point; the ResourceMap keyRBDOAlgorithmTools-InnerEvaluationHistoryMaximumSizebounds the number of recorded evaluations.The result is available through the inherited
getResultmethod. 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 bygetReliabilityIndex(),getPerformanceMeasure(),getStandardSpaceDesignPoint(),getPhysicalSpaceDesignPoint()andgetApproximateProbability().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
, where
is the one-dimensional marginal of the standard distribution. It is
when the standard space is normal and, for example,
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
EXACTjoint chance treatmentis the joint index, so the value approximates the joint safe probability. With the
BONFERRONItreatment the components are solved at the common component target andis 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:
- solver
openturns.OptimizationAlgorithm Inner reliability algorithm applied to the scalarized limit state.
- solver
- getJointChanceTreatment()¶
Accessor to the joint chance treatment.
- Returns:
- treatmentint
Either
DoubleLoopRBDOAlgorithm.EXACTorDoubleLoopRBDOAlgorithm.BONFERRONI.
- getMaximumAbsoluteError()¶
Accessor to maximum allowed absolute error.
- Returns:
- maximumAbsoluteErrorfloat
Maximum allowed absolute error, where the absolute error is defined by
where
and
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
where
is the current approximation of the optimum and
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
if
, else
.
- getMaximumResidualError()¶
Accessor to maximum allowed residual error.
- Returns:
- maximumResidualErrorfloat
Maximum allowed residual error, where the residual error is defined by
if
, else
.
- getMaximumTimeDuration()¶
Accessor to the maximum duration.
- Returns:
- maximumTimefloat
Maximum optimization duration in seconds.
- getMethod()¶
Accessor to the inner reliability formulation.
- Returns:
- methodint
Either
DoubleLoopRBDOAlgorithm.RIAorDoubleLoopRBDOAlgorithm.PMA.
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getOptimizationAlgorithm()¶
Accessor to the outer deterministic optimization algorithm.
- Returns:
- solver
openturns.OptimizationAlgorithm Outer optimization algorithm.
- solver
- 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:
- designPoint
Point Image of the standard-space design point by the inverse isoprobabilistic transformation.
- designPoint
- Raises:
- RuntimeError
If the algorithm has not been run.
- getProblem()¶
Accessor to optimization problem.
- Returns:
- problem
OptimizationProblem Optimization problem.
- problem
- getRBDOProblem()¶
Accessor to the reliability-based design optimization problem.
- Returns:
- problem
RBDOProblem Reliability-based design optimization problem.
- 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
.
- Returns:
- reliabilityIndexfloat
Reliability index
. 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:
- result
OptimizationResult Result class.
- result
- getStandardSpaceDesignPoint()¶
Standard-space design point at the solution.
- Returns:
- designPoint
Point Most probable point in the standard normal space.
- designPoint
- Raises:
- RuntimeError
If the algorithm has not been run.
- getTargetReliabilityIndex()¶
Target reliability index defined by the chance constraint.
The index is
for the exact treatment and the Bonferroni component index for the conservative treatment, where
is the one-dimensional marginal of the standard distribution. It is
when the standard space is normal.
- Returns:
- targetIndexfloat
Target reliability index
.
- 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:
- solver
openturns.OptimizationAlgorithm Inner reliability algorithm applied to the scalarized limit state.
- solver
- setJointChanceTreatment(treatment)¶
Set the joint chance treatment.
- Parameters:
- treatmentint
Either
DoubleLoopRBDOAlgorithm.EXACTfor the exact joint event orDoubleLoopRBDOAlgorithm.BONFERRONIfor 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
where
and
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
where
is the current approximation of the optimum and
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
if
, else
.
- setMaximumResidualError(maximumResidualError)¶
Accessor to maximum allowed residual error.
- Parameters:
- maximumResidualErrorfloat
Maximum allowed residual error, where the residual error is defined by
if
, else
.
- 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.RIAorDoubleLoopRBDOAlgorithm.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:
- solver
openturns.OptimizationAlgorithm Outer optimization algorithm.
- solver
- setProblem(problem)¶
Accessor to optimization problem.
- Parameters:
- problem
OptimizationProblem Optimization problem.
- 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:
- problem
RBDOProblem Reliability-based design optimization problem.
- problem
- setResult(result)¶
Accessor to optimization result.
- Parameters:
- result
OptimizationResult Result class.
- result
- setStartingPoint(startingPoint)¶
Accessor to starting point.
- Parameters:
- startingPoint
Point Starting point.
- startingPoint
- setStartingSample(startingSample)¶
Accessor to starting sample.
- Parameters:
- startingSample
Sample Starting sample.
- startingSample
- 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()
otrobopt