Skip to content

Commit

Permalink
Added new dynamic strain scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
abarbour committed Jun 19, 2020
1 parent 68ce75d commit 6847d3f
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 64 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: deform
Type: Package
Title: Crustal deformation modeling tools in R
Version: 0.0.999
Date: 2019-07-12
Title: Crustal Deformation Modeling Tools in R
Version: 0.0.989
Date: 2020-06-19
Author: Andrew J. Barbour; some of these tools were
adapted from Matlab(tm) codes by Brendan Crowell (UW),
and Francois Beauducel (IPGP).
Expand All @@ -12,6 +12,7 @@ Description: Crustal deformation modeling tools. Currently this
depleting reservoirs (i.e., Geertsma, 1973; Segall, 1985, 1989, 1992),
spherical cavities (i.e., Mogi, 1958), and
injection point-source (i.e., Rudnicki, 1986).
One can also calculate strains from Mag-Dist relationships.
License: GPL
Imports:
Rcpp (>= 0.11.2),
Expand All @@ -32,5 +33,5 @@ Suggests:
testthat,
covr
LinkingTo: Rcpp
RoxygenNote: 6.1.1
RoxygenNote: 7.1.0
Encoding: UTF-8
111 changes: 87 additions & 24 deletions R/strain_magdist_scaling.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
#' Predict the level of strain expected for magnitude and distance
#'
#' @details
#' Currently the options for \code{model} are:
#' \describe{
#' \item{\code{'static'}}{Static RMS strain from an earthquake (Wyatt, 1988)}
#' \item{\code{'dynamic'}}{Dynamic RMS strain from a seismic wave:
#' \code{'aw14'} for Agnew and Wyatt (2014): applicable to teleseisms at thousands of km (inaccurate within 500km or so); or
#' \code{'bc17'} for Barbour and Crowell (2017): applicable to regional earthquakes at < 500 km (inaccurate
#' for very short distances); or
#' \code{'fbl20'} for Farghal, Barbour and Langbein (2020): applicable to regional earthquakes
#' at < 500 km (best accuracy at short distances; inaccurate > 500 km);
#' }
#' }
#' @name magnitude-distance
#' @param Mw numeric; the moment magnitude of the earthquake
#' @param Distance.km numeric; the epicentral distance, in kilometers
#' @param km2deg numeric; specify the scaling coefficient used to
#' convert the distance (in km) to degrees; this may be useful if,
#' for example, the distance is already in degrees (then set it equal to 1)
#' @param model character; the strain-scaling model to use; currently ignored
#' because there are no alternatives
#' @param model character; the strain-scaling model to use (see Details)
#' @param strn.type character; the type of strain-scaling relationship to
#' provide a prediction for
#'
#' @references Agnew, D. C., and F. K. Wyatt (2014),
#' Dynamic strains from regional and teleseismic earthquakes,
#' Bull. Seismol. Soc. Am. 104, no. 4, 1846– 1859,
#' doi: 10.1785/0120140007
#'
#' @references Barbour, A., and B. Crowell (2017),
#' Dynamic strains for earthquake source characterization,
#' Seismol. Res. Lett. 88, no. 2A, 354–370,
#' doi: 10.1785/0220160155
#'
#' @references Farghal, N., A. Barbour, and J. Langbein (2020),
#' The Potential of Using Dynamic Strains in Earthquake Early Warning Applications,
#' Seismol. Res. Lett., in press, 1–12,
#' doi: 10.1785/0220190385
#'
#' @references Wyatt, F. K. (1988),
#' Measurements of coseismic deformation in southern California: 1972–1982,
#' J. Geophys. Res. 93, no. B7, 7923–7942,
#' doi: 10.1029/JB093iB07p07923
#'
#' @examples
#' static(7.2, 220)
#' dynamic(7.2, 15000, model='aw14')
#'
#' dynamic(7.2, 150, model='aw14')
#' dynamic(7.2, 150, model='bc17')
#' dynamic(7.2, 150, model='fbl20')
NULL

#' @rdname magnitude-distance
Expand All @@ -20,33 +60,56 @@ static <- function(Mw, Distance.km, model="w88"){

#' @rdname magnitude-distance
#' @export
dynamic <- function(Mw, Distance.km, km2deg=NULL, model="aw14",
strn.type=c('general','areal','diffext','shear','dil')){
dynamic <- function(Mw, Distance.km, model=c("aw14",'bc17','fbl20'),
strn.type=c('general','areal','diffext','shear','dil'),
km2deg=NULL){

model <- match.arg(model)
Distance <- Distance.km

if (is.null(km2deg)){
km2deg <- 1/111.3195
}
Distance.deg <- Distance.km * km2deg
ld <- log10(Distance.deg)
strn.type <- match.arg(strn.type)
lstrn <- if (strn.type %in% c("areal",'diffext')){
# areal or differential extension
Err <- 10**(0.93*Mw - 1.63*ld - 2.66)
Ett <- 10**(0.86*Mw - 1.73*ld - 2.46)
strn <- if (strn.type=="areal"){
Ett + Err
if (model %in% c('aw14')){
Distance <- Distance * km2deg
}

ld <- log10(Distance)

lstrn <- if (model == 'fbl20'){
# Farghal, Barbour and Langbein (2020) Equation 11
0.83*Mw - 1.43*ld - 0.0013 * Distance - 8.051
} else if (model == 'bc17'){
# Barbour and Crowell (2017) Equation 8
1.25*Mw - 1.992*ld - 9.513
} else if (model == 'aw14'){
# Agnew and Wyatt (2014)
strn.type <- match.arg(strn.type)
LS <- if (strn.type %in% c("areal",'diffext')){
# areal or differential extension
Err <- 10**(0.93*Mw - 1.63*ld - 2.66)
Ett <- 10**(0.86*Mw - 1.73*ld - 2.46)
strn <- if (strn.type=="areal"){
Ett + Err
} else {
Ett - Err
}
log10(strn)
} else if (strn.type=="shear"){
# shear
0.92*Mw - 1.77*ld - 2.64
} else if (strn.type=="dil"){
# dilatation
0.94*Mw - 1.64*ld - 2.88
} else {
Ett - Err
# general relation
0.95*Mw - 1.65*ld - 2.8
}
log10(strn)
} else if (strn.type=="shear"){
# shear
0.92*Mw - 1.77*ld - 2.64
} else if (strn.type=="dil"){
# dilatation
0.94*Mw - 1.64*ld - 2.88
# they report in nanostrain, so correct to unscaled strain
LS - 9
} else {
# general relation
0.95*Mw - 1.65*ld - 2.8
stop('bad model specification')
}
return(lstrn - 9)

return(lstrn)
}
9 changes: 7 additions & 2 deletions man/cart2pol.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions man/deform.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/geertsma73.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 53 additions & 7 deletions man/magnitude-distance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions man/mogi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions man/rudnicki86.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 30 additions & 6 deletions man/segall85.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6847d3f

Please sign in to comment.