22 "The \"POLYNOMIAL_TIME_DEPENDENCE\" element defines "
23 "polynomial coefficients for time dependent RF phase, "
24 "frequency, amplitude, etc, given by "
25 "f(t) = P0+P1*t+P2*t^2+P3*t^3 where t is the time in ns";
29 :
OpalElement(static_cast<int>(
SIZE),
"POLYNOMIAL_TIME_DEPENDENCE", doc_string.c_str()) {
34 "P2",
"Second order (quadratic) term in the polynomial expansion.");
38 "COEFFICIENTS",
"Polynomial coefficients as an array with arbitrary length.");
57 throw std::invalid_argument(
58 "OpalPolynomialTimeDependence::Update: "
59 "Use P0..P3 or COEFFICIENTS to specify the coefficients, not both.");
62 if (polynomial_coefficients.empty()) {
69 getOpalName(), std::make_shared<PolynomialTimeDependence>(polynomial_coefficients));
static void setTimeDependence(const std::string &name, std::shared_ptr< AbstractTimeDependence > time_dep)
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
virtual void print(std::ostream &) const
Print the object.
void registerOwnership() const
OpalPolynomialTimeDependence * clone(const std::string &name) override
OpalPolynomialTimeDependence()
static const std::string doc_string
void print(std::ostream &) const override
double getReal(const Attribute &attr)
Return real value.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.