File: IspAmb_plot.py

package info (click to toggle)
rocketcea 1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 39,944 kB
  • sloc: fortran: 23,152; python: 9,235; pascal: 370; makefile: 168; sh: 9
file content (32 lines) | stat: -rw-r--r-- 749 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from rocketcea.cea_obj import CEA_Obj
from pylab import *

eps = 20.0
MR = 2.0

ispAmbArr = []
ispVacArr = []
pcArr = []

C = CEA_Obj(propName='', oxName='N2O4', fuelName="MMH")
for Pc in range(2000, 50, -50):
    
    IspAmb, mode = C.estimate_Ambient_Isp(Pc=Pc, MR=MR, eps=eps, Pamb=14.7)
    
    ispAmbArr.append( IspAmb )
    pcArr.append( Pc )
    
    IspVac = C.get_Isp( Pc=Pc, MR=MR, eps=eps)
    ispVacArr.append( IspVac )
        
plot(pcArr, ispVacArr, label='Isp Vacuum' )
plot(pcArr, ispAmbArr, label='Isp Sea Level' )

legend(loc='best')
grid(True)
title( C.desc + ' Sea Level Isp vs Pc\nMixture Ratio=%g, Area Ratio=%g'%(MR,eps) )
xlabel( 'Chamber Pressure (psia)' )
ylabel( 'Isp (sec)' )
savefig('IspAmb_plot.png', dpi=120)

show()