/[ascend]/trunk/models/kchittur/vleplots.py
ViewVC logotype

Contents of /trunk/models/kchittur/vleplots.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1631 - (show annotations) (download) (as text)
Sun Sep 30 23:37:48 2007 UTC (12 years, 6 months ago) by kchittur
File MIME type: text/x-python
File size: 1536 byte(s)
Z
1 import extpy
2 from pylab import *
3 from solverreporter import *
4 def txyplot(self):
5 browser = extpy.getbrowser()
6 ioff()
7 figure()
8 for P in [70000.0]:
9 self.P.setRealValue(P)
10 XX1 = []
11 TT1 = []
12 XX2 = []
13 TT2 = []
14 for x1 in [0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.7,0.75,0.8,0.85,0.9,0.95,0.99]:
15 self.x1.setRealValue(x1)
16 try:
17 browser.sim.solve(browser.solver,SimpleSolverReporter(browser,message="P = %f, x1 = %f" % (P,x1)))
18 XX1.append(float(self.x1))
19 TT1.append(float(self.TdegC))
20 XX2.append(float(self.y1))
21 TT2.append(float(self.TdegC))
22 except:
23 browser.reporter.reportError('Failed to solve for x1 = %f' % x1)
24 continue
25 plot(XX1,TT1)
26 plot(XX2,TT2)
27 hold(1)
28 ion()
29 show()
30
31 extpy.registermethod(txyplot)
32
33 def pxyplot(self):
34 browser = extpy.getbrowser()
35 ioff()
36 figure()
37 for T in [340]:
38 self.T.setRealValue(T)
39 XX1 = []
40 PP1 = []
41 XX2 = []
42 PP2 = []
43 for x1 in [0.01,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.7,0.75,0.8,0.85,0.9,0.95,0.99]:
44 self.x1.setRealValue(x1)
45 try:
46 browser.sim.solve(browser.solver,SimpleSolverReporter(browser,message="T = %f, x1 = %f" % (T,x1)))
47 XX1.append(float(self.x1))
48 PP1.append(float(self.P))
49 XX2.append(float(self.y1))
50 PP2.append(float(self.P))
51 except:
52 browser.reporter.reportError('Failed to solve for x1 = %f' % x1)
53 continue
54 plot(XX1,PP1)
55 plot(XX2,PP2)
56 hold(1)
57 ion()
58 show()
59
60 extpy.registermethod(pxyplot)
61

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22