Need Help in Monte Carlo and comparing operational sequence

I need help to run a Monte Carlo Simulation. Consider a system which has two components, working in parallel such that system fails when both the components fail. Each component can be either operational or failed. So far I have been successful in generating random numbers and arrays (n by 1) which represents operational sequence of components. The first and second element of matrix B & D represents time to failure and repair respectively and so forth. Now I need to compare the operational sequence of components in order to find out when and how long actually system failed (overlapping failures).
lam1=0.01; %failure rate of component 1
meu1=0.003; %repair rate of component 1
lam2=0.0024; %failure rate of component 2
meu2=0.003; %repair rate of component 2
n=10000; %number of simulations
r1=rand(n,1); %random numbers
r2=rand(n,1);
r3=rand(n,1);
r4=rand(n,1);
TTF1 = (-1/lam1)*log(r1); %time to failure of component 1
TTR1 = (-1/meu1)*log(r2); %time to repair of component 1
A = [TTF1 TTR1];
B = reshape(A',n*2,1); %component 1 operational sequence
TTF2 = (-1/lam2)*log(r3); %time to failure of component 2
TTR2 = (-1/meu2)*log(r4); %time to repair of component 2
C = [TTF2 TTR2];
D = reshape(C',n*2,1); %component 2 operational sequence
Please guide me how this be accomplished in Matlab. Needs a AND logic but since the Times are based on random numbers therefore its difficult to compare the two sequences. Reference to figure 12.21, page 429. Link: <http://books.google.no/books?id=b6I4MdiVgn8C&printsec=frontcover&dq=roy+billinton&hl=no&ei=IoS1TcDmE8XBswaJjMHgDA&sa=X&oi=book_result&ct=result&resnum=2&ved=0CDAQ6AEwAQ#v=onepage&q=monte%20carlo&f=false>
Thanks

댓글 수: 4

Now I need to compare the operational sequence of components in order to find out when and how long actually system failed (overlapping failures).
Define this in terms of logic. Do you just want a logical AND?
Mostly yes. Let me elaborate it more. For example consider two arrays representing component 1 and 2 respectively: 100,20,200,10,50,30,90 and 250,10,50,40,40,40,70. First number in each represents TTF and second represents TTR. These sequences show that, although both components fail three times, the system only fails twice, once for 10 hours and once for 20 hours in the 500 hour operational life simulated. Simulating for longer life requires a logic in Matlab. Your reply will be highly appreciated.
Also would like to add the system sequence by manual comparing becomes:
System = 320,10,60,20,90
I recommend you this Matlab code for implementation of Monte Carlo method for sensitivity analysis of Simulink models: http://www.mathworks.com/matlabcentral/fileexchange/47758-sensitivity-analysis-in-simulink-models-with-monte-carlo-method

댓글을 달려면 로그인하십시오.

 채택된 답변

Simulink Dude
Simulink Dude 2011년 4월 23일

0 개 추천

I would use SimEvents to do this-create two queues where I would model the entity in the two parallel paths as representing a failure. A server that services each of those entities would function as the repair man on the two lines. Each time an entity departs the server on either queue, simply generate a STEP signal in Simulink. Disable this when a new entity is generated. AND them as someone suggested to get the times you so desire.

댓글 수: 2

I would prefer to program this in Matlab.
Thanks anyway.
have you got answer?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Richard Willey
Richard Willey 2011년 4월 25일

0 개 추천

Hi Hammad
It's difficult to answer this without more information about your model.
The easiest way to implement this would be to create a Markov Chain. However, this involves some explicit assumptions about independence.
The following MATLAB Central submission has sample code that might prove useful

댓글 수: 3

Hi Richard
Thanks for the file. I m trying to accomplish the same objective but without Markov Chain and for two components.
Markov chains are the standard way to model this type of problem (so long as the right assumptions hold). Is there a specific reason why you can't use a Markov chain?
There is a book by Roy Billinton:
http://books.google.no/books?id=b6I4MdiVgn8C&printsec=frontcover&dq=roy+billinton&hl=no&ei=IoS1TcDmE8XBswaJjMHgDA&sa=X&oi=book_result&ct=result&resnum=2&ved=0CDAQ6AEwAQ#v=onepage&q=monte%20carlo&f=false
Page 429 and Figure 12.21
He has not used Markov chain, and simulated and calculated the system unavailability. Although I think its more or less Markov Chain.

댓글을 달려면 로그인하십시오.

카테고리

제품

질문:

2011년 4월 22일

댓글:

2019년 12월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by