1
$\begingroup$

I would like to convert the negative outcome of $r_2$ to zero. I have used the following code, but it still gives me a negative value. Is there any option to turn the negative outcome directly to zero? I already set the different random value of γ.

FullSimplify[Subscript[r, 2] -> (γ Subscript[c, 1] , Subscript[r, 2] > 0]
$\endgroup$
4
  • 3
    $\begingroup$ You could use UnitStep[] for this... $\endgroup$ – J. M.'s ennui Feb 1 at 8:31
  • $\begingroup$ Change the definition of r_2 so that it returns zero for negative values. $\endgroup$ – Daniel Huber Feb 1 at 10:36
  • 3
    $\begingroup$ Or Clip[..., {0, Infinity}]. $\endgroup$ – Michael E2 Feb 1 at 15:26
  • $\begingroup$ try Ramp? $\endgroup$ – kglr Feb 1 at 15:32

Browse other questions tagged or ask your own question.