function g=sigmoid(x,t1,t2)
g=1./(1 + exp((t1 - x)./t2));