20 #ifndef _SINUSOIDAL_FUNCTION_H_
21 #define _SINUSOIDAL_FUNCTION_H_
23 #include "mbsim/functions/function.h"
29 template<
typename Ret,
typename Arg>
33 double A, f, phi0, y0;
35 SinusoidalFunction(
double A_=0,
double f_=0,
double phi0_=0,
double y0_=0) : A(A_), f(f_), phi0(phi0_), y0(y0_) { }
36 Ret operator()(
const Arg &x) {
39 typename B::DRetDArg parDer(
const Arg &x) {
40 double om = 2.*M_PI*f;
43 typename B::DRetDArg parDerDirDer(
const Arg &xDir,
const Arg &x) {
44 double om = 2.*M_PI*f;
47 Ret parDerParDer(
const double &x) {
48 double om = 2.*M_PI*f;
51 void initializeUsingXML(xercesc::DOMElement *element) {
52 xercesc::DOMElement *e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"amplitude");
53 A=Element::getDouble(e);
54 e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"frequency");
55 f=Element::getDouble(e);
56 e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"phase");
57 if(e) phi0=Element::getDouble(e);
58 e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"offset");
59 if(e) y0=Element::getDouble(e);
Definition: sinusoidal_function.h:27
Definition: planar_contour.h:31