How to ensure :sum of state varaibles remain a constant value , dde with constant lags

how can i make sure that none of the values become negative and at the same time their sum to be constant?

solving a dde with constant lags.

Is this enforced by the definition of the system? If so then isoutofdomain. You can also use the DAE form by specifying a mass matrix.

If the sum of several variables is a constant, you should alternatively be able to rewrite the equations to eliminate one of the variables.

Did that …it doesn’t ensure the non-negativity part.The sum is constant alright,I’m going with what @ChrisRackauckas said.

Thanks,