Hi everyone,

I use “**Quantile Monte Carlo (QMC) with IP**” to solve my RBDO problem.

I want to include the calculated probability of failure (**Pf**) at each optimization step in the cost function. In other words, the **Pf** value be a part of the cost function. How can this be done with UQLab commands?

I defined “**myRBDO_QIP.Results.History.Constraints**” as a separate variable, but that doesn’t work. Do you have a suggestion?

**Here is my cost function:**

```
function Y = uq_Ex02_RubBreakwat_cost(X)
% Definition of Val: Volume of Main Armor Layer
Val = 0.5*X(:,1).*(((X(:,1)+X(:,2)+X(:,3))./sin(X(:,9)))+...
((X(:,2)+X(:,3))./sin(X(:,9))))+(X(:,4).*X(:,1));
% Definition of Vul: Volume of Underlayer
Vfl = 0.5*X(:,2).*(((X(:,2)+X(:,3))./sin(X(:,9)))+...
((X(:,3))./sin(X(:,9)))) + X(:,5).*X(:,6) + X(:,2).*...
(X(:,4)+(X(:,1)+X(:,2))/3)+X(:,2).*X(:,3)./sin(X(:,8));
% Definition of Vcl: Volume of Core Layer
Vcl = 0.5*X(:,3).*(2*X(:,7)+X(:,3).*cot(X(:,9))+X(:,3).*cot(X(:,8)))+...
0.5*(4+X(:,6)+(X(:,2)./sin(X(:,8)))+((X(:,1)+X(:,2))./sin(X(:,9))));
Pf = myRBDO_QIP.Results.History.Constraints.Pf;
% Penalty Function for Controling Overtopping Failure
failurep1 = Pf(:,1);
if failurep1 > 0.001
Penalty1 = 1000000 * (failurep1 - 0.001);
else
Penalty1 = 0;
end
% Penalty Function for Controling Failure due to Armor Instability
failurep2 = Pf(:,2);
if failurep2 > 0.001
Penalty2 = 1000000 * (failurep2 - 0.001);
else
Penalty2 = 0;
end
% Penalty Function for Controling Toe Erosion Failure
failurep3 = Pf(:,3);
if failurep3 > 0.001
Penalty3 = 100000 * (failurep3 - 0.001);
else
Penalty3 = 0;
end
% Calculation of Construction Cost
Y = 822*Val + 166*Vfl + 131*Vcl + Penalty1 + Penalty2 + Penalty3;
end
```

Thanks for your consideration