<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ascend4.org/index.php?action=history&amp;feed=atom&amp;title=VLE_examples</id>
	<title>VLE examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ascend4.org/index.php?action=history&amp;feed=atom&amp;title=VLE_examples"/>
	<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=VLE_examples&amp;action=history"/>
	<updated>2026-04-28T22:02:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://ascend4.org/index.php?title=VLE_examples&amp;diff=4224&amp;oldid=prev</id>
		<title>Priya.bagde123 at 21:12, 18 June 2013</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=VLE_examples&amp;diff=4224&amp;oldid=prev"/>
		<updated>2013-06-18T21:12:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:12, 18 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;a4c&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;&amp;gt;REQUIRE &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;quot;&lt;/del&gt;atoms.a4l&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;quot;&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=a4c&amp;gt;REQUIRE &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;atoms.a4l&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  IMPORT &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;quot;&lt;/del&gt;johnpye/extpy/extpy&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;quot;&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  IMPORT &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;johnpye/extpy/extpy&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  IMPORT &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;quot;&lt;/del&gt;vleplot&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;quot;&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  IMPORT &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;vleplot&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  MODEL modifiedraoult;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  MODEL modifiedraoult;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-4212:rev-4224:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Priya.bagde123</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=VLE_examples&amp;diff=4212&amp;oldid=prev</id>
		<title>Priya.bagde123: moved Vleexample to VLE examples</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=VLE_examples&amp;diff=4212&amp;oldid=prev"/>
		<updated>2013-06-18T01:48:41Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/Vleexample&quot; class=&quot;mw-redirect&quot; title=&quot;Vleexample&quot;&gt;Vleexample&lt;/a&gt; to &lt;a href=&quot;/VLE_examples&quot; title=&quot;VLE examples&quot;&gt;VLE examples&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:48, 18 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff:1.41:old-96:rev-4212 --&gt;
&lt;/table&gt;</summary>
		<author><name>Priya.bagde123</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=VLE_examples&amp;diff=96&amp;oldid=prev</id>
		<title>UploadBot: Restored page from Google Cache, uploaded by John Pye</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=VLE_examples&amp;diff=96&amp;oldid=prev"/>
		<updated>2010-05-13T13:49:43Z</updated>

		<summary type="html">&lt;p&gt;Restored page from Google Cache, uploaded by John Pye&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;REQUIRE &amp;amp;quot;atoms.a4l&amp;amp;quot;;&lt;br /&gt;
&lt;br /&gt;
 IMPORT &amp;amp;quot;johnpye/extpy/extpy&amp;amp;quot;;&lt;br /&gt;
&lt;br /&gt;
 IMPORT &amp;amp;quot;vleplot&amp;amp;quot;;&lt;br /&gt;
&lt;br /&gt;
 MODEL modifiedraoult;&lt;br /&gt;
&lt;br /&gt;
    (* first declare the variables you are working with *)&lt;br /&gt;
&lt;br /&gt;
    T IS_A temperature;&lt;br /&gt;
&lt;br /&gt;
    P, P1S, P2S IS_A pressure;&lt;br /&gt;
&lt;br /&gt;
    A IS_A factor;&lt;br /&gt;
&lt;br /&gt;
    gamma1, gamma2 IS_A positive_factor;&lt;br /&gt;
&lt;br /&gt;
    Pfac IS_A factor;&lt;br /&gt;
&lt;br /&gt;
    A1, B1, C1 IS_A positive_factor;&lt;br /&gt;
    A2, B2, C2 IS_A positive_factor; x1, x2, y1, y2 IS_A fraction;&lt;br /&gt;
&lt;br /&gt;
    (* now write down the equations that describe the vapor liquid equilibrium *)&lt;br /&gt;
    (* Antoine&amp;#039;s equation for vapor pressure *)&lt;br /&gt;
&lt;br /&gt;
    vp1: P1S/1000.0{Pa} = exp(A1 - B1/(T/1{K} - C1));&lt;br /&gt;
&lt;br /&gt;
    vp2: P2S/1000.0{Pa} = exp(A2 - B2/(T/1{K} - C2));&lt;br /&gt;
&lt;br /&gt;
    (* summation equations for mole fractions in vapor and liquid phases *)&lt;br /&gt;
&lt;br /&gt;
    sumx: x1 + x2 = 1.0;&lt;br /&gt;
&lt;br /&gt;
    sumy: y1 + y2 = 1.0;&lt;br /&gt;
&lt;br /&gt;
    (* the modified form of Raoult&amp;#039;s Law - with a simple model for the activity coefficients *)&lt;br /&gt;
&lt;br /&gt;
    vle1: x1*gamma1*P1S = y1*P;&lt;br /&gt;
&lt;br /&gt;
    vle2: x2*gamma2*P2S = y2*P;&lt;br /&gt;
&lt;br /&gt;
    (* equations for the activity coefficients *)&lt;br /&gt;
&lt;br /&gt;
    activity1: gamma1 = exp(A*x2*x2);&lt;br /&gt;
&lt;br /&gt;
    activity2: gamma2 = exp(A*x1*x1);&lt;br /&gt;
&lt;br /&gt;
    eqA: A = 2.771 - 0.00523*T/1.0{K};&lt;br /&gt;
&lt;br /&gt;
    Pfac*100000.0 {Pa} = P;&lt;br /&gt;
&lt;br /&gt;
 METHODS&lt;br /&gt;
&lt;br /&gt;
     METHOD default_self;&lt;br /&gt;
         A1 := 16.59158;B1 := 3643.31;C1 := 33.424;&lt;br /&gt;
&lt;br /&gt;
         A2 := 14.25326;B2 := 2665.54;C2 := 53.424;&lt;br /&gt;
&lt;br /&gt;
     END default_self;&lt;br /&gt;
&lt;br /&gt;
     METHOD specify;&lt;br /&gt;
     FIX A1, B1, C1, A2, B2, C2;&lt;br /&gt;
&lt;br /&gt;
     FIX T, x1;&lt;br /&gt;
     END specify;&lt;br /&gt;
&lt;br /&gt;
     METHOD values;&lt;br /&gt;
&lt;br /&gt;
         T := 318.15 {K};&lt;br /&gt;
         x1 := 0.25;&lt;br /&gt;
     END values;&lt;br /&gt;
&lt;br /&gt;
     METHOD on_load;&lt;br /&gt;
     RUN reset;&lt;br /&gt;
     RUN values;&lt;br /&gt;
&lt;br /&gt;
     RUN default_self;&lt;br /&gt;
     END on_load;&lt;br /&gt;
&lt;br /&gt;
         METHOD fancyplot;&lt;br /&gt;
&lt;br /&gt;
     EXTERNAL vleplot(SELF);&lt;br /&gt;
         END fancyplot;&lt;br /&gt;
&lt;br /&gt;
 END modifiedraoult;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the vleplot.py (most of the work by John)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;# python script for calculating Pressure versus y from T and x&lt;br /&gt;
 # binary system, modified raoult&amp;#039;s law, simple activity coefficient model&lt;br /&gt;
&lt;br /&gt;
 import extpy&lt;br /&gt;
 from pylab import *&lt;br /&gt;
&lt;br /&gt;
 from solverreporter import *&lt;br /&gt;
&lt;br /&gt;
 def vleplot(self):&lt;br /&gt;
&lt;br /&gt;
    browser = extpy.getbrowser()&lt;br /&gt;
    ioff()&lt;br /&gt;
    figure()&lt;br /&gt;
&lt;br /&gt;
 #&lt;br /&gt;
 # I have chosen three temperatures&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
    for T in [320,340,370]:&lt;br /&gt;
&lt;br /&gt;
        self.T.setRealValue(T)&lt;br /&gt;
 #&lt;br /&gt;
 # collect the data for plotting in two sets of arrays (one for X, one for Y)&lt;br /&gt;
 # I have two sets here - one for P versus y and other for P versus x&lt;br /&gt;
&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
        XX1 = []&lt;br /&gt;
        PP1 = []&lt;br /&gt;
        XX2 = []&lt;br /&gt;
        PP2 = []&lt;br /&gt;
&lt;br /&gt;
 #&lt;br /&gt;
 # change x1 from 0 to 1.0&lt;br /&gt;
 # there has to be a space between &amp;amp;quot;in&amp;amp;quot; and &amp;amp;quot;[&amp;amp;quot;&lt;br /&gt;
 #&lt;br /&gt;
&lt;br /&gt;
        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]:&lt;br /&gt;
&lt;br /&gt;
            self.x1.setRealValue(x1)&lt;br /&gt;
 #&lt;br /&gt;
 # send the pair of values T x1 to the solver&lt;br /&gt;
 # and append the Pressure and y1 (from the solver) to the arrays&lt;br /&gt;
&lt;br /&gt;
 # the x&amp;#039;s are also appended&lt;br /&gt;
            try:&lt;br /&gt;
                browser.sim.solve(browser.solver,SimpleSolverReporter(browser,message=&amp;amp;quot;T =&amp;amp;nbsp;%f, x1 =&amp;amp;nbsp;%f&amp;amp;quot; % (T,x1)))&lt;br /&gt;
&lt;br /&gt;
                XX1.append(float(self.x1))&lt;br /&gt;
                PP1.append(float(self.P))&lt;br /&gt;
&lt;br /&gt;
                XX2.append(float(self.y1))&lt;br /&gt;
                PP2.append(float(self.P))&lt;br /&gt;
&lt;br /&gt;
            except:&lt;br /&gt;
                browser.reporter.reportError(&amp;#039;Failed to solve for x1 =&amp;amp;nbsp;%f&amp;#039; % x1)&lt;br /&gt;
&lt;br /&gt;
                continue&lt;br /&gt;
 ## plot the data&lt;br /&gt;
        plot(XX1,PP1)&lt;br /&gt;
        plot(XX2,PP2)&lt;br /&gt;
&lt;br /&gt;
        hold(1)&lt;br /&gt;
&lt;br /&gt;
 ## legend()&lt;br /&gt;
    ion()&lt;br /&gt;
    show()&lt;br /&gt;
&lt;br /&gt;
 extpy.registermethod(vleplot)&lt;br /&gt;
 #the above method can be called using &amp;amp;quot;EXTERNAL vleplot(self)&amp;amp;quot; in ASCEND.&lt;br /&gt;
 # if you want to see the azeotrope clearly, restrict the calculation to one&lt;br /&gt;
&lt;br /&gt;
 # temperature&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>UploadBot</name></author>
	</entry>
</feed>