当前位置: 首页>>代码示例>>C++>>正文


C++ Filter::getAmplitude方法代码示例

本文整理汇总了C++中Filter::getAmplitude方法的典型用法代码示例。如果您正苦于以下问题:C++ Filter::getAmplitude方法的具体用法?C++ Filter::getAmplitude怎么用?C++ Filter::getAmplitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filter的用法示例。


在下文中一共展示了Filter::getAmplitude方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

double
NewDiscretizedRandomProcessSeries::getFactorSensitivity(double time)
{
	// The parameterID has been set to the number of 
	// the random variable in question

	// So, do the same thing as above, just set x(i-1) equal to 1.0
	// for i==parameterID

	if (time == 0.0 || parameterID<0) {
		return 0.0;
	}
	else if (randomVariables == 0 || kickInTimes == 0) {
		opserr << "ERROR in DiscretizedRandomProcessSeries::getFactorSensitivity(): " << endln
			<< " random variables or kick-in times vector(s) do not exist. " << endln;
		return 0.0;
	}
	else if (kickInTimes->Size() != randomVariables->Size() ) {
		opserr << "ERROR in DiscretizedRandomProcessSeries::getFactorSensitivity(): " << endln
			<< " number of random variables is not the same as kick-in times. " << endln;
		return 0.0;
	}
	else {

		double sum1;
		double sum2;
//		int nrv = 0;
		double modFuncAmplitude;
		Filter *theFilter;

		// Loop over all modulating functions
		double dtime;
		sum1 = 0.0;
		for (int k=0; k<numModFuncs; k++) {

			// Get value of modulating function number k at time t
			modFuncAmplitude = theModulatingFunctions[k]->getAmplitude(time);
			theFilter = theModulatingFunctions[k]->getFilter();

			// Number of discretizing random variables
			//nrv = randomVariables->Size();

			// Loop over all rv's (even though some may be zero at this time)
			dtime=time-(*kickInTimes)(parameterID);
//			if(fabs(dtime)<=1.0e-7) dtime=0.0;
			sum2 = theFilter->getAmplitude(dtime, 0.0);
			sum1 += sum2*modFuncAmplitude;
		}

//		double result=0.0;
//		if(fabs(time-(*kickInTimes)(parameterID-1))<= 1.0e-8) result=1.0;
		double result = mean + c*sum1;
		return result;
	}
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:55,代码来源:NewDiscretizedRandomProcessSeries.cpp


注:本文中的Filter::getAmplitude方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。