function H=slip(a, A, x, t, k,bdegrees)
%This function solves the continuous offset conditions problem for
%a = half scarp initial height
%A = half vertical offset rate
%x = distance along profile
%t = time
%k = diffusivity in distance^2/time
%bdegrees is far field slope in degrees
%b = far field slope in radians
%from Hanks, T. C., R. C. Bucknam, K. R. Lajoie and R. E. Wallace,
%Modification of wave-cut and fault-controlled landforms,
%\emph{Journal of Geophysical Research}, \emph{89}, 5771-5790,
%1984.

b=rads(bdegrees);
kt = k.*t;
stkt=2.*sqrt(kt);

Hone=(a+A.*t).*erf(x./stkt)
Htwo=((A.*x.^2)./(2.*k)).*(erf(x./stkt)-sign(x))
Hthree=((A.*x)./k).*sqrt(kt./pi).*exp((-x.^2)./(4.*kt))
Hfour=b.*x
H=Hone+Htwo+Hthree+Hfour;

figure(2)
clf
hold on
plot(x,Hone,'r-')
plot(x,Htwo,'k-')
plot(x,Hthree,'b-')
plot(x,Hfour,'m-')