# How to determine a function that fits a geological model

I have a problem. I am currently working on a code that works by comparing data (real or synthetic) to an earth model (described by earth layers, or in this particular, velocity (aref, vref, atrue, vtrue)). The velocity aref is logarithmic velocity of reference earth or model, vref is the non-logarithmic velocity of reference earth or model, atrue is logarithmic velocity in real or synthetic data, and vref is non-logarithmic velocity in real or synthetic data. All the functions are in the variable of space grid i (aref(i), vref(i), atrue(i), vtrue(i)). The functions are :

Do[aref[i] = -1.5 + HeavisideTheta[Sin[(i/8) + 1.4]], {i, imin + 1, imax - 1}]
Do[vref[i] = c Exp[aref[i]/2], {i, imin + 1, imax - 1}]
Do[atrue[i] = aref[i] + vec[i], {i, imin + 1, imax - 1}]
Do[vtrue[i] = c Exp[atrue[i]/2], {i, imin + 1, imax - 1}]


aref is the only function that can be changed; the rest is fixed.

In this code, we have to define earth model through aref. The process is to find minimum error between data and model using misfit function, which in this case the minimum is achieved using Gradient Descent Method. So this is the optimization process.

So my problem is : I have to make a new function for aref which resembles geologic formation, for example, function that forms line GR column in Fig43b.jpg

.

I've tried many functions (Heaviside, Sin, etc.) but none closer to a geologic velocity. I've also tried using convolution method in Excel and import it to Mathematica but unable to do the convolution between the seismic wavelet and the earth model. In summary, my problem is to find a function that fits geologic model like in the picture; not the function, but how to find the function that fits like it when plotted.