<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ascend4.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hugo</id>
	<title>ASCEND - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://ascend4.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hugo"/>
	<link rel="alternate" type="text/html" href="https://ascend4.org/Special:Contributions/Hugo"/>
	<updated>2026-04-28T21:46:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://ascend4.org/index.php?title=OcamlParser&amp;diff=5828</id>
		<title>OcamlParser</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=OcamlParser&amp;diff=5828"/>
		<updated>2016-08-22T16:49:39Z</updated>

		<summary type="html">&lt;p&gt;Hugo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For [[GSOC2016]], [[User:Hugo|Hugo]] implemented an experimental parser for the ASCEND modeling language that allows a faster rate of experimentation for new syntactic features compared to the existing ASCEND parser.&lt;br /&gt;
&lt;br /&gt;
The new parser was designed to make it easy to parse ASCEND syntax into a syntax tree, perform transformation passes over this syntax tree and then serialize the result back into a textual format, which can be fed into the existing ASCEND compiler. This lets us implement new language features in terms of existing ones and experiment without needing to modify the core ASCEND compiler.&lt;br /&gt;
&lt;br /&gt;
One advantage of having this new parser and syntax-tree tooling is that working with syntax trees is hard to do in the existing parsing architecture because ASCEND&#039;s C compiler parses and interprets the code at the same time, and doesn&#039;t give us a chance to apply syntax transformers before the code is interpreted. Another advantage of the new parser is that it is written in [https://ocaml.org/ Ocaml], which as a functional programming language is specially suited for operating on tree-like data structures.&lt;br /&gt;
&lt;br /&gt;
== Compiling and Using the New Parser == &lt;br /&gt;
&lt;br /&gt;
The code for the new experimental parser as well as the infrastructure for writing syntax transformers can currently be found in the {{srcbranchdir|hugo|}} branch of the ASCEND Subversion repository. It has not been merged into the trunk yet.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
svn co http://svn.ascend4.org/branches/hugo ascend-hugo&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the new parser and to write syntax transformers, you will need to install the Ocaml compiler, and some Ocaml libraries. The recommended way to do this is to use your distro&#039;s package manager to install the Ocaml compiler and the [https://opam.ocaml.org/ Opam] package manager and then use Opam to download and install the required Ocaml libraries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=sh&amp;gt;&lt;br /&gt;
sudo apt-get install ocaml opam&lt;br /&gt;
&lt;br /&gt;
opam init&lt;br /&gt;
opam install menhir containers sequence&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, go to the &amp;quot;ocaml&amp;quot; folder in the ASCEND source directory and build things with the makefile. Now you can start playing with the new parser.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=sh&amp;gt;&lt;br /&gt;
cd ascend-hugo/ocaml&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The makefile, {{srcbranch|hugo|ocaml/makefile}}, shows how to compile the code and the tests filder has some examples of how to run it. For more details see {{srcbranch|hugo|ocaml/README.txt}}.&lt;br /&gt;
&lt;br /&gt;
== Writing Syntax Transformers ==&lt;br /&gt;
&lt;br /&gt;
The goal of this new Ocaml parser is to support syntax experiments that work by mapping ASCEND syntax trees (possibly with some extensions) into a vanilla ASCEND syntax tree that can be fed into the existing C compiler. However, writing these syntax tree transformers by hand can be a very laborious process because you need to write a lot of code just to traverse the syntax tree and get to the interesting leaves that we might want to modify. (Have a look at {{srcbranch|hugo|ocaml/tokenize_tree.ml}} to see how traversing a tree by hand looks like).&lt;br /&gt;
&lt;br /&gt;
One of the ways to avoid boilerplate traversal code is to use the &amp;quot;Visitor Pattern&amp;quot; and write traversals by extending a default traversal that doesn&#039;t do anything. To support this pattern, there is an interface for syntax tree iterators in {{srcbranch|hugo|ocaml/ast_iterator.ml}} as well as a default_iterator that doesn&#039;t do anything but that can be easily extended into an iterator that does something interesting in relevant nodes and just walks through everything else. There is also a similar system for transformers (functions that convert one AST into another) in {{srcbranch|hugo|ocaml/ast_mapper.ml}}.&lt;br /&gt;
&lt;br /&gt;
A good example of how to use the tree iteration and transformation modules can be found in  {{srcbranch|hugo|ocaml/infer_derivatives.ml}}. This syntax transformer receives makes &amp;lt;code&amp;gt;DERIVATIVE OF&amp;lt;/code&amp;gt; declarations optional by inferring them from the uses of the &amp;lt;code&amp;gt;der()&amp;lt;/code&amp;gt; operator throughout the program.&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC2016]] [[Category:Experimental]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=OcamlParser&amp;diff=5827</id>
		<title>OcamlParser</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=OcamlParser&amp;diff=5827"/>
		<updated>2016-08-22T08:23:53Z</updated>

		<summary type="html">&lt;p&gt;Hugo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For [[GSOC2016]], [[User:Hugo|Hugo]] implemented an experimental parser for the ASCEND modeling language that allows a faster rate of experimentation for new syntactic features compared to the existing ASCEND parser.&lt;br /&gt;
&lt;br /&gt;
The new parser was designed to make it easy to parse ASCEND syntax into a syntax tree, perform transformation passes over this syntax tree and then serialize the result back into a textual format, which can be fed into the existing ASCEND compiler. This lets us implement new language features in terms of existing ones and experiment without needing to modify the core ASCEND compiler.&lt;br /&gt;
&lt;br /&gt;
One advantage of having this new parser and syntax-tree tooling is that working with syntax trees is hard to do in the existing parsing architecture because ASCEND&#039;s C compiler parses and interprets the code at the same time, and doesn&#039;t give us a chance to apply syntax transformers before the code is interpreted. Another advantage of the new parser is that it is written in Ocaml, which as a functional programming language is specially suited for operating on tree-like data structures.&lt;br /&gt;
&lt;br /&gt;
== Compiling and Using the New Parser == &lt;br /&gt;
&lt;br /&gt;
The code for the new experimental parser as well as the infrastructure for writing syntax transformers can currently be found in the {{srcbranchdir|hugo|}} branch of the ASCEND Subversion repository. It has not been merged into the trunk yet.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
svn co http://svn.ascend4.org/branches/hugo ascend-hugo&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the new parser and to write syntax transformers, you will need to install the Ocaml compiler, and some Ocaml libraries. The recommended way to do this is to use your distro&#039;s package manager to install the Ocaml compiler and the [https://opam.ocaml.org/ Opam] package manager and then use Opam to download and install the required Ocaml libraries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=sh&amp;gt;&lt;br /&gt;
sudo apt-get install ocaml opam&lt;br /&gt;
&lt;br /&gt;
opam init&lt;br /&gt;
opam install menhir containers sequence&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, go to the &amp;quot;ocaml&amp;quot; folder in the ASCEND source directory and build things with the makefile. Now you can start playing with the new parser.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=sh&amp;gt;&lt;br /&gt;
cd ascend-hugo/ocaml&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The makefile shows how to compile the code and the tests filder has some examples of how to run it. For more details see {{srcbranch|hugo|ocaml/README.txt}}.&lt;br /&gt;
&lt;br /&gt;
== Writing Syntax Transformers ==&lt;br /&gt;
&lt;br /&gt;
The goal of this new Ocaml parser is to support syntax experiments that work by mapping ASCEND syntax trees (possibly with some extensions) into a vanilla ASCEND syntax tree that can be fed into the existing C compiler. However, writing these syntax tree transformers by hand can be a very laborious process because you need to write a lot of code just to traverse the syntax tree and get to the interesting leaves that we might want to modify. (Have a look at tokenize_tree to see how traversing a tree by hand looks like).&lt;br /&gt;
&lt;br /&gt;
One of the ways to avoid boilerplate traversal code is to use the &amp;quot;Visitor Pattern&amp;quot; and write traversals by extending a default traversal that doesn&#039;t do anything. To support this pattern, there is an interface for syntax tree iterators in ast_iterator.ml as well as a default_iterator that doesn&#039;t do anything but that can be easily extended into an iterator that does something interesting in relevant nodes and just walks through everything else. There is also a similar system for transformers (functions that convert one AST into another) in ast_mapper.ml.&lt;br /&gt;
&lt;br /&gt;
A good example of how to use the tree iteration and transformation modules can be found in infer_derivatives.ml. This syntax transformer receives makes &amp;lt;code&amp;gt;DERIVATIVE OF&amp;lt;/code&amp;gt; declarations optional by inferring them from the uses of the &amp;lt;code&amp;gt;der()&amp;lt;/code&amp;gt; operator throughout the program.&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC2016]] [[Category:Experimental]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=User:Hugo&amp;diff=5821</id>
		<title>User:Hugo</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=User:Hugo&amp;diff=5821"/>
		<updated>2016-08-22T05:06:49Z</updated>

		<summary type="html">&lt;p&gt;Hugo: More prominent link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m Hugo Gualandi, and am currently pursuing a PhD at [http://www.lua.inf.puc-rio.br/ PUC-Rio university], focusing on programming languages. For [[GSOC2016]] I implemented [[OcamlParser|experimental ASCEND parsers and syntax transformers]].&lt;br /&gt;
&lt;br /&gt;
== GSOC 2016 Project: Improvements to the Conditional Modeling Syntax ==&lt;br /&gt;
&lt;br /&gt;
The goal of my 2016 Summer Of Code project was to improve ASCEND&#039;s conditional modelling syntax. The first thing I did was to study the current state of ASCEND&#039;s conditional modeling and identify some ways in which the current modeling syntax and semantics could be improved. My findings are documented in the [[#Proposed syntax changes]] section.&lt;br /&gt;
&lt;br /&gt;
My most significant contribution during this project was to implement an experimental alternative parser for the ASCEND modeling language that allows a faster rate of experimentation for new syntactic features compared to the existing ASCEND parser. I documented what this parser does and how to use it in its own wiki page: [[OcamlParser]].&lt;br /&gt;
&lt;br /&gt;
What is left to is leverage the new parser to experiment with the new designs for the conditional syntax and then, after verifying that they work well, implement the required changes in ASCEND&#039;s main compiler.&lt;br /&gt;
&lt;br /&gt;
== Proposed syntax changes ==&lt;br /&gt;
&lt;br /&gt;
The main goal of this project was to improve the usability of dynamic and conditional modeling in ASCEND. This includes:&lt;br /&gt;
&lt;br /&gt;
1) Reducing redundancy in the specification&lt;br /&gt;
* Right now some models break badly without redundant information ([[FIX]] and [[FREE]] in hybrid models)&lt;br /&gt;
* Sometimes, we have redundant information that could have been inferred by a smarter compiler&lt;br /&gt;
&lt;br /&gt;
2) Make modeling less error prone&lt;br /&gt;
* Right now, hybrid modeling relies on calling methods that run [[FIX]], [[FREE]] and set variables by hand. This is very error prone and violates some of the ASCEND abstractions.&lt;br /&gt;
* I believe that the key to improving this is a better way to specify initial conditions in models.&lt;br /&gt;
&lt;br /&gt;
So far, I have identified many easy places to improve the language regarding point #1. Point #2 is something that ended up being harder than expected. Many of my proposed changes were inspired by the [https://www.modelica.org/ Modelica] system and I would highly recommend checking that out for comparison.&lt;br /&gt;
&lt;br /&gt;
=== Easy redundancy reduction ===&lt;br /&gt;
&lt;br /&gt;
1) We could infer the PREVIOUS and DERIVATIVE OF declarations.&lt;br /&gt;
&lt;br /&gt;
Modelica does this for its language. Its would be just a matter of parsing the model and checking which variables we are using the der() and pre() operators on. Right now, the only thing these declarations do is clutter the model and complain when we forget to specify a declaration.&lt;br /&gt;
&lt;br /&gt;
2) We could allow conditional expressions inside equations.&lt;br /&gt;
&lt;br /&gt;
For example, right now we use [[USE]] statements to turn equations on and off:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
on: P = 3000;&lt;br /&gt;
off: P = 0;&lt;br /&gt;
 &lt;br /&gt;
ev1: EVENT (too_high)&lt;br /&gt;
    CASE TRUE: USE off;&lt;br /&gt;
END EVENT;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I would prefer to use boolean expressions instead, similar to how it is possible in Modelica. In ASCEND it would look something like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
P = if on then 3000 else 0;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another good application of conditional expressions would be piecewise functions such as min(), max() and abs(). They resulting code can end up more concise than conditional equations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = max(y, 0)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For optimization and [http://book.xogeny.com/behavior/discrete/decay/ advanced tweaking], Modelica also has the `noEvent` and `smooth` operators to &amp;quot;turn off&amp;quot; the automatic event-handling and boundary checking of conditional expressions.&lt;br /&gt;
&lt;br /&gt;
=== Miscelaneous Modelica features ===&lt;br /&gt;
&lt;br /&gt;
Some Modelica features caught my eye. They wouldn&#039;t be a big priority for us, but I think its worth mentioning that they exist.&lt;br /&gt;
&lt;br /&gt;
1) You can use a buit-in function to create an event that runs every X seconds. In Ascend I think you would need to abuse a periodic function such as sin() to achieve this effect.&lt;br /&gt;
&lt;br /&gt;
2) The terminate() builtin lets you cleanly halt the integration from inside an event handler.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hybrid modeling ===&lt;br /&gt;
&lt;br /&gt;
For motivation, lets look at the code for a bouncing ball in Modelica:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
model BouncingBall &amp;quot;The &#039;classic&#039; bouncing ball model&amp;quot;&lt;br /&gt;
  type Height=Real(unit=&amp;quot;m&amp;quot;);&lt;br /&gt;
  type Velocity=Real(unit=&amp;quot;m/s&amp;quot;);&lt;br /&gt;
  parameter Real e=0.8 &amp;quot;Coefficient of restitution&amp;quot;;&lt;br /&gt;
  parameter Height h0=1.0 &amp;quot;Initial height&amp;quot;;&lt;br /&gt;
  Height h;&lt;br /&gt;
  Velocity v;&lt;br /&gt;
initial equation&lt;br /&gt;
  h = h0;&lt;br /&gt;
equation&lt;br /&gt;
  der(h) = v&lt;br /&gt;
  der(v) = -9.81;&lt;br /&gt;
  when h&amp;lt;0 then&lt;br /&gt;
    reinit(v, -e*pre(v));&lt;br /&gt;
  end when;&lt;br /&gt;
end BouncingBall;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some interesting things that I think of this: &lt;br /&gt;
* The Hybrid modeling happens via a `reinit` statement that &amp;quot;sets&amp;quot; a variable to a new value. We were asking if maybe something more general would be needed but Modelica suggests that these &amp;quot;assignments&amp;quot; are enough.&lt;br /&gt;
* However, `reinit` is not a plain assignment. It also recomputes the initial conditions appropriately.&lt;br /&gt;
* There are special equations for specifying the initial conditions. In more advanced cases, these equations can be things like `der(x) = 0`.&lt;br /&gt;
&lt;br /&gt;
Now, lets compare this to how ASCEND handles [[EVENT]] statements&lt;br /&gt;
&lt;br /&gt;
# Detect when a boolean variable flips from FALSE to TRUE&lt;br /&gt;
# Deactivate equations from OTHERWISE clause.&lt;br /&gt;
# Activate equations in the CASE TRUE clause.&lt;br /&gt;
# Run the evtname METHOD to fix/free variables.&lt;br /&gt;
# Run QRSlv&lt;br /&gt;
# Run the evtname_end METHOD to undo the changes from step 4&lt;br /&gt;
&lt;br /&gt;
Step 1 can get a bit cleaner if we allow boolean expressions instead of just boolean variables. I think steps 2 and 3 should be covered by regular conditional equations (what the current WHEN syntax does) and does not have to be the responsibility of the EVENT statement.&lt;br /&gt;
&lt;br /&gt;
The really tricky part are steps 4, 5 and 6. This problem of solving the system to find new initial conditions is something that we don&#039;t have a good way to express yet in ASCEND. For example, notice how some of the models in the ksenija folder have `before_integ` or `prepare_integ` that should be manually run to find initial conditions. I also needed to do something similar to find steady-state initial conditions in the Lotka-Volterra model I wrote.&lt;br /&gt;
&lt;br /&gt;
Right now, I don&#039;t know how to fix this problem of specifying initial conditions but I highly suspect that if we can figure this out, the syntax for the hybrid modeling will follow very naturally.&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC2016]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=User:Hugo&amp;diff=5820</id>
		<title>User:Hugo</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=User:Hugo&amp;diff=5820"/>
		<updated>2016-08-22T05:03:58Z</updated>

		<summary type="html">&lt;p&gt;Hugo: update page for the GSOC final evaluation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m Hugo Gualandi, and am currently pursuing a PhD at [http://www.lua.inf.puc-rio.br/ PUC-Rio university], focusing on programming languages.&lt;br /&gt;
&lt;br /&gt;
== GSOC 2016 Project: Improvements to the Conditional Modeling Syntax ==&lt;br /&gt;
&lt;br /&gt;
The goal of my 2016 Summer Of Code project was to improve ASCEND&#039;s conditional modelling syntax. The first thing I did was to study the current state of ASCEND&#039;s conditional modeling and identify some ways in which the current modeling syntax and semantics could be improved. My findings are documented in the [[#Proposed syntax changes]] section.&lt;br /&gt;
&lt;br /&gt;
My most significant contribution during this project was to implement an experimental alternative parser for the ASCEND modeling language that allows a faster rate of experimentation for new syntactic features compared to the existing ASCEND parser. I documented what this parser does and how to use it in its own wiki page: [[OcamlParser]].&lt;br /&gt;
&lt;br /&gt;
What is left to is leverage the new parser to experiment with the new designs for the conditional syntax and then, after verifying that they work well, implement the required changes in ASCEND&#039;s main compiler.&lt;br /&gt;
&lt;br /&gt;
== Proposed syntax changes ==&lt;br /&gt;
&lt;br /&gt;
The main goal of this project was to improve the usability of dynamic and conditional modeling in ASCEND. This includes:&lt;br /&gt;
&lt;br /&gt;
1) Reducing redundancy in the specification&lt;br /&gt;
* Right now some models break badly without redundant information ([[FIX]] and [[FREE]] in hybrid models)&lt;br /&gt;
* Sometimes, we have redundant information that could have been inferred by a smarter compiler&lt;br /&gt;
&lt;br /&gt;
2) Make modeling less error prone&lt;br /&gt;
* Right now, hybrid modeling relies on calling methods that run [[FIX]], [[FREE]] and set variables by hand. This is very error prone and violates some of the ASCEND abstractions.&lt;br /&gt;
* I believe that the key to improving this is a better way to specify initial conditions in models.&lt;br /&gt;
&lt;br /&gt;
So far, I have identified many easy places to improve the language regarding point #1. Point #2 is something that ended up being harder than expected. Many of my proposed changes were inspired by the [https://www.modelica.org/ Modelica] system and I would highly recommend checking that out for comparison.&lt;br /&gt;
&lt;br /&gt;
=== Easy redundancy reduction ===&lt;br /&gt;
&lt;br /&gt;
1) We could infer the PREVIOUS and DERIVATIVE OF declarations.&lt;br /&gt;
&lt;br /&gt;
Modelica does this for its language. Its would be just a matter of parsing the model and checking which variables we are using the der() and pre() operators on. Right now, the only thing these declarations do is clutter the model and complain when we forget to specify a declaration.&lt;br /&gt;
&lt;br /&gt;
2) We could allow conditional expressions inside equations.&lt;br /&gt;
&lt;br /&gt;
For example, right now we use [[USE]] statements to turn equations on and off:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
on: P = 3000;&lt;br /&gt;
off: P = 0;&lt;br /&gt;
 &lt;br /&gt;
ev1: EVENT (too_high)&lt;br /&gt;
    CASE TRUE: USE off;&lt;br /&gt;
END EVENT;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I would prefer to use boolean expressions instead, similar to how it is possible in Modelica. In ASCEND it would look something like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
P = if on then 3000 else 0;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another good application of conditional expressions would be piecewise functions such as min(), max() and abs(). They resulting code can end up more concise than conditional equations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = max(y, 0)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For optimization and [http://book.xogeny.com/behavior/discrete/decay/ advanced tweaking], Modelica also has the `noEvent` and `smooth` operators to &amp;quot;turn off&amp;quot; the automatic event-handling and boundary checking of conditional expressions.&lt;br /&gt;
&lt;br /&gt;
=== Miscelaneous Modelica features ===&lt;br /&gt;
&lt;br /&gt;
Some Modelica features caught my eye. They wouldn&#039;t be a big priority for us, but I think its worth mentioning that they exist.&lt;br /&gt;
&lt;br /&gt;
1) You can use a buit-in function to create an event that runs every X seconds. In Ascend I think you would need to abuse a periodic function such as sin() to achieve this effect.&lt;br /&gt;
&lt;br /&gt;
2) The terminate() builtin lets you cleanly halt the integration from inside an event handler.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hybrid modeling ===&lt;br /&gt;
&lt;br /&gt;
For motivation, lets look at the code for a bouncing ball in Modelica:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
model BouncingBall &amp;quot;The &#039;classic&#039; bouncing ball model&amp;quot;&lt;br /&gt;
  type Height=Real(unit=&amp;quot;m&amp;quot;);&lt;br /&gt;
  type Velocity=Real(unit=&amp;quot;m/s&amp;quot;);&lt;br /&gt;
  parameter Real e=0.8 &amp;quot;Coefficient of restitution&amp;quot;;&lt;br /&gt;
  parameter Height h0=1.0 &amp;quot;Initial height&amp;quot;;&lt;br /&gt;
  Height h;&lt;br /&gt;
  Velocity v;&lt;br /&gt;
initial equation&lt;br /&gt;
  h = h0;&lt;br /&gt;
equation&lt;br /&gt;
  der(h) = v&lt;br /&gt;
  der(v) = -9.81;&lt;br /&gt;
  when h&amp;lt;0 then&lt;br /&gt;
    reinit(v, -e*pre(v));&lt;br /&gt;
  end when;&lt;br /&gt;
end BouncingBall;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some interesting things that I think of this: &lt;br /&gt;
* The Hybrid modeling happens via a `reinit` statement that &amp;quot;sets&amp;quot; a variable to a new value. We were asking if maybe something more general would be needed but Modelica suggests that these &amp;quot;assignments&amp;quot; are enough.&lt;br /&gt;
* However, `reinit` is not a plain assignment. It also recomputes the initial conditions appropriately.&lt;br /&gt;
* There are special equations for specifying the initial conditions. In more advanced cases, these equations can be things like `der(x) = 0`.&lt;br /&gt;
&lt;br /&gt;
Now, lets compare this to how ASCEND handles [[EVENT]] statements&lt;br /&gt;
&lt;br /&gt;
# Detect when a boolean variable flips from FALSE to TRUE&lt;br /&gt;
# Deactivate equations from OTHERWISE clause.&lt;br /&gt;
# Activate equations in the CASE TRUE clause.&lt;br /&gt;
# Run the evtname METHOD to fix/free variables.&lt;br /&gt;
# Run QRSlv&lt;br /&gt;
# Run the evtname_end METHOD to undo the changes from step 4&lt;br /&gt;
&lt;br /&gt;
Step 1 can get a bit cleaner if we allow boolean expressions instead of just boolean variables. I think steps 2 and 3 should be covered by regular conditional equations (what the current WHEN syntax does) and does not have to be the responsibility of the EVENT statement.&lt;br /&gt;
&lt;br /&gt;
The really tricky part are steps 4, 5 and 6. This problem of solving the system to find new initial conditions is something that we don&#039;t have a good way to express yet in ASCEND. For example, notice how some of the models in the ksenija folder have `before_integ` or `prepare_integ` that should be manually run to find initial conditions. I also needed to do something similar to find steady-state initial conditions in the Lotka-Volterra model I wrote.&lt;br /&gt;
&lt;br /&gt;
Right now, I don&#039;t know how to fix this problem of specifying initial conditions but I highly suspect that if we can figure this out, the syntax for the hybrid modeling will follow very naturally.&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC2016]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=OcamlParser&amp;diff=5819</id>
		<title>OcamlParser</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=OcamlParser&amp;diff=5819"/>
		<updated>2016-08-22T04:50:39Z</updated>

		<summary type="html">&lt;p&gt;Hugo: Created page with &amp;quot;For GSOC2016, Hugo implemented an experimental parser for the ASCEND modeling language that allows a faster rate of experimentation for new syntactic feature...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For [[GSOC2016]], [[User:Hugo|Hugo]] implemented an experimental parser for the ASCEND modeling language that allows a faster rate of experimentation for new syntactic features compared to the existing ASCEND parser.&lt;br /&gt;
&lt;br /&gt;
The new parser was designed to make it easy to parse ASCEND syntax into a syntax tree, perform transformation passes over this syntax tree and then serialize the result back into a textual format, which can be fed into the existing ASCEND compiler. This lets us implement new language features in terms of existing ones and experiment without needing to modify the core ASCEND compiler.&lt;br /&gt;
&lt;br /&gt;
One advantage of having this new parser and syntax-tree tooling is that working with syntax trees is hard to do in the existing parsing architecture because ASCEND&#039;s C compiler parses and interprets the code at the same time, and doesn&#039;t give us a chance to apply syntax transformers before the code is interpreted. Another advantage of the new parser is that it is written in Ocaml, which as a functional programming language is specially suited for operating on tree-like data structures.&lt;br /&gt;
&lt;br /&gt;
== Compiling and Using the New Parser == &lt;br /&gt;
&lt;br /&gt;
The code for the new experimental parser as well as the infrastructure for writing syntax transformers can currently be found in the &amp;quot;hugo&amp;quot; branch of the ASCEND Subversion repository. It has not been merged into the trunk yet.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
svn checkout http://svn.ascend4.org/branches/hugo ascend-hugo&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the new parser and to write syntax transformers, you will need to install the Ocaml compiler, the [https://opam.ocaml.org/ Opam] package manager and some additional dependencies.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Install Ocaml and the Opam package manager&lt;br /&gt;
sudo apt-install ocaml opam&lt;br /&gt;
&lt;br /&gt;
# Install Ocaml dependencies (locally)&lt;br /&gt;
opam install menhir containers sequence&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, go to the &amp;quot;ocaml&amp;quot; folder in the ASCEND source directory and build things with the makefile. Now you can start playing with the new parser.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
cd ascend-hugo&lt;br /&gt;
cd ocaml&lt;br /&gt;
make&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The makefile shows how to compile the code and the tests filder has some examples of how to run it. For more details see the README.txt in the ocaml folder.&lt;br /&gt;
&lt;br /&gt;
== Writing Syntax Transformers ==&lt;br /&gt;
&lt;br /&gt;
The goal of this new Ocaml parser is to support syntax experiments that work by mapping ASCEND syntax trees (possibly with some extensions) into a vanilla ASCEND syntax tree that can be fed into the existing C compiler. However, writing these syntax tree transformers by hand can be a very laborious process because you need to write a lot of code just to traverse the syntax tree and get to the interesting leaves that we might want to modify. (Have a look at tokenize_tree to see how traversing a tree by hand looks like).&lt;br /&gt;
&lt;br /&gt;
One of the ways to avoid boilerplate traversal code is to use the &amp;quot;Visitor Pattern&amp;quot; and write traversals by extending a default traversal that doesn&#039;t do anything. To support this pattern, there is an interface for syntax tree iterators in ast_iterator.ml as well as a default_iterator that doesn&#039;t do anything but that can be easily extended into an iterator that does something interesting in relevant nodes and just walks through everything else. There is also a similar system for transformers (functions that convert one AST into another) in ast_mapper.ml.&lt;br /&gt;
&lt;br /&gt;
A good example of how to use the tree iteration and transformation modules can be found in infer_derivatives.ml. This syntax transformer receives makes &amp;lt;code&amp;gt;DERIVATIVE OF&amp;lt;/code&amp;gt; declarations optional by inferring them from the uses of the &amp;lt;code&amp;gt;der()&amp;lt;/code&amp;gt; operator throughout the program.&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC2016]] [[Category:Experimental]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=User:Hugo&amp;diff=5643</id>
		<title>User:Hugo</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=User:Hugo&amp;diff=5643"/>
		<updated>2016-06-17T07:15:26Z</updated>

		<summary type="html">&lt;p&gt;Hugo: writeup of language study&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m Hugo Gualandi, and am currently pursuing a PhD at [http://www.lua.inf.puc-rio.br/ PUC-Rio university], focusing on programming languages. For [[GSOC2016]], I&#039;m trying to improve ASCEND&#039;s conditional modeling syntax.&lt;br /&gt;
&lt;br /&gt;
== Goal of the Project ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to improve the usability of dynamic and conditional modeling in ASCEND. This includes:&lt;br /&gt;
&lt;br /&gt;
1) Reducing redundancy in the specification&lt;br /&gt;
* Right now some models break badly without redundant information ([[FIX]] and [[FREE]] in hybrid models)&lt;br /&gt;
* Sometimes, we have redundant information that could have been inferred by a smarter compiler&lt;br /&gt;
&lt;br /&gt;
2) Make modeling less error prone&lt;br /&gt;
* Right now, hybrid modeling relies on calling methods that run [[FIX]], [[FREE]] and set variables by hand. This is very error prone and violates some of the ASCEND abstractions.&lt;br /&gt;
* I believe that the key to improving this is a better way to specify initial conditions in models.&lt;br /&gt;
&lt;br /&gt;
So far, I have identified many easy places to improve the language regarding point #1. Point #2 is something that I still working on though...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Easy redundancy reduction ==&lt;br /&gt;
&lt;br /&gt;
1) We could infer the PREVIOUS and DERIVATIVE OF declarations.&lt;br /&gt;
&lt;br /&gt;
Modelica does this for its language. Its just a matter of parsing the model and checking which variables we are using the der() and pre() operators on. Right now, the only thing these declarations do is clutter the model or complain when we forget to specify a declaration.&lt;br /&gt;
&lt;br /&gt;
2) We could allow conditional expressions inside equations.&lt;br /&gt;
&lt;br /&gt;
For example, right now we use [[USE]] statements to turn equations on and off like we have right now:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
on: P = 3000;&lt;br /&gt;
off: P = 0;&lt;br /&gt;
 &lt;br /&gt;
ev1: EVENT (too_high)&lt;br /&gt;
    CASE TRUE: USE off;&lt;br /&gt;
END EVENT;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
I would prefer to use boolean expressions instead:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
P = if on then 3000 else 0;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another good application of conditional expressions would be piecewise functions such as min(), max() and abs(). They resulting code can end up more concise than conditional equations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = max(y, 0)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is another Modelica-inspired feature, BTW. For optimization and [http://book.xogeny.com/behavior/discrete/decay/ advanced tweaking], Modelica also has the `noEvent` and `smooth` operators to &amp;quot;turn off&amp;quot; the automatic event-handling and boundary checking of conditional expressions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscelaneous Modelica features ==&lt;br /&gt;
&lt;br /&gt;
Some Modelica features caught my eye. They wouldn&#039;t be a big priority for us, but I think its worth mentioning that they exist.&lt;br /&gt;
&lt;br /&gt;
1) You can use a buit-in function to create an event that runs every X seconds. In Ascend I think you would need to abuse a periodic function such as sin() to achieve this effect.&lt;br /&gt;
&lt;br /&gt;
2) The terminate() builtin lets you cleanly halt the integration from inside an event handler.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hybrid modeling ==&lt;br /&gt;
&lt;br /&gt;
For motivation, lets look at the code for a bouncing ball in Modelica:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
model BouncingBall &amp;quot;The &#039;classic&#039; bouncing ball model&amp;quot;&lt;br /&gt;
  type Height=Real(unit=&amp;quot;m&amp;quot;);&lt;br /&gt;
  type Velocity=Real(unit=&amp;quot;m/s&amp;quot;);&lt;br /&gt;
  parameter Real e=0.8 &amp;quot;Coefficient of restitution&amp;quot;;&lt;br /&gt;
  parameter Height h0=1.0 &amp;quot;Initial height&amp;quot;;&lt;br /&gt;
  Height h;&lt;br /&gt;
  Velocity v;&lt;br /&gt;
initial equation&lt;br /&gt;
  h = h0;&lt;br /&gt;
equation&lt;br /&gt;
  der(h) = v&lt;br /&gt;
  der(v) = -9.81;&lt;br /&gt;
  when h&amp;lt;0 then&lt;br /&gt;
    reinit(v, -e*pre(v));&lt;br /&gt;
  end when;&lt;br /&gt;
end BouncingBall;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some interesting things that I think of this: &lt;br /&gt;
* The Hybrid modeling happens via a `reinit` statement that &amp;quot;sets&amp;quot; a variable to a new value. We were asking if maybe something more general would be needed but Modelica suggests that these &amp;quot;assignments&amp;quot; are enough.&lt;br /&gt;
* However, `reinit` is not a plain assignment. It also recomputes the initial conditions appropriately.&lt;br /&gt;
* There are special equations for specifying the initial conditions. In more advanced cases, these equations can be things like `der(x) = 0`.&lt;br /&gt;
&lt;br /&gt;
Now, lets compare this to how ASCEND handles [[EVENT]] statements&lt;br /&gt;
&lt;br /&gt;
# Detect when a boolean variable flips from FALSE to TRUE&lt;br /&gt;
# Deactivate equations from OTHERWISE clause.&lt;br /&gt;
# Activate equations in the CASE TRUE clause.&lt;br /&gt;
# Run the evtname METHOD to fix/free variables.&lt;br /&gt;
# Run QRSlv&lt;br /&gt;
# Run the evtname_end METHOD to undo the changes from step 4&lt;br /&gt;
&lt;br /&gt;
Step 1 can get a bit cleaner if we allow boolean expressions instead of jsut boolean variables. I think steps 2 and 3 should be covered by regular conditional equations (what the current WHEN syntax does) and does not have to be the responsibility of the EVENT statement.&lt;br /&gt;
&lt;br /&gt;
The really tricky part are steps 4, 5 and 6. This problem of solving the system to find new initial conditions is something that we don&#039;t have a good way to express yet in ASCEND. For example, notice how some of the models in the ksenija folder have `before_integ` or `prepare_integ` that should be manually run to find initial conditions. I also needed to do something similar to find steady-state initial conditions in the Lotka-Volterra model I wrote.&lt;br /&gt;
&lt;br /&gt;
Right now, I don&#039;t know how to fix this problem of specifying initial conditions but I highly suspect that if we can figure this out, the syntax for the hybrid modeling will follow very naturally. What I have now are some questions that if answered I think will get us closer to figuring out a solution:&lt;br /&gt;
&lt;br /&gt;
* When we integrate, `t` and the related variables get updated. Are these variables FREE or FIXED? Testing suggests that Ascend wants them to be free before integrating but when solving IVPs we want to fix them (t=0 and so on).&lt;br /&gt;
* Why are we using QRSlv instead of IDA to find the new initial conditions?&lt;br /&gt;
* Is [http://bugs.ascend4.org/view.php?id=472 Bug 472] going to get in our way?&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC2016]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=Thin-walled_tank/Adding_methods_to_a_model&amp;diff=5622</id>
		<title>Thin-walled tank/Adding methods to a model</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=Thin-walled_tank/Adding_methods_to_a_model&amp;diff=5622"/>
		<updated>2016-05-25T20:50:58Z</updated>

		<summary type="html">&lt;p&gt;Hugo: /* Adding methods to the thin-walled tank model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{thinwalled}}&lt;br /&gt;
In this part, we continue the example we introduced in Part 1.  Our goal is to provide an introductory tutorial into using the ASCEND modeling environment.  We shall show how to add METHODS to models to make them more useful for sharing with others and/or with oneself at a later time.&lt;br /&gt;
&lt;br /&gt;
== Introduction: making a model sharable==&lt;br /&gt;
&lt;br /&gt;
We shall say a model is sharable if one can use and understand it without being its developer.  Being able to solve a model at least one time without first understanding it can aid significantly in learning about the model, especially in a modeling environment such as ASCEND that allows one to explore a solved model instance in detail.&lt;br /&gt;
&lt;br /&gt;
In Part 1, our ASCEND model was a nonprocedural listing of the variables and equations that must be true at the model solution.  There were no statements as to how to solve the model.  We know that solving large nonlinear models can be very difficult numerically and can require the modeler to provide a lot of special knowledge to coerce the model to a solution.  We want to add this knowledge to the code defining the model without forcing a modeler to use that knowledge when using the same model in a different manner - such as to solve for a different set of fixed variables or when embedding the model as a part of a larger model.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our approach in ASCEND is to allow modelers to add any number of methods to a model.  Methods are executable procedures that can alter the values of the variables and flags within a model instance and that can trigger the execution of other methods.  One writes them within within a [[METHODS]] section for the model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding methods to the &#039;&#039;&#039;thin-walled&#039;&#039;&#039; tank model ==&lt;br /&gt;
&lt;br /&gt;
The following is our &#039;&#039;&#039;thin walled&#039;&#039;&#039; tank example with an added [[METHODS]] section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;(* this is file twt0210.a4c *)&lt;br /&gt;
REQUIRE &amp;quot;atoms.a4l&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
MODEL thin_walled_tank;&lt;br /&gt;
&lt;br /&gt;
    (* fixed variables *)&lt;br /&gt;
    D,&lt;br /&gt;
    H,&lt;br /&gt;
    wall_thickness  IS_A distance;&lt;br /&gt;
&lt;br /&gt;
    metal_density   IS_A mass_density;&lt;br /&gt;
&lt;br /&gt;
    (* computed variables *)&lt;br /&gt;
    end_area,&lt;br /&gt;
    side_area       IS_A area;&lt;br /&gt;
&lt;br /&gt;
    wall_vol        IS_A volume;&lt;br /&gt;
    metal_mass      IS_A mass;&lt;br /&gt;
&lt;br /&gt;
    (* equations *)&lt;br /&gt;
&lt;br /&gt;
    end_area=3.1416*D^2/4;&lt;br /&gt;
    side_area=3.1416*D*H;&lt;br /&gt;
&lt;br /&gt;
    wall_vol=(side_area+2*end_area)*wall_thickness;&lt;br /&gt;
    metal_mass=metal_density*wall_vol;&lt;br /&gt;
&lt;br /&gt;
METHODS&lt;br /&gt;
&lt;br /&gt;
   METHOD specify;&lt;br /&gt;
      FIX D;&lt;br /&gt;
      FIX H;&lt;br /&gt;
&lt;br /&gt;
      FIX wall_thickness;&lt;br /&gt;
      FIX metal_density;&lt;br /&gt;
   END specify;&lt;br /&gt;
&lt;br /&gt;
   METHOD values;&lt;br /&gt;
      D              := 20.0 {cm};&lt;br /&gt;
      H              := D/10.0;&lt;br /&gt;
&lt;br /&gt;
      wall_thickness := 0.15 {cm};&lt;br /&gt;
      metal_density  := 7.85 {g/cm^3};&lt;br /&gt;
&lt;br /&gt;
   END values;&lt;br /&gt;
&lt;br /&gt;
   METHOD setup;&lt;br /&gt;
      RUN specify;&lt;br /&gt;
&lt;br /&gt;
      RUN values;&lt;br /&gt;
   END setup;&lt;br /&gt;
&lt;br /&gt;
END thin_walled_tank;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We include three methods: specify - to set the fixed flags for the fixed variables, values - to provide values for these four fixed variables and setup - to trigger the running of the other two methods.  A user of this model within the TclTK interface would load it, compile it, and export it to the solver.  With a tool within the solver, he would trigger the method &amp;quot;setup&amp;quot; to run.  Finally he would solve the well-posed model.  Note that he could do all these steps without understanding anything about the model.  When done, he would have a solved model instance that he could then examine in detail using many of the available tools.&lt;br /&gt;
&lt;br /&gt;
A method is a procedure.  Thus statements that set values for the variables are of the general form &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;a4c&amp;quot;&amp;gt;LHS variable := RHS expression;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This statement states that ASCEND is to replace the value of the LHS variable with the current value of the RHS expression.  The replacement equals (:=) is not the equation equals (=) that we used in the nonprocedural part of our model.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
&lt;br /&gt;
Note that the METHODS section provides procedures a model user can invoke only when he wishes.  Running &amp;quot;setup&amp;quot; blindly sets up his model for solving.  As the original modeler will have tested this model before making it available, he would know that running &amp;quot;setup&amp;quot; creates a model instance that will solve.  He has thus passed this information along to the subsequent user, making the model more sharable than before.&lt;br /&gt;
&lt;br /&gt;
Also note that the second user of this model does not need to use any of these methods.  It is still a model he could play with interactively in many other ways.  It has just provided him with one way to get a first solution to examine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Standardized set of methods==&lt;br /&gt;
&lt;br /&gt;
We advise modelers using ASCEND to develop a number of different methods for a model.  That these methods exist and are useful is supported by our experiences with using ASCEND.  Note that no method has to be there.  We give several of these methods standard names, and both the TclTk and PyGTK interfaces discover and trigger some of these methods automatically when compiling and solving a model.  A significant difference between the two interfaces is the number of methods each expects and triggers automatically, with the PyGTK using methods as a means to make one&#039;s first experience with a model appear to be very simple.  We describe here the methods these interfaces anticipate being in a model.&lt;br /&gt;
&lt;br /&gt;
See also [[METHODS]].&lt;br /&gt;
&lt;br /&gt;
Continue with [[Thin-walled_tank/Building_complex_models|the next section, Building complex models]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[Category:Examples]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
	<entry>
		<id>https://ascend4.org/index.php?title=User:Hugo&amp;diff=5592</id>
		<title>User:Hugo</title>
		<link rel="alternate" type="text/html" href="https://ascend4.org/index.php?title=User:Hugo&amp;diff=5592"/>
		<updated>2016-05-06T18:28:01Z</updated>

		<summary type="html">&lt;p&gt;Hugo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m Hugo Gualandi, and am currently pursuing a PhD at [http://www.lua.inf.puc-rio.br/ PUC-Rio university], focusing on programming languages.&lt;br /&gt;
&lt;br /&gt;
For [[GSOC2016]], I&#039;m trying to improve ASCEND&#039;s conditional modeling syntax.&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC2016]]&lt;/div&gt;</summary>
		<author><name>Hugo</name></author>
	</entry>
</feed>