本文整理汇总了Python中common.PostProcess.integrate方法的典型用法代码示例。如果您正苦于以下问题:Python PostProcess.integrate方法的具体用法?Python PostProcess.integrate怎么用?Python PostProcess.integrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.PostProcess
的用法示例。
在下文中一共展示了PostProcess.integrate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: variables
# 需要导入模块: from common import PostProcess [as 别名]
# 或者: from common.PostProcess import integrate [as 别名]
## Post processing part
filter.append('road_Wheel_Load_Both_Sides.vehicleSpeed')
filter.append('driver_Land_Profile.driver_control.error_current.y')
filter.append('driver_Land_Profile.driver_control.error_current.u2')
#filter.append('road_Wheel_Load_Both_Sides.Accel_40kph')
# loads results with the filtered out variables (and 'time' which is default)
pp = PostProcess(mat_file_name, filter)
t = pp.time
# Liters of fuel used per 100km
#volume_var_name = [var_name for var_name in filter if var_name.endswith('tank.V')][0]
#volume = pp.data_array(volume_var_name)
fuel_used = 1 #(volume[0] - volume[-1])*1000
distance_covered_m = pp.integrate('driver_Land_Profile.driver_control.error_current.u2')
if distance_covered_m != 0:
fuel_consumption = fuel_used/(distance_covered_m*1000*100)
else:
fuel_consumption = -1
#vehicle_speed_SI = pp.data_array('driver_Land_Profile.driver_control.error_current.u2')
# Deviation from requested speed
e = pp.data_array('driver_Land_Profile.driver_control.error_current.y')
index_neg = np.where(e < 0)[0]
index_pos = np.where(e > 0)[0]
rms_tot = RMS(e, t, t[-1])
rms_e_neg = RMS(e[index_neg], t[index_neg], t[-1])
rms_e_pos = RMS(e[index_pos], t[index_pos], t[-1])