<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=ASCEND%2FC2%2FSolving-Cubic-EOS%2FEnglish</id>
		<title>ASCEND/C2/Solving-Cubic-EOS/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=ASCEND%2FC2%2FSolving-Cubic-EOS%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;action=history"/>
		<updated>2026-05-13T23:19:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=12701&amp;oldid=prev</id>
		<title>Nancyvarkey at 17:37, 6 July 2014</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=12701&amp;oldid=prev"/>
				<updated>2014-07-06T17:37:05Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;amp;diff=12701&amp;amp;oldid=12420&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=12420&amp;oldid=prev</id>
		<title>Gaurav at 10:26, 30 June 2014</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=12420&amp;oldid=prev"/>
				<updated>2014-06-30T10:26:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:26, 30 June 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 102:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 102:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| I have named this '''model''' as '''pengrobinson'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| I have named this '''model''' as '''pengrobinson'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;After this define variables like '''P, T, V''' etc. using '''WILL_BE '''operator.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;After this &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;we &lt;/ins&gt;define variables like '''P, T, V''' etc. using '''WILL_BE '''operator.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''WILL_BE''' operator is used to make our '''model''' reusable&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''WILL_BE''' operator is used to make our '''model''' reusable&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gaurav</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=11352&amp;oldid=prev</id>
		<title>Tarung at 07:02, 17 June 2014</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=11352&amp;oldid=prev"/>
				<updated>2014-06-17T07:02:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;amp;diff=11352&amp;amp;oldid=11296&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Tarung</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=11296&amp;oldid=prev</id>
		<title>Tarung: Created page with ''''Tutorial 4: Cubic EOS: Peng Robinson'''   {| style=&quot;border-spacing:0;&quot; | style=&quot;border:0.75pt solid #000001;padding:0.0104in;&quot;| &lt;center&gt;'''Visual Cue'''&lt;/center&gt; | style=&quot;bord…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ASCEND/C2/Solving-Cubic-EOS/English&amp;diff=11296&amp;oldid=prev"/>
				<updated>2014-06-15T14:56:35Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;&amp;#039;&amp;#039;&amp;#039;Tutorial 4: Cubic EOS: Peng Robinson&amp;#039;&amp;#039;&amp;#039;   {| style=&amp;quot;border-spacing:0;&amp;quot; | style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| &amp;lt;center&amp;gt;&amp;#039;&amp;#039;&amp;#039;Visual Cue&amp;#039;&amp;#039;&amp;#039;&amp;lt;/center&amp;gt; | style=&amp;quot;bord…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Tutorial 4: Cubic EOS: Peng Robinson'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| &amp;lt;center&amp;gt;'''Visual Cue'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| &amp;lt;center&amp;gt;'''Narration'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Show Slide number 1&lt;br /&gt;
&lt;br /&gt;
Title slide&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Welcome to the tutorial on '''Solving Cubic EOS in ASCEND'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Show Slide 2&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| In this tutorial,&lt;br /&gt;
&lt;br /&gt;
We will learn how to&lt;br /&gt;
&lt;br /&gt;
* create a reusable model&lt;br /&gt;
* reuse the model for different components&lt;br /&gt;
* import data from the Thermodynamics library&lt;br /&gt;
&lt;br /&gt;
* solve the model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Show Slide number 3&lt;br /&gt;
&lt;br /&gt;
System Requirement&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Here I am using&lt;br /&gt;
&lt;br /&gt;
Ubuntu Linux OS v. 12.04&lt;br /&gt;
&lt;br /&gt;
ASCEND v. 0.9.8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Show Slide number 4&lt;br /&gt;
&lt;br /&gt;
Pre-requisites&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| To follow this tutorial, user must have basic knowledge of&lt;br /&gt;
&lt;br /&gt;
Linux&lt;br /&gt;
&lt;br /&gt;
ASCEND and&lt;br /&gt;
&lt;br /&gt;
Peng Robinson cubic EOS&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Show Slide number 5&lt;br /&gt;
&lt;br /&gt;
Pre-requisites&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| To know more about ASCEND please visit ascend4.org&lt;br /&gt;
&lt;br /&gt;
For relevant tutorials please visit our website&lt;br /&gt;
&lt;br /&gt;
http://spoken-tutorial.org&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Show Slide number 6&lt;br /&gt;
&lt;br /&gt;
Peng Robinson Cubic EOS&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Let’s write a general model to solve Peng Robinson cubic equation of state. Peng Robinson equation of state is a cubic equation of state which contains volume terms to the third power. It is usually expressed to give pressure in terms of temperature and molar volume. These are the equation for PR EOS&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Show Slide number 7&lt;br /&gt;
&lt;br /&gt;
Peng Robinson Cubic EOS&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| It is sometime more convenient to express the polynomial in terms of the compressibility factor Z&lt;br /&gt;
&lt;br /&gt;
These are the equations which we will be using in our model to compute the value of Z&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open the code file in gedit&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Let's now look at the code for Peng Robinson model.&lt;br /&gt;
&lt;br /&gt;
I already have the code for Peng Robinson model in a text file.&lt;br /&gt;
&lt;br /&gt;
Open the file Peng Robinson.a4c in a text editor&lt;br /&gt;
&lt;br /&gt;
Let me explain the code.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Highlight REQUIRE &amp;quot;thermodynamics.a4l&amp;quot;;&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| For solving this model, we require data from the thermodynamics library. So, add ‘REQUIRE “thermodynamics.a4l”. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Highlight the lines sequentially&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| I have named this model as pengrobinson.&lt;br /&gt;
&lt;br /&gt;
After this define variables like P, T, V etc. using WILL_BE operator.&lt;br /&gt;
&lt;br /&gt;
WILL_BE operator is used to make our model reusable&lt;br /&gt;
&lt;br /&gt;
The variables defined using WILL_BE are used as parameters in our test model&lt;br /&gt;
&lt;br /&gt;
I will come back to the explanation of WILL_BE as we move ahead in our tutorial&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Highlight the following declaration statements&lt;br /&gt;
&lt;br /&gt;
R IS_A molar_gas_constant;&lt;br /&gt;
&lt;br /&gt;
Pc IS_A pressure;&lt;br /&gt;
&lt;br /&gt;
Tc IS_A temperature;&lt;br /&gt;
&lt;br /&gt;
T_degC IS_A factor;&lt;br /&gt;
&lt;br /&gt;
alpha, beta, q,Tr, Pr, omega IS_A factor;&lt;br /&gt;
&lt;br /&gt;
PSI, OMEGA, sigma, eps IS_A real_constant;&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Now we Define rest of the variables accordingly. Like, R IS_A molar gas constant, Pc IS_A pressure and so on&lt;br /&gt;
&lt;br /&gt;
Note that factor denotes a dimensionless variable, Thus alpha, beta, q etc. are defined as factors&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Highlight the given constants used in the code&lt;br /&gt;
&lt;br /&gt;
PSI :== 0.45724;&lt;br /&gt;
&lt;br /&gt;
OMEGA :== 0.07780;&lt;br /&gt;
&lt;br /&gt;
sigma :== 2.414213562;&lt;br /&gt;
&lt;br /&gt;
eps :== 0.414213562;&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Now we mention the values of all the constants used in PR Cubic EOS.&lt;br /&gt;
&lt;br /&gt;
Please note that the values of these constants will be reused in our test model.&lt;br /&gt;
&lt;br /&gt;
So we use a colon and is equal to sign twice to assign values to constants&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Highlight the following syntax&lt;br /&gt;
&lt;br /&gt;
Pc = data.Pc;&lt;br /&gt;
&lt;br /&gt;
Tc = data.Tc;&lt;br /&gt;
&lt;br /&gt;
omega = data.omega;&lt;br /&gt;
&lt;br /&gt;
Tr = T/Tc;&lt;br /&gt;
&lt;br /&gt;
Pr = P/Pc;&lt;br /&gt;
&lt;br /&gt;
T_degC = T/1{K} - 273.15;&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| We take the critical temperature, critical pressure and omega data from the thermodynamics library.&lt;br /&gt;
&lt;br /&gt;
And so we write&lt;br /&gt;
&lt;br /&gt;
Pc=data.Pc and so on.&lt;br /&gt;
&lt;br /&gt;
Now we define the reduced temperature and pressure in terms of Tc and Pc.&lt;br /&gt;
&lt;br /&gt;
Now we mention the PR Equation as shown in the previous slide&lt;br /&gt;
&lt;br /&gt;
Note that labels like eq 4, eq 5 etc. are not compulsory to write but they help in debugging the problem&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Highlight the METHODS syntax sequentially&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Now let’s define methods to solve this model.&lt;br /&gt;
&lt;br /&gt;
We use the method default to solve this model and run the METHODS specify and values under it.&lt;br /&gt;
&lt;br /&gt;
Under specify we fix the variables by writing , P.fixed := TRUE;and T.fixed := TRUE; Note that True implies fixed variable whereas all other variables that are not mentioned here are y default set to False, i.e. Free variables&lt;br /&gt;
&lt;br /&gt;
Now under values, we define values to the fixed variables&lt;br /&gt;
&lt;br /&gt;
For Z, we set the upper and lower bound and also provide a nominal value to initiate the solution.&lt;br /&gt;
&lt;br /&gt;
The syntax used is&lt;br /&gt;
&lt;br /&gt;
Z.lower_bound := 0.0;&lt;br /&gt;
&lt;br /&gt;
Z.nominal := 0.1;&lt;br /&gt;
&lt;br /&gt;
Now we end Peng Robinson model&lt;br /&gt;
&lt;br /&gt;
Parameters defined in this model, can now be reused by any model to calculate Z for specific components&lt;br /&gt;
&lt;br /&gt;
Let's now see how to use these parameters and calculate Z for ethylene in a test model.&lt;br /&gt;
&lt;br /&gt;
Let's now look at the code for test model&lt;br /&gt;
&lt;br /&gt;
Note that the test model is written below the Peng Robinson model in the same document&lt;br /&gt;
&lt;br /&gt;
we name this model as test&lt;br /&gt;
&lt;br /&gt;
We define a symbol constant – c1.&lt;br /&gt;
&lt;br /&gt;
And assign c1 is equal to ethylene.&lt;br /&gt;
&lt;br /&gt;
We use a colon and equal to sign twice as c1 is passed as a parameter to another variable components_data which is present in thermodynamics library&lt;br /&gt;
&lt;br /&gt;
Here we define cd as components_data of ethylene&lt;br /&gt;
&lt;br /&gt;
Note that in the parenthesis,c1 in square bracket implies such data for ethylene from thermodynamics library whereas c1 outside square bracket is set as reference component&lt;br /&gt;
&lt;br /&gt;
More on this will be explained in future tutorials&lt;br /&gt;
&lt;br /&gt;
Note that we use WILL_BE to define P,V,Z etc&lt;br /&gt;
&lt;br /&gt;
To reuse these parameters from previous model we need to define them here using IS_A operator&lt;br /&gt;
&lt;br /&gt;
Thus we define&lt;br /&gt;
&lt;br /&gt;
P IS_A pressure;&lt;br /&gt;
&lt;br /&gt;
T IS_A temperature and so on;&lt;br /&gt;
&lt;br /&gt;
We define tpeng IS_A pengrobinson&lt;br /&gt;
&lt;br /&gt;
Now tpeng includes all the equations and methods&lt;br /&gt;
&lt;br /&gt;
defined in the peng roinson model&lt;br /&gt;
&lt;br /&gt;
we have passed the required parameters to pengrobinson model in parenthesis,so we don't have to write the variables and the equations again&lt;br /&gt;
&lt;br /&gt;
the values of constants and other variables will be called in the test model from peng robinson model&lt;br /&gt;
&lt;br /&gt;
This is how we make our model reusable&lt;br /&gt;
&lt;br /&gt;
we define equations for Tr and Pr as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Tr = T/cd.data[c1].Tc; and similarly for Pr;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We reuse this model in the test model to find out Z for ethylene.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Scroll the text file to show the next model&lt;br /&gt;
| style=&amp;quot;border:0.75pt solid #000001;padding:0.0104in;&amp;quot;| We will now look at the code for testpengrobinson model.&lt;br /&gt;
&lt;br /&gt;
I already have the code for testpengrobinson model in a text file.&lt;br /&gt;
&lt;br /&gt;
Let me explain the code.&lt;br /&gt;
&lt;br /&gt;
We name this model as testpengrobinson.&lt;br /&gt;
&lt;br /&gt;
We define a symbol constant – c1.&lt;br /&gt;
&lt;br /&gt;
And assign c1 is equal to ethylene.&lt;br /&gt;
&lt;br /&gt;
This c1 is passed as a parameters to another model components_data which is present in one of our ‘REQUIRED’ libraries.&lt;br /&gt;
&lt;br /&gt;
Here we define cd as the component data of ethylene.&lt;br /&gt;
&lt;br /&gt;
To reuse the parameters from previous model like P, V, Z etc we need to define them here using the IS_A operator&lt;br /&gt;
&lt;br /&gt;
We define tpeng as a pengrobinson.&lt;br /&gt;
&lt;br /&gt;
Now tpeng includes all the equations and methods defined in pengrobinson model.&lt;br /&gt;
&lt;br /&gt;
We have passed the required parameters to pengrobinson&lt;br /&gt;
&lt;br /&gt;
So we do not have to write the equations and variables again.&lt;br /&gt;
&lt;br /&gt;
This is how we make our model reusable.&lt;br /&gt;
&lt;br /&gt;
We define equations for Tr and Pr as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Tr = T/cd.data[c1].Tc;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Pr = P/cd.data[c1].Pc;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;cd.dada[c1].Tc imports the value of Tc for ethylene from thermodynamics library.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In METHODS we define the standard methods again&lt;br /&gt;
&lt;br /&gt;
But now under METHOD specify we RUN tpeng.specify&lt;br /&gt;
&lt;br /&gt;
Under METHOD values we RUN tpeng.values. This is done to run the METHODS from pengrobinson model in our test model.&lt;br /&gt;
&lt;br /&gt;
In the end we define the METHOD on_load in which we run specify and values;&lt;br /&gt;
&lt;br /&gt;
Now end the test model&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open the model in Ascend and run the on_load method&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open this model in ASCEND&lt;br /&gt;
&lt;br /&gt;
Under Modules section, you will see two names&lt;br /&gt;
&lt;br /&gt;
peng robinsing and test model&lt;br /&gt;
&lt;br /&gt;
In the panel below you will see the message&lt;br /&gt;
&lt;br /&gt;
won’t auto-initiate the model peng robinson&lt;br /&gt;
&lt;br /&gt;
model requires parameters&lt;br /&gt;
&lt;br /&gt;
As we have used WILL_BE in peng robinson, we can’t execute this model but the parameters defined here will be executed in our test model&lt;br /&gt;
&lt;br /&gt;
Now double click on test, the model opens under simulation&lt;br /&gt;
&lt;br /&gt;
Now run the on_load method and click on solve&lt;br /&gt;
&lt;br /&gt;
you will see pressure, temperature are the fixed variables and ascend has successfully calculated values for z, volume, reduced Temperature and reduced Pressure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open Slide number 8 &lt;br /&gt;
&lt;br /&gt;
Summary&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Now, let us summarize. In this tutorial, we have learnt how to:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* create a reusable model&lt;br /&gt;
* reuse the model for different components&lt;br /&gt;
* import data from the Thermodynamics library&lt;br /&gt;
* solve the model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open Slide number 9&lt;br /&gt;
&lt;br /&gt;
Assignment&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| As an assignment, try to modify pengrobinson model to solve the value of V.&lt;br /&gt;
&lt;br /&gt;
Also re-use this model in a test model to compute value of V for ethylene.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open Slide number 10&lt;br /&gt;
&lt;br /&gt;
About the Spoken Tutorial Project&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Information on the spoken tutorial project is available on our website&lt;br /&gt;
&lt;br /&gt;
spoken-tutorial.org&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open Slide number 11&lt;br /&gt;
&lt;br /&gt;
Spoken Tutorial Workshops&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Details on Workshops based on spoken tutorials is also available on the website&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open Slide number 12&lt;br /&gt;
&lt;br /&gt;
Acknowledgements&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Spoken tutorial project is funded by NMEICT,MHRD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| Open Slide number 13&lt;br /&gt;
&lt;br /&gt;
Thank You&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:0.75pt solid #000001;border-left:0.75pt solid #000001;border-right:0.75pt solid #000001;padding:0.0104in;&amp;quot;| This is Priya Bagde from IIT Bombay signing off&lt;br /&gt;
&lt;br /&gt;
Thank You for joining&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Tarung</name></author>	</entry>

	</feed>