% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitDnCurve.R
\name{fitDnCurve}
\alias{fitDnCurve}
\title{Newmark displacement curve Dn(ky) for one scenario}
\usage{
fitDnCurve(uhs, ky, Ts, Mw = 6.5, NS = 30L, Rrup = 100, weights, NFC = "D100")
}
\arguments{
\item{uhs}{data.table with columns Tn, p, Sa (one scenario)}

\item{ky}{numeric vector, yield accelerations (g)}

\item{Ts}{numeric scalar, fundamental period (s)}

\item{Mw}{numeric scalar, moment magnitude}

\item{NS}{integer, Monte Carlo samples for curve quantiles and
per-realisation draws.}

\item{Rrup}{numeric scalar, rupture distance (km)}

\item{weights}{named numeric vector, ensemble weights by IDn}

\item{NFC}{character, near-fault component selector for model BM19:
\code{"D100"} (maximum component, default) or \code{"D50"}.
Ignored by all other submodels.}
}
\value{
list(curve, draws). curve = data.table(ky, p, Dn, IDn, w).
draws = data.table(ky, s, Dn, IDn) — always populated (possibly
empty when no model produces output). Dn in cm.
}
\description{
Evaluates ensemble and per-submodel Dn over a vector of ky values.
The scenario is sampled once and the same epsilon is reused across all ky
so that each realisation s represents a coherent physical curve Dn_s(ky).
}
\examples{
\dontrun{
uhs <- data.table::fread(
  system.file("extdata", "uhs.csv", package = "newmark"))
out <- fitDnCurve(uhs, ky = getDnKy(uhs, Ts = 0.3), Ts = 0.3, Mw = 7.5,
                  NS = 100, weights = c(AM88=1, BT07=1, SR08=1, BM17=1))
}
}
