15
15
import cantera as ct
16
16
import numpy as np
17
17
18
- from scipy .integrate import trapz
19
18
import matplotlib .pyplot as plt
20
19
21
20
#########################################################################
@@ -253,13 +252,13 @@ def ca_ticks(t):
253
252
######################################################################
254
253
255
254
# heat release
256
- Q = trapz (states .heat_release_rate * states .V , t )
255
+ Q = np . trapz (states .heat_release_rate * states .V , t )
257
256
output_str = '{:45s}{:>4.1f} {}'
258
257
print (output_str .format ('Heat release rate per cylinder (estimate):' ,
259
258
Q / t [- 1 ] / 1000. , 'kW' ))
260
259
261
260
# expansion power
262
- W = trapz (states .dWv_dt , t )
261
+ W = np . trapz (states .dWv_dt , t )
263
262
print (output_str .format ('Expansion power per cylinder (estimate):' ,
264
263
W / t [- 1 ] / 1000. , 'kW' ))
265
264
@@ -269,6 +268,6 @@ def ca_ticks(t):
269
268
270
269
# CO emissions
271
270
MW = states .mean_molecular_weight
272
- CO_emission = trapz (MW * states .mdot_out * states ('CO' ).X [:, 0 ], t )
273
- CO_emission /= trapz (MW * states .mdot_out , t )
271
+ CO_emission = np . trapz (MW * states .mdot_out * states ('CO' ).X [:, 0 ], t )
272
+ CO_emission /= np . trapz (MW * states .mdot_out , t )
274
273
print (output_str .format ('CO emission (estimate):' , CO_emission * 1.e6 , 'ppm' ))
0 commit comments