RBDO run problem "uq_MarginalFields"

Hi everyone,
I tried to customize and run Example_RBDO_01 with the inputs of my problem, but I came across the following error message:

Index exceeds matrix dimensions.
Error in uq_MarginalFields (line 98)
&& isfield(marginals(ii),‘Moments’) && marginals(ii).Moments(2) == 0

Error in uq_initialize_uq_default_input (line 134)
marginals = uq_MarginalFields(marginals);

Error in uq_runReliability (line 45)
ReliabOpts.Input = uq_createInput(IOpts, ‘-private’) ;

Error in uq_twolevel_evalConstraints (line 6)
myLocalAnalysis = uq_runReliability (d, current_analysis ) ;

Error in uq_matlabnonlconwrapper (line 22)
hc = uq_twolevel_evalConstraints( d, current_analysis ) ;

Error in uq_runRBDOptimizer>@(X)uq_matlabnonlconwrapper(X,current_analysis) (line 67)
nonlcon = @(X)uq_matlabnonlconwrapper( X, current_analysis ) ;

Error in fmincon (line 623)
[ctmp,ceqtmp] = feval(confcn{3},X,varargin{:});

Error in uq_runRBDOptimizer (line 68)
[Xstar,Fstar,exitflag,output] = fmincon(fun,x0,[],[],[],[],lb,ub,nonlcon,optim_options) ;

Error in uq_rbdo (line 75)
results = uq_runRBDOptimizer(current_analysis) ;

Error in uq_initialize_uq_rbdo (line 1666)
uq_runAnalysis(current_analysis);

Error in uq_rubmoundbreakwater_01 (line 159)
myRBDO_RIA = uq_createAnalysis(RIAOpts) ;

Does anyone have a suggestion to solve this problem?
The zip version of all code files is also attached.

RBDO.zip (3.2 KB)

Hi @Soheil_Radfar,

I just had a look at your files. The problem is that the design parameters are not properly defined. For random variables associated to the design parameters, you shouldn’t specify the moments but either the standard deviation or the coefficient of variations (CoV). The reason is that the mean of the random variables is evolving during the optimization process and the standard deviation can either be user-defined or derived using the defined CoV.

So the following lines:

        RBDOOpts.Input.DesVar(1).Name = 'a';  % Armor-layer height
        RBDOOpts.Input.DesVar(1).Type = 'Gaussian';
        RBDOOpts.Input.DesVar(1).Moments = [2.5 0.25] ;

should read:

    RBDOOpts.Input.DesVar(1).Name = 'a';  % Armor-layer height
    RBDOOpts.Input.DesVar(1).Type = 'Gaussian';
    RBDOOpts.Input.DesVar(1).Std = 0.25;

If you want 2.5 to be the starting point for the optimizer you can use the option RBDOpts.Optim.StartingPoint

(Note that this change should be reported to all 12 design variables).

I have also noticed two other errors that will keep your code from running properly once the update above is made.
First in the following lines

RBDOOpts.SoftConstraints.mString = ‘3.0 - cot(X(:,10))’;
RBDOOpts.SoftConstraints.mString = ‘3.0 - cot(X(:,11))’;
RBDOOpts.SoftConstraints.mString = ‘3.0 - cot(X(:,12))’;
RBDOOpts.SoftConstraints.mString = ‘cot(X(:,10)) - 1.5’;
RBDOOpts.SoftConstraints.mString = ‘cot(X(:,11)) - 1.5’;
RBDOOpts.SoftConstraints.mString = ‘cot(X(:,12)) - 1.5’;
RBDOOpts.SoftConstraints.mString = ‘6.0 - X(:,5)’;
RBDOOpts.SoftConstraints.mString = ‘X(:,5) - 1.0’;

Only the last constraint will be considered as the others are overwritten. I would suggest you create a single .mFile where you put all the constraints together (as you did for the hard constraints).

Finally, in your constraint function, you are overwriting the Matlab function cot by assigning it a value and then a few lines later try to evaluate cot(X(:,10)). This will not work…

Hope this helps.
Cheers

1 Like

Dear @moustapha,
Thank you very much for your invaluable help.

I have also another question.
In an RBDO problem, in addition to inequality constraints, there are also equality constraints.
How to implement equality constraints in the code. For inequality constraints we use soft constraints, but what about equality constraints?