How to stop a simulation when a critical value is hit?

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Submitted by gingergine on Sun, 02/07/2010 - 12:24 

 

How do I stop a simulation, or say, yield a 0 value, when a critical value (e.g. 100 is reached?). For my simulation, I am hoping to plot the degradation of glucose. Once the amount of glucose (y) has been depleted, i.e. y=0, the graph becomes really erratic (I assume because thats the the equation is illogical when y < 0 i.e. impossible). How do I make the simulation stop at that point? Thanks

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    Submitted by Richd on Mon, 02/08/2010 - 20:16.

    The Stop block is found under 'Signal Consumers'. Feed in the criteria for stopping and VisSim will stop when the input expression is true (non zero). In your case use 'y <= 0' Do not use y == 0, since it is quite likely that y will jump from some small positive value down to a small negative value without stopping at exactly zero.