uqlab
muM = 500; sigmaM = 50;
muV = 700; sigmaV = 105;
muW = 90; sigmaW = 22.5;
t = 0;
deltat = 0.001;
l = 10;
rho_12 = exp(-deltat^2/l^2);
InputOpts.Marginals(1).Name = 'M';  
InputOpts.Marginals(1).Type = 'Gaussian';
InputOpts.Marginals(1).Parameters = [muM sigmaM];
InputOpts.Marginals(2).Name = 'V';  
InputOpts.Marginals(2).Type = 'Gaussian';
InputOpts.Marginals(2).Parameters = [muV sigmaV];
InputOpts.Marginals(3).Name = 'W1';  
InputOpts.Marginals(3).Type = 'Gaussian';
InputOpts.Marginals(3).Parameters = [muW sigmaW];
InputOpts.Marginals(4).Name = 'W2';  
InputOpts.Marginals(4).Type = 'Gaussian';
InputOpts.Marginals(4).Parameters = [muW sigmaW];
InputOpts.Copula.Type = 'Gaussian';
InputOpts.Copula.Parameters = [1 0 0 0; 0 1 0 0;0 0 1 rho_12; 0 0 rho_12 1];
myInput = uq_createInput(InputOpts);
ModelFullOpts1.mString = 'min([(X(:,1).*exp(-0.005*(P(1))-((25/8).*X(:,3))), (X(:,2).*exp(-0.005*P(1))-((5/2).*X(:,3)))],[],2)';
ModelFullOpts1.Parameters = t ;
ModelFullOpts1.isVectorized = true;
myLimitStateFull1 = uq_createModel(ModelFullOpts1);
ModelFullOpts2.mString = 'min([(X(:,1).*exp(-0.005.*(P(1)+P(2)))-((25/8).*X(:,4))), (X(:,2).*exp(-0.005.*(P(1)+P(2)))-((5/2).*X(:,4)))],[],2)';
ModelFullOpts2.Parameters = [t deltat];
ModelFullOpts2.isVectorized = true;
myLimitStateFull2 = uq_createModel(ModelFullOpts2);
LSOpts.mString = ['myLimitStateFull1' 'myLimitStateFull2'];
LSOpts.Parameters = [t t+deltat];
myLimitState = uq_createModel(LSOpts);
MCSOpts.Type = 'Reliability';
MCSOpts.Method = 'MCS';
MCSOpts.Simulation.MaxSampleSize=100000;
MCSAnalysis = uq_createAnalysis(MCSOpts);
uq_print(MCSAnalysis);
uq_display(MCSAnalysis)