How to generate Random Number for User defined model

usually, people do via transformation of the uniform number generator. You may check, first, how to generate the exponential distribution using uniform rng. In more complicated cases as yours, it becomes more like a mathematical problem

ps: see an example RNG for truncated distributions - #6 by bgoodri