<?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=CONSTANT</id>
	<title>CONSTANT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ascend4.org/index.php?action=history&amp;feed=atom&amp;title=CONSTANT"/>
	<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=CONSTANT&amp;action=history"/>
	<updated>2026-05-03T20:28:37Z</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=CONSTANT&amp;diff=3297&amp;oldid=prev</id>
		<title>Jpye at 20:05, 14 February 2012</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=CONSTANT&amp;diff=3297&amp;oldid=prev"/>
		<updated>2012-02-14T20:05:13Z</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 20:05, 14 February 2012&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-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&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;Similarly, area &amp;lt;math&amp;gt;{}= \pi*r^2&amp;lt;/math&amp;gt; should be written&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;Similarly, area &amp;lt;math&amp;gt;{}= \pi*r^2&amp;lt;/math&amp;gt; should be written&lt;/div&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;&amp;lt;source&amp;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 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lang=a4c&lt;/ins&gt;&amp;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;div&gt;area = 1{PI} * r^2;&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;area = 1{PI} * r^2;&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;div&gt;&amp;lt;/source&amp;gt;&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;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jpye</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=CONSTANT&amp;diff=3296&amp;oldid=prev</id>
		<title>Jpye: Created page with &quot;The &#039;&#039;&#039;CONSTANT&#039;&#039;&#039; statement is used to declare constant-value &#039;variable&#039; types that may be used as parameters for reusable parametric MODEL types.  Real constants which d...&quot;</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=CONSTANT&amp;diff=3296&amp;oldid=prev"/>
		<updated>2012-02-14T20:04:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;#039;&amp;#039;&amp;#039;CONSTANT&amp;#039;&amp;#039;&amp;#039; statement is used to declare constant-value &amp;#039;variable&amp;#039; types that may be used as parameters for reusable parametric &lt;a href=&quot;/MODEL&quot; title=&quot;MODEL&quot;&gt;MODEL&lt;/a&gt; types.  Real constants which d...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;CONSTANT&amp;#039;&amp;#039;&amp;#039; statement is used to declare constant-value &amp;#039;variable&amp;#039; types that may be used as parameters for reusable parametric [[MODEL]] types.&lt;br /&gt;
&lt;br /&gt;
Real constants which do not have a default value are usually needed only in libraries of reusable models, such as components.a4l, where the values depend on the end-user’s selection from alternatives in a database. The standard incantation to define a new real constant type is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=a4c&amp;gt;&lt;br /&gt;
CONSTANT critical_pressure_constant&lt;br /&gt;
REFINES real_constant DIMENSION M/L/T^2;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is wasteful to define a CONSTANT type and a compiled object to represent a universal constant. For example, the thermodynamic gas constant, R = 8.314... {J/mole/K}, is frequently needed in modeling chemical systems. The SI value of R does not vary with its application. Neither does the value of &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt;. Numeric constants of this sort are better represented as a numeric coefficient and an appropriately defined unit conversion, using the [[UNITS]] statement.&lt;br /&gt;
&lt;br /&gt;
Consider the ideal gas law, PV = NRT and the ASCEND unit conversion {GAS_C} which appears in the library ascend4/models/measures.a4l. This equation should be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=a4c&amp;gt;&lt;br /&gt;
P * V = n * 1.0{GAS_C} * T;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly, area &amp;lt;math&amp;gt;{}= \pi*r^2&amp;lt;/math&amp;gt; should be written&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
area = 1{PI} * r^2;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The coefficient &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt; of &amp;lt;tt&amp;gt;{GAS_C}&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;{PI}&amp;lt;/tt&amp;gt; in these equations takes of the dimensionality of and is multiplied&lt;br /&gt;
by the conversion factor implied by the [[UNITS]] definition for the part within the braces &amp;lt;tt&amp;gt;{}&amp;lt;/tt&amp;gt;. If we check {{src|models/measures.a4l}}, we&lt;br /&gt;
find the definition of PI is simply {3.14159...} and the definition of GAS_C is {8.314... J/mole/K} as we ought to expect.&lt;br /&gt;
&lt;br /&gt;
For historical reasons there are a few universal constant definitions in {{src|models/atoms.a4l}}. New modelers should not use them; they are only provided to support outdated models that no one has yet taken the time to update.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[UNITS]]&lt;br /&gt;
* [[DIMENSION]]&lt;br /&gt;
* [[ATOM]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Syntax]]&lt;/div&gt;</summary>
		<author><name>Jpye</name></author>
	</entry>
</feed>