|
| 1 | +%% Problem Definition |
| 2 | +RV1 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 3 | +RV2 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 4 | +RV3 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 5 | +RV4 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 6 | +RV5 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 7 | +RV6 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 8 | +RV7 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 9 | +RV8 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 10 | +RV9 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 11 | +RV10 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 12 | +RV11 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 13 | +RV12 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 14 | +RV13 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 15 | +RV14 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 16 | +RV15 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 17 | +RV16 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 18 | +RV17 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 19 | +RV18 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 20 | +RV19 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 21 | +RV20 = RandomVariable('Sdistribution','exponential', 'mean',1,'std',1); |
| 22 | + |
| 23 | +% Define the RVset |
| 24 | +Xrvs = RandomVariableSet(... |
| 25 | + 'Cmembers',{'RV1','RV2','RV3','RV4','RV5','RV6','RV7','RV8','RV9','RV10',... |
| 26 | + 'RV11','RV12','RV13','RV14','RV15','RV16','RV17','RV18','RV19','RV20'},... |
| 27 | + 'CXrv',{RV1 RV2 RV3 RV4 RV5 RV6 RV7 RV8 RV9 RV10 ... |
| 28 | + RV11 RV12 RV13 RV14 RV15 RV16 RV17 RV18 RV19 RV20}); %% Define the evaluator |
| 29 | +% Construct a Mio object |
| 30 | +Xm=Mio( 'Sdescription', 'Performance function', ... |
| 31 | + ...'Sscript','for j=1:length(Tinput), Toutput(j).out1=sqrt(Tinput(j).RV1^2+Tinput(j).RV2^2); end', ... |
| 32 | + 'Spath',pwd,... |
| 33 | + 'Sfile',[specs.Problem,'_mio'],... |
| 34 | + 'Liostructure',true,... |
| 35 | + 'Coutputnames',{'out'},... |
| 36 | + 'Cinputnames',{'RV1','RV2','RV3','RV4','RV5','RV6','RV7','RV8','RV9','RV10',... |
| 37 | + 'RV11','RV12','RV13','RV14','RV15','RV16','RV17','RV18','RV19','RV20'},... |
| 38 | + 'Lfunction',false); % This flag specify if the .m file is a script or a function. |
| 39 | + |
| 40 | +% Construct the Evaluator |
| 41 | +Xeval = Evaluator('Xmio',Xm,'Sdescription','Evaluator xmio'); |
| 42 | +% Define Input object |
| 43 | +Xin = Input('Sdescription','Blackbox reliability challenge'); |
| 44 | +Xthreshold = Parameter('value',0); |
| 45 | +Xin = Xin.add('Xmember',Xrvs,'Sname','Xrvs'); |
| 46 | +Xin = Xin.add('Xmember',Xthreshold,'Sname','Xthreshold'); |
| 47 | +% Define a Model |
| 48 | +Xmdl=Model('Xevaluator',Xeval,'Xinput',Xin); |
| 49 | +% Define performance function |
| 50 | +Xpf=PerformanceFunction('Scapacity','out','Sdemand','Xthreshold','Soutputname','Vg'); |
| 51 | +% Construct the model |
| 52 | +Xpm=ProbabilisticModel('Xmodel',Xmdl,'XperformanceFunction',Xpf); |
| 53 | + |
| 54 | +Xsimulator = constructSimulator(specs,Xpm); |
| 55 | +%% |
| 56 | +[XpF, Xoutput] = Xpm.computeFailureProbability(Xsimulator); |
| 57 | + |
| 58 | +makePlots |
0 commit comments