Please don't laugh. I am trying to convert an "if - then" statement into a parametric form that would allow for a smoothed transition between states. It's probably something fairly simple, but I am completely blanking (seems to happen more and more lately). Here is the gist of the problem in it's current state:

A, B are continuous variablesZ is thresholdX is scale value

so I have the following statement in the code:

Q = (X if A > 0 and B > Z else 1) x (X if A less than 0 and B less than Z else 1)

Obviously, the above not a very optimal way of doing it, since Q changes from 1 to X discretely and I want to avoid that type of behavior. Ideally, it would be some sort of a continuous 2-d function that can be tweaked from a completely discrete state above to a more continuous form via several variables. A simple version is to make a X a linear function of B and keep the conditions above, but that does not get rid of discontinuity wrt to A.

I don't interest myself in 'why?'. I think more often in terms of 'when?'...sometimes 'where?'. And always how much?'

the "sigmoid' function that is used in the backpropagation algorithm of neural networks is a very smooth transition between 0 and 1 ... and good explanations are in every introductory neural network machine learning text.

and if you think it's weird that I'm replying at a quarter of midnight on a Saturday in New York, it's even weirder that I'm actually replying at a quarter of 5 a.m. on a Sunday in Vernazza