How can I specify a numerical order for variables?

I need to specify that a variable is less than another, and greater than yet another, in a Mathematica program, because I will later apply a test to them that will determine what functional form to use. I also need Sign[] to give the correct answer. I tried using TagSet like this:

h /: (h>=d0) = True
h /: (h<=d1) = True

but this does not work with Sign[h-d0], for example, and

h /: Sign[h - d0] = 1;

fails because it says h is too deep.

An example of how I will use this:

f[x_] := Exp[ c Sign[h-x] ]

where x can take the values d0 or d1. (This will be used to set up boundary relations to solve for a set of coefficients to solve a PDE.) I suppose I could use some If statements to set the whole thing up, but thought it would be nicer to have a specification of the properties of h.

I'm sure this should be easy to do - any help is appreciated.

• Maybe you could just rescale $x$ to $\xi =x/h$, so you can work on ${\mathrm{sgn}}(1-\xi)$. Aug 18 '12 at 16:05
• is it for numeric or analytic solution of PDE? Aug 18 '12 at 16:23
• Unprotect[Sign]; Sign[h - d0] = 1; Aug 18 '12 at 18:09