| p.exp {ReacTran} | R Documentation |
Functions that define an y-property as a function of the one-dimensional x-coordinate. These routines can be used to specify properties and parameters as a function of distance, e.g. depth in the water column or the sediment.
They make a transition from an upper (or upstream) zone, with value
y.0 to a lower zone with a value y.inf.
Particularly useful in combination with setup.prop.1D
p.exp: exponentially decreasing transition
y=y0+(y0-yinf)*exp(-max(0,(x-x0))/xa
p.lin: linearly decreasing transition
y=y0 ; y=y0-(y0-yinf)(x-xl)/xatt ; y = yinf
for 0 <=q x <=q x_L, x_L <=q x <=q x_L + x_{att} and (x >=q x_L + x.att ) respectively.
p.sig: sigmoidal decreasing transition
y=yinf+(y0-yinf)exp(-x-(xL+0.5xatt)/(0.25xatt)) / (1+exp(-x-(xL+0.5xatt)/(0.25xatt)))
p.exp(x, y.0=1, y.inf=0.5, x.L=0, x.att=1) p.lin(x, y.0=1, y.inf=0.5, x.L=0, x.att=1) p.sig(x, y.0=1, y.inf=0.5, x.L=0, x.att=1)
x |
the x-values for which the property has to be calculated. |
y.0 |
the y-value at the origin |
y.inf |
the y-value at infinity |
x.L |
the x-coordinate where the transition zone starts;
for x <= x.0, the value will be equal
to y.0. For x >> x.L + x.att the value will
tend to y.inf
|
x.att |
attenuation coefficient in exponential decrease, or the size of the transition zone in the linear and sigmoid decrease |
For p.lin, the width of the transition zone equals x.att and
the depth where the transition zone starts is x.L.
For p.sig, the transition is smooth, but most pronounced in the
transition zone.
For p.exp, there is no clearly demarcated transition zone;
there is an abrupt change at x.L after which the property
exponentially changes from y.0 towards y.L with attenuation
coefficient x.att; the larger x.att the less steep the change.
the property value, estimated for each x-value.
Filip Meysman <f.meysman@nioo.knaw.nl>, Karline Soetaert <k.soetaert@nioo.knaw.nl>
x<- seq(0,5,len=100) plot(x, p.exp(x,x.L=2),xlab="x.coordinate", ylab="y value",ylim=c(0,1)) lines(x, p.lin(x,x.L=2),col="blue") lines(x, p.sig(x,x.L=2),col="red")