Parallel System (problem definition)

From COSSAN Wiki
Jump to: navigation, search
__NORICHEDITOR__

This page shows how to prepare the model for Parallel System with COSSAN-X.

Problem Definition in COSSAN-X

Define a Project

In a first step a new project named 'ParallelSystem' is created: This can be done by pressing the 'new' icon, or from the menu File->New->Project.
After the project has been created, the project name 'ParallelSystem' appears in the workspace.

Definition of Inputs

This tutorial requires the definition of 5 standard normal distributed random variable and 4 parameters that define the capacity of each performance function.

Parameters


In a next step, the constant input parameters, i.e. the capacities of each performance function, are specified. Clicking with the right button at the folder 'parameter' and selecting 'Add parameter' it is possible to create a new parameter object. After pressing finish, a Parameter object is created and it propertis can edited (see also Parameter (editor)):


ParallelSystemParameter1.png

The same procedure is repeated to define the all the paremeters: MaxA MaxB MaxC MaxD.


ParallelSystemParameter2.png


ParallelSystemParameter3.png


ParallelSystemParameter4.png

Random Variables

In a next step, 5 random variables are created. The random variables can be added to the project right clicking on the folder RandomVariable. The, after selecting a name and a description and pressing the button finish, the random variable editor appears. The random variables are defined as shown in the following figures:


ParallelSystemRV.png

All the random variables are normally distributed with a 0 mean and 1 standard deviation.

Random Variable Set

The above defined random variables are used to define a set of independent Random Variable. This set of random variable will be used in the definition of the Input in the Solution Sequence. The random variable set is defined as shown in the following figures:


ParallelSystemRVSET.png

It contains all the 5 random variables defined in this tutorial and no correlation as shows by the menu bar:


ParallelSystemRVSET1.png

Definition of Evaluator

In this section the performance functions that define the individual failure criteria are defined.

Each performance function is defined using a matlab script. Hence, it is necessary to define first the matlab script in the Evaluation section and then define the performance functions based on the created matlab scripts.

Matlab Scripts

Clicking with the right bottom on the folder Matlab script (in the Evaluation section) the wizard to create a new matlab script is invoked:


ParallelSystemMatlabScriowizard.png

Then the matlab script is defined as following:

XmA

  • Input: Max1, rv1, rv2
  • Output: outA
  • Matlab I/O type: Matlab script / Single Array
  • Script:
Moutput=Minput(:,1)-Minput(:,2)-Minput(:,3);

ParallelSystemMatlabA.png


ParallelSystemMatlabScriptA.png

XmB

  • Input: Max2, rv2, rv3
  • Output: outB
  • Matlab I/O type: Matlab script / Single Array
  • Script:
Moutput=Minput(:,1)-Minput(:,2)-Minput(:,3);


XmC

  • Input: Max3, rv3, rv4
  • Output: outC
  • Matlab I/O type: Matlab script / Single Array
  • Script:
Moutput=Minput(:,1)-Minput(:,2)-Minput(:,3);

XmD

  • Input: Max4, rv4, rv5
  • Output: outD
  • Matlab I/O type: Matlab script / Single Array
  • Script:
Moutput=Minput(:,1)-Minput(:,2)-Minput(:,3);


Performance Functions

From the menu tree, clicking with the right bottom on the folder Performance Function the wizard to create a new Performance Function object is invoked:


ParallelSystemPerformanceFunctionwizard.png

The Performance functions are defined selection the User Defined option in the editor and adding the corresponding matlab script as shown in the following figures:


ParallelSystemPerformanceFunction1.png


ParallelSystemPerformanceFunction2.png


ParallelSystemPerformanceFunction3.png


ParallelSystemPerformanceFunction4.png

Model

In this tutorial a Solution Sequence model is used to defined the problem. The solution sequence object is a very powerful and flexible object that allows to define custom analysis and to use all the COSSAN objects defined in the engine.

Solution Sequence

The Solution Sequence model can be created invoking clicking on the icon new Solution Sequence (SolutionSequenceIconNew.png ) or right click on the folder SolutionSequence in the Model section:


ParallelSystemSolutionSequenceWizard.png

Pressing finish the SolutionSequence editor is created:
ParallelSystemSolutionSequenceEditor.png


ParallelSystemSolutionSequenceEditor2.png


%% TUTORIAL PARALLEL SYSTEM
%% COSSAN-X
%% Author: Edoardo Patelli, 2011
 
% Define Input object based on the RandomVariableSet and the Parameter object 
Xin = Input('CXmembers',{rvset1 Max1 Max2 Max3 Max4},'CSmembers',{'rvset1' 'Max1' 'Max2' 'Max3' 'Max4' });
%%  Definition of the Model
% In this example the physical model is composed by an empty Evaluator. This
% mean that there is nothing to be computed in advance before evaluate the
% performance functions. 
 
% The evaluator is empty since there is nothing to be evaluated.
Xev= Evaluator;
 
% Define the Models
Xmdl= Model('Xevaluator',Xev,'Xinput',Xin);
 
% Fault Tree object. 
CnodeTypes={'Output','AND','Input','Input','Input','Input'};
CnodeNames={'TopEvent','AND gate','perfun1','perfun2','perfun3','perfun4'};
 
% Be carefull with the name of the basic events. They should correspond to
% the name of the performance function.
VnodeConnections=[0 1 2 2 2 2];
% Construct a FaultTree object
Xft=FaultTree('CnodeTypes',CnodeTypes,'CnodeNames',CnodeNames,...
               'VnodeConnections',VnodeConnections, ...
               'Sdescription','FaultTree Tutorial of SystemReliability');
 
% Summary of the FaultTree
display(Xft)
 
% Display the FaultTree
f1=Xft.plotTree;
 
% Identify the minimal cut-sets
Xft=Xft.findMinimalCutSets;
display(Xft)           
 
% Now we can construct a SystemReliability object composed by the
% PerformanceFunction objects, a Model and the FaultTree
Xsys=SystemReliability('Cmembers',{'perfun1' 'perfun2' 'perfun3' 'perfun4'},...
     'CXperformanceFunctions',{perfun1 perfun2 perfun3 perfun4}, ...
     'Xmodel',Xmdl,'XFaultTree',Xft);
 
%% Use the SystemReliability object 
% The SystemReliability object is used here to estimate the failure
% probability associated to the cutset adopting the Monte Carlo simulation. 
Xmc=MonteCarlo('Nsamples',5e5,'Nbatches',10);
XpfReference=Xsys.pf('Xsimulation',Xmc);
 
% Show summary of the results
display(XpfReference)
 
% Now we can estimate the failure probability of the System considering 
% separately the contribute of each limit state function
%
% First at all we use cossan to estimate the design point for each
% performance fucntion and we store the results indide the object
% SystemReliability. This is done automatically invoking the method
% designPointIdentification of the class SystemReliability
 
Xsys=Xsys.designPointIdentification;
 
%% Find desing Point of the parallel system
% Find designPoint using linear hypothesis 
% It is not necessary to specify the cut-set since is already defined in
% the FaultTree included in the SystemReliability object
[~, XdpIntersection] = Xsys.findLinearIntersection('tolerance',1e-2);
% 
display(XdpIntersection)
 
% It is important to notice that although the single limit state function are
% linear and very simple the failure probability of the system component can not
% in general, be estimated with approximate method such as FORM/SORM.
% In fact, the associated failure probability of the parellel system based on
% the FORM method is:
display(sprintf('Failure Probability based on the FORM : %10.3e',XdpIntersection.form))
% that is really far away from the reference solution
display(sprintf('Failure Probability of the reference  : %10.3e',XpfReference.pfhat))
 
%% Compute the failure probability for each event
% It is possible to compute the failure probability of each individual event
% defined in the SystemRealibility object using 
Xmc=MonteCarlo('Nsamples',1e4);
Xsys=Xsys.pfComponents(Xmc);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
 
% The system reliability object contains now also the FailureProbability object
% associated to each component. Hence, 4 Failure probability object are present
display(Xsys)
 
% For instance the failure probability of the first limit state function is:
display(Xsys.XfailureProbability(1))
 
 
%% Compute the failure probability for the cutset 1-2-3-4 (i.e. the parallel system)
% In this section the failure probability associate to the cutset 1-2-3-4 is
% computed using different sampling strategies
 
% It is possible to obtain the failure probability of an arbitrary cut set using
% the method getCutset of the SystemReliability object.
% PLEASE NOTE that the computed  failure probability is computed using the
% hypothesis of INDEPENDENT EVENTS:
 
Xcs12=Xsys.getCutset('Vcutsetindex',[1 2]);
Xcs134=Xsys.getCutset('Vcutsetindex',[1 3 4]);
Xcs1234=Xsys.getCutset('Vcutsetindex',[1 2 3 4]);
 
% This values is really far away from the estimated failure probability for the
% parallel system
 
display(sprintf('Failure Probability Cut set 1-2       : %10.3e',Xcs12.failureProbability))
display(sprintf('Failure Probability Cut set 1-3-4     : %10.3e',Xcs134.failureProbability))
display(sprintf('Failure Probability Cut set 1-2-3-4   : %10.3e',Xcs1234.failureProbability))
 
display(sprintf('Failure Probability of the reference  : %10.3e',XpfReference.pfhat))
 
% The method compute bounds of the cutset allows to estimate the first order
% approximation.
Xcs1234=Xcs1234.computeBounds;
 
% The second order bounds requires the estimation of the cross failure
% probability (i.e. the failure probability associated to the combination of 2
% limit state function)
 
% In order to estimate the failure probability of a cut set without the
% hypothesis of independent events it is necessary to used some simulation
% methods.
 
%% Compute the failure probability using an high performance importance sampling procedure
% See for more information the tutorial TutorialSystemReliability
XpfIS=Xsys.HPIS;
 
%% Export results
COSSANoutput{1}=Xsys;
COSSANoutput{2}=XdpIntersection;
COSSANoutput{3}=Xcs1234;
COSSANoutput{4}=XpfReference;
COSSANoutput{5}=XpfIS;

See also