Hi Michael,
I'm confused about something. What are entities representing in your model? What is the rate at which you are generating entities? Are you generating them each time step? Are you generating them on an event-basis or time-basis? I am wondering this, because the holding of state for 50 time steps seems more time-based, than event-based. I am wondering whether you really want to represent failure as an attribute.
I can think of two possible ways of generating the signals for failures:
1)Stateflow (http://www.mathworks.com/products/stateflow/)
3) MATLAB Function block (http://www.mathworks.com/help/simulink/slref/matlabfunction.html)
With Stateflow and the MATLAB function block, you will need to use a Signal to Event Gateway block to change the signal from the time-based to event-based domain.
Without knowing what an entity represents in this system and why the failure state is being sent for 50 time steps, this is hard to answer though. Is it that a failure state would trigger a time-based shutdown, then the attribute should not continue to be set to failure, but instead the model should model the shut down of the system for a certain period of time?
There is something you might not know about that is relevant for this. There is a Service Control tab on the Server block that allows you to either pause or force complete service in a server for modeling system failures or maintenance. To use this, you would click the "Allow service control" checkbox, then you can set what would happen when the system is disabled. (By the way, to do this you would have to change your inputs, a positive input signal, would disable the server.) Then, you could send a 1 for instance for 50 time steps, and the server would be disabled for those 50 time steps, no entities could go in or out of the server during that time. That way you could model a machine going down for a specified amount of time using a random signal generated and held.
Anyway, if you could give me more information, I think I could give you a better answer.
-Teresa
"Michael" wrote in message <klempc$gm7$1@newscl01ah.mathworks.com>...
> I am working on switching concepts for a water supply model, and I am having some trouble doing so. I would appreciate any recommendations people might offer. Both concepts are related to vulnerability.
>
> (1) Under normal conditions, an entity having atribute value "1" is generated. Under a failure state, an entity having attribute value "0" is generated. I would like for the failure state to occur randomly (such as U(0,1) < threshold) and then be held for a period of time, say 50 timesteps, before going back to the normal condition.
>
> (2) Similar to above, but instead of being random, the failed state would be initiated by a triggering event, and once again be held for a specific period of time. I would like to use this, for example, to explore "worst case" scenarios such as a major asset failure in conjunction with a reservoir meeting some critical low level.
>
> Any suggestions? I have tried using gates, etc, but can't seem to figure out a way to accomplish either concept. I consider myself somewhat capable using Simulink, but I am new to SimEvents and I am struggling a bit.
>
> Thank you in advance for any contributions.
I'm confused about something. What are entities representing in your model? What is the rate at which you are generating entities? Are you generating them each time step? Are you generating them on an event-basis or time-basis? I am wondering this, because the holding of state for 50 time steps seems more time-based, than event-based. I am wondering whether you really want to represent failure as an attribute.
I can think of two possible ways of generating the signals for failures:
1)Stateflow (http://www.mathworks.com/products/stateflow/)
3) MATLAB Function block (http://www.mathworks.com/help/simulink/slref/matlabfunction.html)
With Stateflow and the MATLAB function block, you will need to use a Signal to Event Gateway block to change the signal from the time-based to event-based domain.
Without knowing what an entity represents in this system and why the failure state is being sent for 50 time steps, this is hard to answer though. Is it that a failure state would trigger a time-based shutdown, then the attribute should not continue to be set to failure, but instead the model should model the shut down of the system for a certain period of time?
There is something you might not know about that is relevant for this. There is a Service Control tab on the Server block that allows you to either pause or force complete service in a server for modeling system failures or maintenance. To use this, you would click the "Allow service control" checkbox, then you can set what would happen when the system is disabled. (By the way, to do this you would have to change your inputs, a positive input signal, would disable the server.) Then, you could send a 1 for instance for 50 time steps, and the server would be disabled for those 50 time steps, no entities could go in or out of the server during that time. That way you could model a machine going down for a specified amount of time using a random signal generated and held.
Anyway, if you could give me more information, I think I could give you a better answer.
-Teresa
"Michael" wrote in message <klempc$gm7$1@newscl01ah.mathworks.com>...
> I am working on switching concepts for a water supply model, and I am having some trouble doing so. I would appreciate any recommendations people might offer. Both concepts are related to vulnerability.
>
> (1) Under normal conditions, an entity having atribute value "1" is generated. Under a failure state, an entity having attribute value "0" is generated. I would like for the failure state to occur randomly (such as U(0,1) < threshold) and then be held for a period of time, say 50 timesteps, before going back to the normal condition.
>
> (2) Similar to above, but instead of being random, the failed state would be initiated by a triggering event, and once again be held for a specific period of time. I would like to use this, for example, to explore "worst case" scenarios such as a major asset failure in conjunction with a reservoir meeting some critical low level.
>
> Any suggestions? I have tried using gates, etc, but can't seem to figure out a way to accomplish either concept. I consider myself somewhat capable using Simulink, but I am new to SimEvents and I am struggling a bit.
>
> Thank you in advance for any contributions.