/[ascend]/trunk/doc/howto-model1.lyx
ViewVC logotype

Annotation of /trunk/doc/howto-model1.lyx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2785 - (hide annotations) (download) (as text)
Mon Jun 23 08:17:49 2014 UTC (5 years, 11 months ago) by jpye
File MIME type: application/x-lyx
File size: 90577 byte(s)
updating RPM spec for Fed20
1 jpye 2785 #LyX 2.1 created this file. For more info see http://www.lyx.org/
2     \lyxformat 474
3 johnpye 825 \begin_document
4     \begin_header
5     \textclass book
6 jpye 1385 \begin_preamble
7     \usepackage[bookmarks,bookmarksnumbered=true]{hyperref}
8     \usepackage{lmodern}
9     \usepackage{color}
10     \definecolor{darkred}{rgb}{0.55,0,0}
11 jpye 1766 \definecolor{darkgreen}{rgb}{0,0.55,0}
12 jpye 1385
13     \usepackage{listings}
14    
15     \lstdefinelanguage{ascend}{
16     morekeywords=[1]{
17 jpye 1766 REQUIRE,IMPORT,NOTES,
18 jpye 1385 ATOM,MODEL,METHOD,METHODS,
19     UNIVERSAL,CONSTANT,DIMENSION,DEFAULT,
20     END,FOR,CREATE,DO,EXTERNAL,
21     CONDITIONAL,SATISFIED,WHEN,CASE,OTHERWISE,TRUE,
22     FALSE,SELF,
23     },
24     morekeywords=[2]{
25     REFINES,IS_A,WILL_BE,ALIASES,INPUT,OUTPUT,DATA,
26     FIX,FREE,RUN,ARE_THE_SAME
27     },
28     morekeywords=[3]{
29     solver_var,integer_constant
30     },
31     sensitive=true,
32 jpye 1766 morecomment=[s][\color{blue}]{(*}{*)},
33     morestring=[b][\color{darkgreen}]',
34     morestring=[b][\color{darkgreen}]",
35     morecomment=[s][\color{darkgreen}]{\{}{\}},
36 jpye 1385 }
37    
38 jpye 1766 \lstnewenvironment{ascend}
39     {\lstset{basicstyle=\ttfamily\small, keywordstyle=\color{darkred}}}
40     {}
41    
42     \lstdefinestyle{ascendlisting}{
43     style=ascendlisting,
44     basicstyle=\small\ttfamily,
45     numbers=left,
46     numbersep=5pt,
47     numberstyle=\tiny,
48     escapeinside={(*@}{@*)}
49     backgroundcolor=\color{lightgrey}
50 jpye 1385 }
51     \end_preamble
52 jpye 2785 \use_default_options false
53     \maintain_unincluded_children false
54 johnpye 825 \language english
55 jpye 2785 \language_package default
56 johnpye 825 \inputencoding auto
57 jpye 2785 \fontencoding global
58 jpye 1766 \font_roman default
59     \font_sans default
60     \font_typewriter default
61 jpye 2785 \font_math auto
62 jpye 1766 \font_default_family default
63 jpye 2785 \use_non_tex_fonts false
64 jpye 1766 \font_sc false
65     \font_osf false
66     \font_sf_scale 100
67     \font_tt_scale 100
68 johnpye 825 \graphics default
69 jpye 2785 \default_output_format default
70     \output_sync 0
71     \bibtex_command default
72     \index_command default
73 johnpye 825 \paperfontsize default
74     \spacing single
75 jpye 2785 \use_hyperref false
76 johnpye 825 \papersize a4paper
77     \use_geometry false
78 jpye 2785 \use_package amsmath 2
79     \use_package amssymb 2
80     \use_package cancel 1
81     \use_package esint 0
82     \use_package mathdots 0
83     \use_package mathtools 1
84     \use_package mhchem 0
85     \use_package stackrel 1
86     \use_package stmaryrd 1
87     \use_package undertilde 1
88 johnpye 825 \cite_engine basic
89 jpye 2785 \cite_engine_type default
90     \biblio_style plain
91 johnpye 825 \use_bibtopic false
92 jpye 2785 \use_indices false
93 johnpye 825 \paperorientation portrait
94 jpye 2785 \suppress_date false
95     \justification true
96     \use_refstyle 0
97     \index Index
98     \shortcut idx
99     \color #008000
100     \end_index
101 johnpye 825 \secnumdepth 3
102     \tocdepth 3
103     \paragraph_separation indent
104 jpye 2785 \paragraph_indentation default
105 johnpye 825 \quotes_language english
106     \papercolumns 1
107     \papersides 2
108     \paperpagestyle default
109     \tracking_changes false
110 jpye 1766 \output_changes false
111 jpye 2785 \html_math_output 0
112     \html_css_as_file 0
113     \html_be_strict false
114 johnpye 825 \end_header
115    
116     \begin_body
117    
118     \begin_layout Chapter
119     Vessel Model for Beginners
120 jpye 2785 \begin_inset CommandInset label
121     LatexCommand label
122 jpye 1766 name "cha:model1"
123 johnpye 825
124     \end_inset
125    
126    
127     \end_layout
128    
129     \begin_layout Standard
130     You read our propaganda about the ASCEND system in which we said it was
131     to help technical people create hard models.
132     We said you can tackle really large models -- 100,000 equations, compiling
133     and solving them in minutes on a PC.
134     We also pointed out that you can readily solve the small problems many
135     currently solve using a spreadsheet, only once posed you can solve them
136     inside out, upside down and backwards.
137    
138     \end_layout
139    
140     \begin_layout Standard
141     This sounded intriguing so you downloaded the system and installed it.
142     Hopefully, this proved quite straight forward.
143     You double-clicked the ASCEND icon on your desktop and started it up for
144     the first time.
145     Four windows opened up.
146     You panicked.
147    
148     \end_layout
149    
150     \begin_layout Standard
151     Who wouldn't?
152     \end_layout
153    
154     \begin_layout Standard
155     To use this system properly requires that you learn how to use it.
156     If you pay the price to do so - and we hope it is not a large price, then
157     we believe you will find the tools we have provided to help you create
158     and debug models will pay you back handsomely.
159    
160     \end_layout
161    
162     \begin_layout Standard
163     This chapter
164     \noun off
165     and the next two chapters (
166     \noun default
167     Chapter
168     \noun off
169    
170 jpye 2785 \begin_inset CommandInset ref
171     LatexCommand ref
172 jpye 1766 reference "cha:model2"
173 johnpye 825
174     \end_inset
175    
176     and
177     \noun default
178     Chapter
179     \noun off
180    
181 jpye 2785 \begin_inset CommandInset ref
182     LatexCommand ref
183 jpye 1766 reference "cha:model3"
184 johnpye 825
185     \end_inset
186    
187     )
188     \noun default
189    
190     \noun off
191     are meant to be a good first step along the path to learning how to use
192     ASCEND.
193     We
194     \noun default
195     will
196     \noun off
197     lead you through the steps for creating and testing a simple model.
198     You will also learn how to improve this model so it may be more readily
199     shared with others.
200     We will present our reasons for the steps we take.
201     We
202     \noun default
203     will
204     \noun off
205     show you all the buttons you should push as you proceed.
206     \end_layout
207    
208     \begin_layout Standard
209     We strongly suggest you put time aside and go through all three of these
210     early chapters to introduce yourself to ASCEND.
211     It should take you about two to three hours.
212     The second chapter is particularly important if you wish to understand
213     our approach to good modeling practices.
214     \end_layout
215    
216     \begin_layout Standard
217     \begin_inset Marginal
218     status collapsed
219    
220 jpye 2785 \begin_layout Plain Layout
221 johnpye 825 the problem
222     \end_layout
223    
224     \end_inset
225    
226     Step 1:
227     \emph on
228     We are going to create and test an ASCEND model to compute, the mass of
229     the metal in the sides and ends of the thin-walled cylindrical vessel
230     \emph default
231    
232 jpye 2785 \begin_inset Index idx
233     status collapsed
234 johnpye 825
235 jpye 2785 \begin_layout Plain Layout
236     vessel
237     \end_layout
238    
239 johnpye 825 \end_inset
240    
241 jpye 1766
242 johnpye 825 \emph on
243 jpye 1766 shown in Figure
244 jpye 2785 \begin_inset CommandInset ref
245     LatexCommand ref
246 jpye 1766 reference "fig:model1.thinWalledVessel"
247 johnpye 825
248     \end_inset
249    
250     .
251    
252     \end_layout
253    
254     \begin_layout Standard
255     \begin_inset Float figure
256     wide false
257     sideways false
258     status open
259    
260 jpye 2785 \begin_layout Plain Layout
261 johnpye 825
262     \noun off
263 jpye 2785 \begin_inset space ~
264     \end_inset
265 johnpye 825
266 jpye 2785
267     \begin_inset space ~
268     \end_inset
269    
270    
271     \begin_inset space ~
272     \end_inset
273    
274    
275     \begin_inset space ~
276     \end_inset
277    
278    
279     \begin_inset space ~
280     \end_inset
281    
282    
283     \begin_inset space ~
284     \end_inset
285    
286    
287     \begin_inset space ~
288     \end_inset
289    
290    
291     \begin_inset space ~
292     \end_inset
293    
294    
295     \begin_inset space ~
296     \end_inset
297    
298    
299     \begin_inset space ~
300     \end_inset
301    
302    
303     \begin_inset space ~
304     \end_inset
305    
306    
307     \begin_inset space ~
308     \end_inset
309    
310    
311     \begin_inset space ~
312     \end_inset
313    
314    
315     \begin_inset space ~
316     \end_inset
317    
318    
319     \begin_inset space ~
320     \end_inset
321    
322    
323     \begin_inset space ~
324     \end_inset
325    
326    
327     \begin_inset space ~
328     \end_inset
329    
330    
331     \begin_inset space ~
332     \end_inset
333    
334    
335     \begin_inset space ~
336     \end_inset
337    
338    
339     \begin_inset space ~
340     \end_inset
341    
342    
343     \begin_inset space ~
344     \end_inset
345    
346    
347     \begin_inset space ~
348     \end_inset
349    
350    
351     \begin_inset space ~
352     \end_inset
353    
354    
355     \begin_inset space ~
356     \end_inset
357    
358    
359     \begin_inset space ~
360     \end_inset
361    
362    
363     \begin_inset space ~
364     \end_inset
365    
366    
367     \begin_inset space ~
368     \end_inset
369    
370    
371     \begin_inset space ~
372     \end_inset
373    
374    
375     \begin_inset space ~
376     \end_inset
377    
378    
379     \begin_inset space ~
380     \end_inset
381    
382    
383     \begin_inset space ~
384     \end_inset
385    
386    
387     \begin_inset space ~
388     \end_inset
389    
390    
391 johnpye 825 \begin_inset Graphics
392     filename howto-model1Fig1.eps
393     BoundingBox 0bp 0bp 280bp 260bp
394    
395     \end_inset
396    
397    
398     \end_layout
399    
400 jpye 2785 \begin_layout Plain Layout
401     \begin_inset Caption Standard
402 jpye 1766
403 jpye 2785 \begin_layout Plain Layout
404 johnpye 825 A thin-walled cylindrical vessel with flat ends
405 jpye 2785 \begin_inset CommandInset label
406     LatexCommand label
407 jpye 1766 name "fig:model1.thinWalledVessel"
408 johnpye 825
409     \end_inset
410    
411    
412     \end_layout
413    
414     \end_inset
415    
416    
417     \end_layout
418    
419 jpye 1766 \end_inset
420    
421    
422     \end_layout
423    
424 johnpye 825 \begin_layout Standard
425     Step 2:
426     \emph on
427     This model is to become a part of a library of models which others can use
428     in the future.
429     You must document it.
430     You must add methods to it to make it easy for others to make it well-posed.
431     You should probably parameterize it, and finally you must create a script
432     which anyone can easily run that solves an example problem to illustrate
433     its use.
434     \end_layout
435    
436     \begin_layout Standard
437     \begin_inset Marginal
438     status collapsed
439    
440 jpye 2785 \begin_layout Plain Layout
441 johnpye 825 topics covered
442     \end_layout
443    
444     \end_inset
445    
446     Topics covered in this and the following two chapters are:
447     \end_layout
448    
449     \begin_layout Itemize
450     \begin_inset Marginal
451     status collapsed
452    
453 jpye 2785 \begin_layout Plain Layout
454 johnpye 825 T
455     \noun off
456     his chapter)
457     \end_layout
458    
459     \end_inset
460    
461     Converting the word description to an ASCEND model.
462     \end_layout
463    
464     \begin_layout Itemize
465     Loading the model into ASCEND, dealing with the error messages.
466     \end_layout
467    
468     \begin_layout Itemize
469     Compiling the model.
470     \end_layout
471    
472     \begin_layout Itemize
473     Browsing the model to see if it looks right
474     \end_layout
475    
476     \begin_layout Itemize
477     Solving the model.
478     \end_layout
479    
480     \begin_layout Itemize
481     Examining the results.
482     \end_layout
483    
484     \begin_layout Itemize
485     More thoroughly testing the model.
486     \end_layout
487    
488     \begin_layout Itemize
489     \begin_inset Marginal
490     status collapsed
491    
492 jpye 2785 \begin_layout Plain Layout
493     Chapter
494     \begin_inset space ~
495     \end_inset
496 johnpye 825
497 jpye 2785
498     \begin_inset CommandInset ref
499     LatexCommand vref
500 jpye 1766 reference "cha:model2"
501 johnpye 825
502     \end_inset
503    
504    
505     \end_layout
506    
507     \end_inset
508    
509     Converting the model to a more reusable form by adding methods to it and
510     by parameterizing it.
511     \end_layout
512    
513     \begin_layout Itemize
514     Creating a script to load and execute an instance of the model.
515     \end_layout
516    
517     \begin_layout Itemize
518     \begin_inset Marginal
519     status collapsed
520    
521 jpye 2785 \begin_layout Plain Layout
522     Chapter
523     \begin_inset space ~
524     \end_inset
525 johnpye 825
526 jpye 2785
527     \begin_inset CommandInset ref
528     LatexCommand vref
529 jpye 1766 reference "cha:model3"
530 johnpye 825
531     \end_inset
532    
533    
534     \end_layout
535    
536     \end_inset
537    
538     Creating an array of models.
539     \end_layout
540    
541     \begin_layout Itemize
542     Using an existing library model for plotting.
543     \end_layout
544    
545     \begin_layout Itemize
546     Creating a case study using the model.
547     \end_layout
548    
549     \begin_layout Standard
550     We shall introduce many of the features of the modeling language as well
551     as the use of the interactive interface you use when compiling, debugging,
552     solving and exploring your model.
553     Language features include units conversion, arrays and sets.
554     \end_layout
555    
556     \begin_layout Section
557     Converting the word description into an ASCEND model
558 jpye 2785 \begin_inset CommandInset label
559     LatexCommand label
560 jpye 1766 name "sec:model1.converting-the-word"
561 johnpye 825
562     \end_inset
563    
564    
565     \end_layout
566    
567     \begin_layout Standard
568     \begin_inset Marginal
569     status collapsed
570    
571 jpye 2785 \begin_layout Plain Layout
572 johnpye 825 an ASCEND model is a type
573 jpye 2785 \begin_inset Index idx
574     status collapsed
575 johnpye 825
576 jpye 2785 \begin_layout Plain Layout
577     type
578     \end_layout
579    
580 johnpye 825 \end_inset
581    
582     definition
583     \end_layout
584    
585     \end_inset
586    
587     Every ASCEND model is, in fact, a type definition.
588     To "solve a model," we make an instance
589 jpye 2785 \begin_inset Index idx
590     status collapsed
591 johnpye 825
592 jpye 2785 \begin_layout Plain Layout
593     instance
594     \end_layout
595    
596 johnpye 825 \end_inset
597    
598     of a type and solve the instance.
599     So we shall start by creating a vessel type definition.
600     We will have to create our type definition as a text file using a text
601     editor.
602     (Some simple text editors
603 jpye 2785 \begin_inset Index idx
604     status collapsed
605 johnpye 825
606 jpye 2785 \begin_layout Plain Layout
607     text editors
608     \end_layout
609    
610 johnpye 825 \end_inset
611    
612     include
613     \family typewriter
614     emacs
615     \family default
616    
617 jpye 2785 \begin_inset Index idx
618     status collapsed
619 johnpye 825
620 jpye 2785 \begin_layout Plain Layout
621     emacs
622     \end_layout
623    
624 johnpye 825 \end_inset
625    
626     and
627     \family typewriter
628     gedit
629 jpye 2785 \begin_inset Index idx
630     status collapsed
631 johnpye 825
632 jpye 2785 \begin_layout Plain Layout
633     gedit
634     \end_layout
635    
636 johnpye 825 \end_inset
637    
638    
639     \family default
640     on Linux, and Notepad
641 jpye 2785 \begin_inset Index idx
642     status collapsed
643 johnpye 825
644 jpye 2785 \begin_layout Plain Layout
645     Notepad
646     \end_layout
647    
648 johnpye 825 \end_inset
649    
650     and TextPad
651 jpye 2785 \begin_inset Index idx
652     status collapsed
653 johnpye 825
654 jpye 2785 \begin_layout Plain Layout
655     TextPad
656     \end_layout
657    
658 johnpye 825 \end_inset
659    
660     on Windows.
661     We shall discuss editors shortly.)
662     \end_layout
663    
664     \begin_layout Standard
665     We need first to decide the parts to our model.
666     In this case we know that we need the variables
667 jpye 2785 \begin_inset Index idx
668     status collapsed
669 johnpye 825
670 jpye 2785 \begin_layout Plain Layout
671     variables, vessel
672     \end_layout
673    
674 johnpye 825 \end_inset
675    
676     listed in Table
677 jpye 2785 \begin_inset CommandInset ref
678     LatexCommand ref
679 jpye 1766 reference "tab:model1.variablesVesselModel"
680 johnpye 825
681     \end_inset
682    
683    
684     \noun off
685     .
686     We readily fill in the first three columns in this table.
687     We shall discuss the entry in the last column in a moment.
688     \end_layout
689    
690     \begin_layout Standard
691     \begin_inset Float table
692     wide false
693     sideways false
694     status open
695    
696 jpye 2785 \begin_layout Plain Layout
697     \begin_inset Caption Standard
698 jpye 1766
699 jpye 2785 \begin_layout Plain Layout
700 johnpye 825 Variables required for model
701 jpye 2785 \begin_inset CommandInset label
702     LatexCommand label
703 jpye 1766 name "tab:model1.variablesVesselModel"
704 johnpye 825
705     \end_inset
706    
707    
708     \end_layout
709    
710 jpye 1766 \end_inset
711    
712    
713     \end_layout
714    
715 jpye 2785 \begin_layout Plain Layout
716 johnpye 825 \begin_inset Tabular
717     <lyxtabular version="3" rows="5" columns="4">
718 jpye 2785 <features rotate="0" tabularvalignment="middle">
719     <column alignment="center" valignment="top">
720     <column alignment="center" valignment="top">
721     <column alignment="center" valignment="top">
722     <column alignment="center" valignment="top" width="1in">
723     <row>
724     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
725 johnpye 825 \begin_inset Text
726    
727 jpye 2785 \begin_layout Plain Layout
728 johnpye 825 Symbol
729     \end_layout
730    
731     \end_inset
732     </cell>
733 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
734 johnpye 825 \begin_inset Text
735    
736 jpye 2785 \begin_layout Plain Layout
737 johnpye 825 Meaning
738     \end_layout
739    
740     \end_inset
741     </cell>
742 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
743 johnpye 825 \begin_inset Text
744    
745 jpye 2785 \begin_layout Plain Layout
746 johnpye 825 Typical Units
747     \end_layout
748    
749     \end_inset
750     </cell>
751 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
752 johnpye 825 \begin_inset Text
753    
754 jpye 2785 \begin_layout Plain Layout
755 johnpye 825 ASCEND variable type
756     \end_layout
757    
758     \end_inset
759     </cell>
760     </row>
761 jpye 2785 <row>
762 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
763     \begin_inset Text
764    
765 jpye 2785 \begin_layout Plain Layout
766 johnpye 825
767     \family typewriter
768     D
769     \end_layout
770    
771     \end_inset
772     </cell>
773     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
774     \begin_inset Text
775    
776 jpye 2785 \begin_layout Plain Layout
777 johnpye 825 vessel diameter
778     \end_layout
779    
780     \end_inset
781     </cell>
782     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
783     \begin_inset Text
784    
785 jpye 2785 \begin_layout Plain Layout
786 johnpye 825 m, ft
787     \end_layout
788    
789     \end_inset
790     </cell>
791     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
792     \begin_inset Text
793    
794 jpye 2785 \begin_layout Plain Layout
795 johnpye 825
796     \family typewriter
797     length
798     \end_layout
799    
800     \end_inset
801     </cell>
802     </row>
803 jpye 2785 <row>
804 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
805     \begin_inset Text
806    
807 jpye 2785 \begin_layout Plain Layout
808 johnpye 825
809     \family typewriter
810     H
811     \end_layout
812    
813     \end_inset
814     </cell>
815     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
816     \begin_inset Text
817    
818 jpye 2785 \begin_layout Plain Layout
819 johnpye 825 vessel height
820     \end_layout
821    
822     \end_inset
823     </cell>
824     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
825     \begin_inset Text
826    
827 jpye 2785 \begin_layout Plain Layout
828 johnpye 825 m, ft
829     \end_layout
830    
831     \end_inset
832     </cell>
833     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
834     \begin_inset Text
835    
836 jpye 2785 \begin_layout Plain Layout
837 johnpye 825
838     \family typewriter
839     length
840     \end_layout
841    
842     \end_inset
843     </cell>
844     </row>
845 jpye 2785 <row>
846 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
847     \begin_inset Text
848    
849 jpye 2785 \begin_layout Plain Layout
850 johnpye 825
851     \family typewriter
852     wall_thickness
853     \end_layout
854    
855     \end_inset
856     </cell>
857     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
858     \begin_inset Text
859    
860 jpye 2785 \begin_layout Plain Layout
861 johnpye 825 wall thickness
862     \end_layout
863    
864     \end_inset
865     </cell>
866     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
867     \begin_inset Text
868    
869 jpye 2785 \begin_layout Plain Layout
870 johnpye 825 mm, in
871     \end_layout
872    
873     \end_inset
874     </cell>
875     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
876     \begin_inset Text
877    
878 jpye 2785 \begin_layout Plain Layout
879 johnpye 825
880     \family typewriter
881     length
882     \end_layout
883    
884     \end_inset
885     </cell>
886     </row>
887 jpye 2785 <row>
888     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
889 johnpye 825 \begin_inset Text
890    
891 jpye 2785 \begin_layout Plain Layout
892 johnpye 825
893     \family typewriter
894     metal_density
895     \end_layout
896    
897     \end_inset
898     </cell>
899 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
900 johnpye 825 \begin_inset Text
901    
902 jpye 2785 \begin_layout Plain Layout
903 johnpye 825 metal density
904     \end_layout
905    
906     \end_inset
907     </cell>
908 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
909 johnpye 825 \begin_inset Text
910    
911 jpye 2785 \begin_layout Plain Layout
912 johnpye 825 kg/m
913     \begin_inset Formula $^{\textrm{3}}$
914     \end_inset
915    
916     , lbm/ft
917     \begin_inset Formula $^{\textrm{3}}$
918     \end_inset
919    
920    
921     \end_layout
922    
923     \end_inset
924     </cell>
925 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
926 johnpye 825 \begin_inset Text
927    
928 jpye 2785 \begin_layout Plain Layout
929 johnpye 825
930     \family typewriter
931     mass_density
932     \end_layout
933    
934     \end_inset
935     </cell>
936     </row>
937     </lyxtabular>
938    
939     \end_inset
940    
941    
942     \end_layout
943    
944     \end_inset
945    
946    
947     \end_layout
948    
949     \begin_layout Standard
950     We will be computing the masses for the metal in the side wall and in the
951     ends for this vessel.
952     As this is a thin-walled vessel, we shall compute the volume of metal as
953     the area of the walls times the wall thickness.
954     The following equations allow us to compute the required areas
955     \end_layout
956    
957     \begin_layout Standard
958 jpye 2785 \begin_inset Formula
959     \begin{equation}
960     \mathrm{side\, wall\, area}=\pi DH\label{eq:model1.side-wall-area}
961     \end{equation}
962 johnpye 825
963     \end_inset
964    
965    
966     \end_layout
967    
968     \begin_layout Standard
969 jpye 2785 \begin_inset Formula
970     \begin{equation}
971     \mathrm{single\, end\, area}=\frac{\pi D^{2}}{4}\label{eq:model1.single-end-area}
972     \end{equation}
973 johnpye 825
974     \end_inset
975    
976    
977     \end_layout
978    
979     \begin_layout Standard
980     We should be interested in the volume of the vessel, which we compute as:
981     \end_layout
982    
983     \begin_layout Standard
984 jpye 2785 \begin_inset Formula
985     \begin{equation}
986     \mathrm{vessel\, volume}=\mathrm{single\, end\, area}\times H\label{eq:model1.vessel-volume}
987     \end{equation}
988 johnpye 825
989     \end_inset
990    
991    
992     \end_layout
993    
994     \begin_layout Standard
995     We add the variables in Table
996 jpye 2785 \begin_inset CommandInset ref
997     LatexCommand ref
998 jpye 1766 reference "tab:model1.moreVariablesVessel"
999 johnpye 825
1000     \end_inset
1001    
1002    
1003     \noun off
1004     to our list.
1005     \end_layout
1006    
1007     \begin_layout Standard
1008     \begin_inset Float table
1009     wide false
1010     sideways false
1011     status open
1012    
1013 jpye 2785 \begin_layout Plain Layout
1014     \begin_inset Caption Standard
1015 jpye 1766
1016 jpye 2785 \begin_layout Plain Layout
1017 johnpye 825 Some more variables
1018 jpye 2785 \begin_inset Index idx
1019     status collapsed
1020 johnpye 825
1021 jpye 2785 \begin_layout Plain Layout
1022     variables, vessel
1023     \end_layout
1024    
1025 johnpye 825 \end_inset
1026    
1027     required for vessel model
1028 jpye 2785 \begin_inset CommandInset label
1029     LatexCommand label
1030 jpye 1766 name "tab:model1.moreVariablesVessel"
1031 johnpye 825
1032     \end_inset
1033    
1034    
1035     \end_layout
1036    
1037 jpye 1766 \end_inset
1038    
1039    
1040     \end_layout
1041    
1042 jpye 2785 \begin_layout Plain Layout
1043 johnpye 825 \begin_inset Tabular
1044     <lyxtabular version="3" rows="6" columns="4">
1045 jpye 2785 <features rotate="0" tabularvalignment="middle">
1046     <column alignment="center" valignment="top">
1047     <column alignment="center" valignment="top" width="1.5in">
1048     <column alignment="center" valignment="top">
1049     <column alignment="center" valignment="top" width="1in">
1050     <row>
1051     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1052 johnpye 825 \begin_inset Text
1053    
1054 jpye 2785 \begin_layout Plain Layout
1055 johnpye 825 Symbol
1056     \end_layout
1057    
1058     \end_inset
1059     </cell>
1060 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1061 johnpye 825 \begin_inset Text
1062    
1063 jpye 2785 \begin_layout Plain Layout
1064 johnpye 825 Meaning
1065     \end_layout
1066    
1067     \end_inset
1068     </cell>
1069 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1070 johnpye 825 \begin_inset Text
1071    
1072 jpye 2785 \begin_layout Plain Layout
1073 johnpye 825 Typical Units
1074     \end_layout
1075    
1076     \end_inset
1077     </cell>
1078 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1079 johnpye 825 \begin_inset Text
1080    
1081 jpye 2785 \begin_layout Plain Layout
1082 johnpye 825 ASCEND variable type
1083     \end_layout
1084    
1085     \end_inset
1086     </cell>
1087     </row>
1088 jpye 2785 <row>
1089 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1090     \begin_inset Text
1091    
1092 jpye 2785 \begin_layout Plain Layout
1093 johnpye 825
1094     \family typewriter
1095     side_area
1096     \end_layout
1097    
1098     \end_inset
1099     </cell>
1100     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1101     \begin_inset Text
1102    
1103 jpye 2785 \begin_layout Plain Layout
1104 johnpye 825 area in the sidewall of the vessel
1105     \end_layout
1106    
1107     \end_inset
1108     </cell>
1109     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1110     \begin_inset Text
1111    
1112 jpye 2785 \begin_layout Plain Layout
1113 johnpye 825 m
1114     \begin_inset Formula $^{\textrm{2}}$
1115     \end_inset
1116    
1117     , ft
1118     \begin_inset Formula $^{\textrm{2}}$
1119     \end_inset
1120    
1121    
1122     \end_layout
1123    
1124     \end_inset
1125     </cell>
1126     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1127     \begin_inset Text
1128    
1129 jpye 2785 \begin_layout Plain Layout
1130 johnpye 825
1131     \family typewriter
1132     area
1133     \end_layout
1134    
1135     \end_inset
1136     </cell>
1137     </row>
1138 jpye 2785 <row>
1139 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1140     \begin_inset Text
1141    
1142 jpye 2785 \begin_layout Plain Layout
1143 johnpye 825
1144     \family typewriter
1145     end_area
1146     \end_layout
1147    
1148     \end_inset
1149     </cell>
1150     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1151     \begin_inset Text
1152    
1153 jpye 2785 \begin_layout Plain Layout
1154 johnpye 825 total area iin the ends of the vessel
1155     \end_layout
1156    
1157     \end_inset
1158     </cell>
1159     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1160     \begin_inset Text
1161    
1162 jpye 2785 \begin_layout Plain Layout
1163 johnpye 825 m
1164     \begin_inset Formula $^{\textrm{2}}$
1165     \end_inset
1166    
1167     , ft
1168     \begin_inset Formula $^{\textrm{2}}$
1169     \end_inset
1170    
1171    
1172     \end_layout
1173    
1174     \end_inset
1175     </cell>
1176     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1177     \begin_inset Text
1178    
1179 jpye 2785 \begin_layout Plain Layout
1180 johnpye 825
1181     \family typewriter
1182     area
1183     \end_layout
1184    
1185     \end_inset
1186     </cell>
1187     </row>
1188 jpye 2785 <row>
1189 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1190     \begin_inset Text
1191    
1192 jpye 2785 \begin_layout Plain Layout
1193 johnpye 825
1194     \family typewriter
1195     vessel_volume
1196     \end_layout
1197    
1198     \end_inset
1199     </cell>
1200     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1201     \begin_inset Text
1202    
1203 jpye 2785 \begin_layout Plain Layout
1204 johnpye 825 volume of the vessel
1205     \end_layout
1206    
1207     \end_inset
1208     </cell>
1209     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1210     \begin_inset Text
1211    
1212 jpye 2785 \begin_layout Plain Layout
1213 johnpye 825 m
1214     \begin_inset Formula $^{3}$
1215     \end_inset
1216    
1217     , ft
1218     \begin_inset Formula $^{\textrm{3}}$
1219     \end_inset
1220    
1221    
1222     \end_layout
1223    
1224     \end_inset
1225     </cell>
1226     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1227     \begin_inset Text
1228    
1229 jpye 2785 \begin_layout Plain Layout
1230 johnpye 825
1231     \family typewriter
1232     volume
1233     \end_layout
1234    
1235     \end_inset
1236     </cell>
1237     </row>
1238 jpye 2785 <row>
1239 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1240     \begin_inset Text
1241    
1242 jpye 2785 \begin_layout Plain Layout
1243 johnpye 825
1244     \family typewriter
1245     metal_volume
1246     \end_layout
1247    
1248     \end_inset
1249     </cell>
1250     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1251     \begin_inset Text
1252    
1253 jpye 2785 \begin_layout Plain Layout
1254 johnpye 825 total volume of metal in the walls
1255     \end_layout
1256    
1257     \end_inset
1258     </cell>
1259     <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1260     \begin_inset Text
1261    
1262 jpye 2785 \begin_layout Plain Layout
1263 johnpye 825 m
1264     \begin_inset Formula $^{3}$
1265     \end_inset
1266    
1267     , ft
1268     \begin_inset Formula $^{\textrm{3}}$
1269     \end_inset
1270    
1271    
1272     \end_layout
1273    
1274     \end_inset
1275     </cell>
1276     <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1277     \begin_inset Text
1278    
1279 jpye 2785 \begin_layout Plain Layout
1280 johnpye 825
1281     \family typewriter
1282     volume
1283     \end_layout
1284    
1285     \end_inset
1286     </cell>
1287     </row>
1288 jpye 2785 <row>
1289     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1290 johnpye 825 \begin_inset Text
1291    
1292 jpye 2785 \begin_layout Plain Layout
1293 johnpye 825
1294     \family typewriter
1295     metal_mass
1296     \end_layout
1297    
1298     \end_inset
1299     </cell>
1300 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1301 johnpye 825 \begin_inset Text
1302    
1303 jpye 2785 \begin_layout Plain Layout
1304 johnpye 825 total mass of the metal in the walls of the vessel
1305     \end_layout
1306    
1307     \end_inset
1308     </cell>
1309 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1310 johnpye 825 \begin_inset Text
1311    
1312 jpye 2785 \begin_layout Plain Layout
1313 johnpye 825 kg, lbm
1314     \end_layout
1315    
1316     \end_inset
1317     </cell>
1318 jpye 2785 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1319 johnpye 825 \begin_inset Text
1320    
1321 jpye 2785 \begin_layout Plain Layout
1322 johnpye 825
1323     \family typewriter
1324     mass
1325     \end_layout
1326    
1327     \end_inset
1328     </cell>
1329     </row>
1330     </lyxtabular>
1331    
1332     \end_inset
1333    
1334    
1335     \end_layout
1336    
1337     \end_inset
1338    
1339    
1340     \end_layout
1341    
1342     \begin_layout Standard
1343     We believe that no one should create a model of any consequence without
1344     worrying about the units for expressing the variables within it.
1345     We consider that to be a commandment handed down from somewhere on high;
1346     however, we know that others do not believe as we do.
1347     Grant us our beliefs.
1348     We have created in the ASCEND system a library of variable and constant
1349     types called atoms.a4l
1350 jpye 2785 \begin_inset Index idx
1351     status collapsed
1352 johnpye 825
1353 jpye 2785 \begin_layout Plain Layout
1354     atoms.a4l
1355     \end_layout
1356    
1357 johnpye 825 \end_inset
1358    
1359     .
1360     \end_layout
1361    
1362     \begin_layout Standard
1363     The file type "
1364     \family typewriter
1365     .a4l
1366 jpye 2785 \begin_inset Index idx
1367     status collapsed
1368 johnpye 825
1369 jpye 2785 \begin_layout Plain Layout
1370     a4l
1371     \end_layout
1372    
1373 johnpye 825 \end_inset
1374    
1375    
1376     \family default
1377     " designates it to be an ASCEND IV library file
1378 jpye 2785 \begin_inset Index idx
1379     status collapsed
1380 johnpye 825
1381 jpye 2785 \begin_layout Plain Layout
1382     library file
1383     \end_layout
1384    
1385 johnpye 825 \end_inset
1386    
1387     .
1388     Double-click on this link to see the approximately 150 different types
1389     ranging from universal constants
1390 jpye 2785 \begin_inset Index idx
1391     status collapsed
1392 johnpye 825
1393 jpye 2785 \begin_layout Plain Layout
1394     universal constants
1395     \end_layout
1396    
1397 johnpye 825 \end_inset
1398    
1399     such as
1400     \begin_inset Formula $\pi$
1401     \end_inset
1402    
1403     (=3.14159...) and
1404     \begin_inset Formula $e$
1405     \end_inset
1406    
1407     (=2.718...) to
1408     \family typewriter
1409     length
1410     \family default
1411     ,
1412     \family typewriter
1413     mass
1414     \family default
1415     and
1416     \family typewriter
1417     angle
1418     \family default
1419     .
1420     If we have not created one that you need, you can use this library of types
1421     to see how to construct one for yourself and add it to your file of type
1422     definitions.
1423     You will find detailed instructions for how to make your own variable type
1424 jpye 2785 library in Chapter
1425     \begin_inset space ~
1426     \end_inset
1427 johnpye 825
1428 jpye 2785
1429     \begin_inset CommandInset ref
1430     LatexCommand vref
1431 jpye 1766 reference "cha:atoms"
1432 johnpye 825
1433     \end_inset
1434    
1435     .
1436     \end_layout
1437    
1438     \begin_layout Standard
1439     \begin_inset Marginal
1440     status collapsed
1441    
1442 jpye 2785 \begin_layout Plain Layout
1443 johnpye 825 type definition library for variables and constants
1444     \end_layout
1445    
1446     \end_inset
1447    
1448     ASCEND considers variable and constant types to be elementary or "atomic"
1449     to the system.
1450     These type definitions can contain only attributes for variables and constants.
1451     They cannot contain equations, for example.
1452     Thus ASCEND calls such a type definition an atom rather than a model.
1453     Figure
1454 jpye 2785 \begin_inset CommandInset ref
1455     LatexCommand ref
1456 jpye 1766 reference "fig:model1.atomVolume"
1457 johnpye 825
1458     \end_inset
1459    
1460    
1461     \noun off
1462     illustrates the definition for the type volume.
1463    
1464     \end_layout
1465    
1466     \begin_layout Standard
1467     \begin_inset Float figure
1468     wide false
1469     sideways false
1470     status open
1471    
1472 jpye 2785 \begin_layout Plain Layout
1473     \begin_inset Index idx
1474     status collapsed
1475 johnpye 825
1476 jpye 2785 \begin_layout Plain Layout
1477     ATOM
1478     \end_layout
1479    
1480 johnpye 825 \end_inset
1481    
1482 jpye 1385
1483     \begin_inset ERT
1484     status open
1485    
1486 jpye 2785 \begin_layout Plain Layout
1487 jpye 1385
1488    
1489     \backslash
1490     lstset{language=ASCEND}
1491 johnpye 825 \end_layout
1492    
1493 jpye 2785 \begin_layout Plain Layout
1494 jpye 1385
1495    
1496     \backslash
1497     begin{lstlisting}
1498 johnpye 825 \end_layout
1499    
1500 jpye 2785 \begin_layout Plain Layout
1501 jpye 1385
1502     ATOM volume REFINES solver_var
1503 johnpye 825 \end_layout
1504    
1505 jpye 2785 \begin_layout Plain Layout
1506 jpye 1385
1507     DIMENSION L^3
1508 johnpye 825 \end_layout
1509    
1510 jpye 2785 \begin_layout Plain Layout
1511 jpye 1385
1512     DEFAULT 100.0{ft^3};
1513 johnpye 825 \end_layout
1514    
1515 jpye 2785 \begin_layout Plain Layout
1516 jpye 1385
1517     lower_bound := 0.0{ft^3};
1518 johnpye 825 \end_layout
1519    
1520 jpye 2785 \begin_layout Plain Layout
1521 jpye 1385
1522     upper_bound := 1e50{ft^3};
1523     \end_layout
1524    
1525 jpye 2785 \begin_layout Plain Layout
1526 jpye 1385
1527     nominal := 100.0{ft^3};
1528     \end_layout
1529    
1530 jpye 2785 \begin_layout Plain Layout
1531 jpye 1385
1532 johnpye 825 END volume;
1533     \end_layout
1534    
1535 jpye 2785 \begin_layout Plain Layout
1536 jpye 1385
1537    
1538     \backslash
1539     end{lstlisting}
1540     \end_layout
1541    
1542 jpye 2785 \begin_layout Plain Layout
1543 jpye 1385
1544     \end_layout
1545    
1546     \end_inset
1547    
1548    
1549     \end_layout
1550    
1551 jpye 2785 \begin_layout Plain Layout
1552     \begin_inset Caption Standard
1553 jpye 1766
1554 jpye 2785 \begin_layout Plain Layout
1555 johnpye 825 A typical type definition, called an atom, used to define variable and constant
1556     types
1557 jpye 2785 \begin_inset CommandInset label
1558     LatexCommand label
1559 jpye 1766 name "fig:model1.atomVolume"
1560 johnpye 825
1561     \end_inset
1562    
1563    
1564     \end_layout
1565    
1566     \end_inset
1567    
1568    
1569     \end_layout
1570    
1571 jpye 1766 \end_inset
1572    
1573    
1574     \end_layout
1575    
1576 johnpye 825 \begin_layout Standard
1577     The definition starts by stating that volume is a specialization of
1578 jpye 2785 \begin_inset Index idx
1579     status collapsed
1580 johnpye 825
1581 jpye 2785 \begin_layout Plain Layout
1582     solver
1583     \begin_inset ERT
1584     status collapsed
1585    
1586     \begin_layout Plain Layout
1587    
1588    
1589     \backslash
1590     _
1591     \end_layout
1592    
1593 johnpye 825 \end_inset
1594    
1595 jpye 2785 var
1596     \end_layout
1597 johnpye 825
1598 jpye 2785 \end_inset
1599    
1600    
1601 johnpye 825 \family typewriter
1602     solver_var
1603     \family default
1604     .
1605     The type
1606     \family typewriter
1607     solver_var
1608     \family default
1609     refines a base type in the system known as
1610     \family typewriter
1611     real
1612     \family default
1613    
1614 jpye 2785 \begin_inset Index idx
1615     status collapsed
1616 johnpye 825
1617 jpye 2785 \begin_layout Plain Layout
1618     real
1619     \end_layout
1620    
1621 johnpye 825 \end_inset
1622    
1623     and adds several attributes to it that a nonlinear equation solver may
1624     need, such as a lower and upper bounds, a 'fixed' flag, and so forth.
1625    
1626     \end_layout
1627    
1628     \begin_layout Standard
1629     \begin_inset Marginal
1630     status collapsed
1631    
1632 jpye 2785 \begin_layout Plain Layout
1633 johnpye 825 dimensions
1634 jpye 2785 \begin_inset Index idx
1635     status collapsed
1636 johnpye 825
1637 jpye 2785 \begin_layout Plain Layout
1638     dimensions
1639     \end_layout
1640    
1641 johnpye 825 \end_inset
1642    
1643     and units
1644 jpye 2785 \begin_inset Index idx
1645     status collapsed
1646 johnpye 825
1647 jpye 2785 \begin_layout Plain Layout
1648     units
1649     \end_layout
1650    
1651 johnpye 825 \end_inset
1652    
1653     in ASCEND.
1654    
1655     \end_layout
1656    
1657     \end_inset
1658    
1659     The type definition for volume states that volume has dimensionality of
1660     length to the power 3 (
1661     \family typewriter
1662     L^3
1663     \family default
1664     ) where L is one of the 10 dimensions supported by ASCEND (see
1665     \noun off
1666     in ASCEND Syntax document for the 10 dimensions defined within the ASCEND
1667     language).
1668     \end_layout
1669    
1670     \begin_layout Standard
1671     One may express the value for a volume using any units which are consistent
1672     with the dimensionality of
1673     \family typewriter
1674     L^3
1675     \family default
1676     , such as
1677     \family typewriter
1678     {ft^3}
1679     \family default
1680     ,
1681     \family typewriter
1682     {m^3}
1683     \family default
1684     ,
1685     \family typewriter
1686     {gal}
1687     \family default
1688     , or even
1689     \family typewriter
1690     {mile^4/mm}
1691     \family default
1692     .
1693     Setting the lower bound to
1694     \family typewriter
1695     0 {ft^3}
1696     \family default
1697     says volume must be a nonnegative number.
1698     ASCEND used the nominal value for scaling a variable of type volume when
1699     solving, here
1700 jpye 1385 \begin_inset Formula $100\,\mathrm{ft}^{3}$
1701 johnpye 825 \end_inset
1702    
1703     .
1704     \end_layout
1705    
1706     \begin_layout Standard
1707     One may change the values for the bounds, default and nominal values at
1708     any time.
1709     \end_layout
1710    
1711     \begin_layout Standard
1712     We now can understand the last column in Table
1713 jpye 2785 \begin_inset CommandInset ref
1714     LatexCommand ref
1715 jpye 1766 reference "tab:model1.variablesVesselModel"
1716 johnpye 825
1717     \end_inset
1718    
1719    
1720     \noun off
1721     and
1722     \noun default
1723     Table
1724     \noun off
1725    
1726 jpye 2785 \begin_inset CommandInset ref
1727     LatexCommand ref
1728 jpye 1766 reference "tab:model1.moreVariablesVessel"
1729 johnpye 825
1730     \end_inset
1731    
1732     .
1733     For each variable or constant in the system, we have identified its type
1734     in the file
1735     \family typewriter
1736     \noun default
1737     atoms.a4l
1738     \family default
1739     \noun off
1740     .
1741     That is, we looked in this file for the type definition that corresponded
1742     to the variable we were defining and listed that type here.
1743     This task is not as onerous as it seems.
1744     As we shall see later, we provide a tool to find for you all atom types
1745     that correspond to a particular set of units, e.g,
1746     \family typewriter
1747     \noun default
1748     ft^3
1749     \family default
1750     \noun off
1751     -- i.e., the computer will do the searching for you.
1752     \end_layout
1753    
1754     \begin_layout Standard
1755     In Figure
1756 jpye 2785 \begin_inset CommandInset ref
1757     LatexCommand ref
1758 jpye 1766 reference "fig:model1.universalConstant"
1759 johnpye 825
1760     \end_inset
1761    
1762    
1763     \noun off
1764     we see the definition of one of the universal constants contained in
1765     \family typewriter
1766     \noun default
1767     atoms.a4l
1768     \family default
1769     \noun off
1770     .
1771     This definition is very short; it gives the name of the type
1772     \family typewriter
1773     \noun default
1774     circle_constant
1775     \family default
1776     \noun off
1777    
1778 jpye 2785 \begin_inset Index idx
1779     status collapsed
1780 johnpye 825
1781 jpye 2785 \begin_layout Plain Layout
1782     circle
1783     \begin_inset ERT
1784     status collapsed
1785    
1786     \begin_layout Plain Layout
1787    
1788    
1789     \backslash
1790     _
1791     \end_layout
1792    
1793 johnpye 825 \end_inset
1794    
1795 jpye 2785 constant
1796     \end_layout
1797    
1798     \end_inset
1799    
1800 johnpye 825 , that it refines
1801     \family typewriter
1802     \noun default
1803     real_constant
1804     \family default
1805     \noun off
1806    
1807 jpye 2785 \begin_inset Index idx
1808     status collapsed
1809 johnpye 825
1810 jpye 2785 \begin_layout Plain Layout
1811     real
1812     \begin_inset ERT
1813     status collapsed
1814    
1815     \begin_layout Plain Layout
1816    
1817    
1818     \backslash
1819     _
1820     \end_layout
1821    
1822 johnpye 825 \end_inset
1823    
1824 jpye 2785 constant
1825     \end_layout
1826    
1827     \end_inset
1828    
1829 johnpye 825 and that it has the value
1830     \family typewriter
1831     \noun default
1832     1 {PI
1833 jpye 2785 \begin_inset Index idx
1834     status collapsed
1835 johnpye 825
1836 jpye 2785 \begin_layout Plain Layout
1837     PI
1838     \end_layout
1839    
1840 johnpye 825 \end_inset
1841    
1842     }
1843     \family default
1844     \noun off
1845    
1846 jpye 2785 \begin_inset Index idx
1847     status collapsed
1848 johnpye 825
1849 jpye 2785 \begin_layout Plain Layout
1850     \begin_inset ERT
1851     status collapsed
1852    
1853     \begin_layout Plain Layout
1854    
1855    
1856     \backslash
1857     {
1858     \end_layout
1859    
1860 johnpye 825 \end_inset
1861    
1862 jpye 2785 PI
1863     \begin_inset ERT
1864     status collapsed
1865    
1866     \begin_layout Plain Layout
1867    
1868    
1869     \backslash
1870     }
1871     \end_layout
1872    
1873     \end_inset
1874    
1875    
1876     \end_layout
1877    
1878     \end_inset
1879    
1880 johnpye 825 where the internal conversion needed for
1881     \family typewriter
1882     \noun default
1883     {PI}
1884     \family default
1885     \noun off
1886     is defined in the file defining the built-in units in ASCEND.
1887     One can add more units if desired at any time to ASCEND by defining one
1888     or more personal units files (
1889     \noun default
1890     Chapter
1891     \noun off
1892    
1893 jpye 2785 \begin_inset CommandInset ref
1894     LatexCommand vref
1895 jpye 1766 reference "cha:units"
1896 johnpye 825
1897     \end_inset
1898    
1899    
1900     \noun default
1901    
1902     \noun off
1903     tells you how to do this).
1904     \end_layout
1905    
1906     \begin_layout Standard
1907     \begin_inset Marginal
1908     status collapsed
1909    
1910 jpye 2785 \begin_layout Plain Layout
1911 johnpye 825 universal constant
1912 jpye 2785 \begin_inset Index idx
1913     status collapsed
1914 johnpye 825
1915 jpye 2785 \begin_layout Plain Layout
1916     universal constant
1917     \end_layout
1918    
1919 johnpye 825 \end_inset
1920    
1921     definition
1922     \end_layout
1923    
1924     \end_inset
1925    
1926    
1927     \begin_inset Float figure
1928     wide false
1929     sideways false
1930     status open
1931    
1932     \begin_layout LyX-Code
1933 jpye 1385 \begin_inset ERT
1934     status open
1935    
1936 jpye 2785 \begin_layout Plain Layout
1937 jpye 1385
1938    
1939     \backslash
1940     begin{ascend}
1941     \end_layout
1942    
1943 jpye 2785 \begin_layout Plain Layout
1944 jpye 1385
1945 johnpye 825 UNIVERSAL CONSTANT circle_constant
1946     \end_layout
1947    
1948 jpye 2785 \begin_layout Plain Layout
1949 jpye 1385
1950 johnpye 825 REFINES real_constant :== 1{PI};
1951     \end_layout
1952    
1953 jpye 2785 \begin_layout Plain Layout
1954 jpye 1385
1955    
1956     \backslash
1957     end{ascend}
1958     \end_layout
1959    
1960     \end_inset
1961    
1962    
1963     \end_layout
1964    
1965 jpye 2785 \begin_layout Plain Layout
1966     \begin_inset Caption Standard
1967 johnpye 825
1968 jpye 2785 \begin_layout Plain Layout
1969     \begin_inset CommandInset label
1970     LatexCommand label
1971 jpye 1766 name "fig:model1.universalConstant"
1972    
1973 johnpye 825 \end_inset
1974    
1975     Type definition for
1976     \family typewriter
1977     circle_constant;
1978     \family default
1979     has value of
1980     \family typewriter
1981     1 {PI}
1982     \family default
1983     or 3.1415927
1984     \end_layout
1985    
1986     \end_inset
1987    
1988    
1989     \end_layout
1990    
1991 jpye 1766 \end_inset
1992    
1993    
1994     \end_layout
1995    
1996 johnpye 825 \begin_layout Standard
1997     We shall in fact find this constant useful in our program, and we can either
1998     introduce a constant with this value or simply use the value
1999     \family typewriter
2000     1{PI}
2001     \family default
2002     in our program.
2003     We shall choose to do the latter.
2004     \end_layout
2005    
2006     \begin_layout Standard
2007     It is time to write our first version for the model, which we do in Figure
2008    
2009 jpye 2785 \begin_inset CommandInset ref
2010     LatexCommand ref
2011 jpye 1766 reference "fig:model1.modelVessel"
2012 johnpye 825
2013     \end_inset
2014    
2015    
2016     \noun off
2017     (
2018     \noun default
2019     available as
2020 jpye 2785 \begin_inset Index idx
2021     status collapsed
2022 johnpye 825
2023 jpye 2785 \begin_layout Plain Layout
2024     vesselPlain.a4c
2025     \end_layout
2026    
2027 johnpye 825 \end_inset
2028    
2029    
2030     \family typewriter
2031     vesselPlain.a4c
2032     \family default
2033     in the ASCEND model library).
2034    
2035     \noun off
2036     We first list any other files containing type definitions which this model
2037     will use; here we list
2038     \family typewriter
2039     \noun default
2040     "atoms.a4l"
2041     \family default
2042     \noun off
2043     following the keyword
2044     \family typewriter
2045     \noun default
2046     REQUIRE
2047     \family default
2048     \noun off
2049    
2050 jpye 2785 \begin_inset Index idx
2051     status collapsed
2052 johnpye 825
2053 jpye 2785 \begin_layout Plain Layout
2054     REQUIRE
2055     \end_layout
2056    
2057 johnpye 825 \end_inset
2058    
2059     .
2060     ASCEND is sensitive to case so pay attention to where we use and do not
2061     use capital letters.
2062     Keywords are always capitalized.
2063     Often for clarification we use capital letters in a name we use for a variable
2064     or label (e.g., we use
2065     \family typewriter
2066     \noun default
2067     D
2068     \family default
2069     \noun off
2070     for diameter rather than
2071     \family typewriter
2072     \noun default
2073     d
2074     \family default
2075     \noun off
2076     ).
2077     Note that all ASCEND statements end with a semicolon (i.e., with
2078     \noun default
2079     '
2080     \family typewriter
2081     ;
2082     \family default
2083     '
2084     \noun off
2085     ) and not at the end of a line and that blank lines have no impact.
2086     Comments are between opening and closing parenthesis/asterisk pairs, i.e.,
2087     '
2088     \family typewriter
2089     \noun default
2090     (*
2091     \family default
2092     \noun off
2093     ' and '
2094     \family typewriter
2095     \noun default
2096     *)
2097     \family default
2098     \noun off
2099     '.
2100     \end_layout
2101    
2102     \begin_layout Standard
2103     \begin_inset Marginal
2104     status collapsed
2105    
2106 jpye 2785 \begin_layout Plain Layout
2107 johnpye 825 the first version of the code for vessel
2108     \end_layout
2109    
2110     \end_inset
2111    
2112    
2113     \begin_inset Float figure
2114     wide false
2115     sideways false
2116     status open
2117    
2118     \begin_layout LyX-Code
2119 jpye 1385 \begin_inset ERT
2120     status open
2121    
2122 jpye 2785 \begin_layout Plain Layout
2123 jpye 1385
2124    
2125     \backslash
2126     begin{ascend}
2127     \end_layout
2128    
2129 jpye 2785 \begin_layout Plain Layout
2130 jpye 1385
2131 johnpye 825 REQUIRE "atoms.a4l";
2132     \end_layout
2133    
2134 jpye 2785 \begin_layout Plain Layout
2135 jpye 1385
2136 johnpye 825 MODEL vessel;
2137     \end_layout
2138    
2139 jpye 2785 \begin_layout Plain Layout
2140 jpye 1385
2141     (* variables *)
2142 johnpye 825 \end_layout
2143    
2144 jpye 2785 \begin_layout Plain Layout
2145 jpye 1385
2146     side_area, end_area IS_A area;
2147 johnpye 825 \end_layout
2148    
2149 jpye 2785 \begin_layout Plain Layout
2150 jpye 1385
2151     vessel_vol, wall_vol IS_A volume;
2152 johnpye 825 \end_layout
2153    
2154 jpye 2785 \begin_layout Plain Layout
2155 jpye 1385
2156     wall_thickness, H, D IS_A distance;
2157 johnpye 825 \end_layout
2158    
2159 jpye 2785 \begin_layout Plain Layout
2160 jpye 1385
2161     H_to_D_ratio IS_A factor;
2162 johnpye 825 \end_layout
2163    
2164 jpye 2785 \begin_layout Plain Layout
2165 jpye 1385
2166     metal_density IS_A mass_density;
2167 johnpye 825 \end_layout
2168    
2169 jpye 2785 \begin_layout Plain Layout
2170 jpye 1385
2171     metal_mass IS_A mass;
2172 johnpye 825 \end_layout
2173    
2174 jpye 2785 \begin_layout Plain Layout
2175 johnpye 825
2176     \end_layout
2177    
2178 jpye 2785 \begin_layout Plain Layout
2179 jpye 1385
2180     (* equations *)
2181 johnpye 825 \end_layout
2182    
2183 jpye 2785 \begin_layout Plain Layout
2184 jpye 1385
2185     FlatEnds:end_area = 1{PI} * D^2 / 4;
2186 johnpye 825 \end_layout
2187    
2188 jpye 2785 \begin_layout Plain Layout
2189 jpye 1385
2190     Sides:side_area = 1{PI} * D * H;
2191 johnpye 825 \end_layout
2192    
2193 jpye 2785 \begin_layout Plain Layout
2194 jpye 1385
2195     Cylinder:vessel_vol = end_area * H;
2196 johnpye 825 \end_layout
2197    
2198 jpye 2785 \begin_layout Plain Layout
2199 jpye 1385
2200     Metal_volume:(side_area + 2 * end_area) *
2201 johnpye 825 \end_layout
2202    
2203 jpye 2785 \begin_layout Plain Layout
2204 jpye 1385
2205     wall_thickness = wall_vol;
2206 johnpye 825 \end_layout
2207    
2208 jpye 2785 \begin_layout Plain Layout
2209 jpye 1385
2210     HD_definition:D * H_to_D_ratio = H;
2211 johnpye 825 \end_layout
2212    
2213 jpye 2785 \begin_layout Plain Layout
2214 jpye 1385
2215     VesselMass:metal_mass = metal_density * wall_vol;
2216 johnpye 825 \end_layout
2217    
2218 jpye 2785 \begin_layout Plain Layout
2219 jpye 1385
2220 johnpye 825 END vessel;
2221     \end_layout
2222    
2223 jpye 2785 \begin_layout Plain Layout
2224 jpye 1385
2225    
2226     \backslash
2227     end{ascend}
2228     \end_layout
2229    
2230     \end_inset
2231    
2232    
2233     \end_layout
2234    
2235 jpye 2785 \begin_layout Plain Layout
2236     \begin_inset Caption Standard
2237 johnpye 825
2238 jpye 2785 \begin_layout Plain Layout
2239     \begin_inset CommandInset label
2240     LatexCommand label
2241 jpye 1766 name "fig:model1.modelVessel"
2242    
2243 johnpye 825 \end_inset
2244    
2245     First version of the type definition for
2246     \family typewriter
2247     vessel
2248     \family default
2249     .
2250    
2251     \end_layout
2252    
2253     \end_inset
2254    
2255    
2256     \end_layout
2257    
2258 jpye 1766 \end_inset
2259    
2260    
2261     \end_layout
2262    
2263 johnpye 825 \begin_layout Standard
2264     Our model definition has the following structure for it so far:
2265     \end_layout
2266    
2267     \begin_layout Itemize
2268    
2269     \family typewriter
2270     MODEL
2271     \family default
2272    
2273 jpye 2785 \begin_inset Index idx
2274     status collapsed
2275 johnpye 825
2276 jpye 2785 \begin_layout Plain Layout
2277     MODEL
2278     \end_layout
2279    
2280 johnpye 825 \end_inset
2281    
2282     statement
2283     \end_layout
2284    
2285     \begin_layout Itemize
2286     list of variable we intend to use in the type definition
2287     \end_layout
2288    
2289     \begin_layout Itemize
2290     equations
2291     \end_layout
2292    
2293     \begin_layout Itemize
2294    
2295     \family typewriter
2296     END
2297     \family default
2298    
2299 jpye 2785 \begin_inset Index idx
2300     status collapsed
2301 johnpye 825
2302 jpye 2785 \begin_layout Plain Layout
2303     END
2304     \end_layout
2305    
2306 johnpye 825 \end_inset
2307    
2308     statement
2309     \end_layout
2310    
2311     \begin_layout Standard
2312     While we have put the statements in this order, we could mix up and intermix
2313     the middle two types of statements, even going to the extreme of defining
2314     the variables after we first use them.
2315     The
2316     \family typewriter
2317     MODEL
2318     \family default
2319     and
2320     \family typewriter
2321     END
2322     \family default
2323     statements begin and end the type definition.
2324     \end_layout
2325    
2326     \begin_layout Standard
2327     You should see little that surprises you in the syntax here.
2328     However, you may have noted that we have created a definition that says
2329     absolutely nothing about how to use the variables and equations listed.
2330     There is no solution procedure buried in this type definition.
2331     In ASCEND the idea of solving is separate from saying what we intend to
2332     solve.
2333     Also note that we have not said anything about the values for any of the
2334     variables nor what we intend to calculate and what variables we intend
2335     to treat as fixed input.
2336     \end_layout
2337    
2338     \begin_layout Section
2339     Editing, compiling and browsing an ASCEND model
2340     \end_layout
2341    
2342     \begin_layout Standard
2343     Could we compile an instance of a vessel given this definition? If there
2344     had been some arrays in our definition for which we did not say how many
2345     items were in the arrays, we could not.
2346     However, here we could compile an instance, putting aside storage space
2347     for each of the variables and somehow capturing the equations relating
2348     them.
2349     \end_layout
2350    
2351     \begin_layout Standard
2352     \begin_inset Marginal
2353     status open
2354    
2355 jpye 2785 \begin_layout Plain Layout
2356 johnpye 825 Do not alter the models subdirectory
2357     \end_layout
2358    
2359     \end_inset
2360    
2361     When we compile new models, we need a place to store them.
2362     One possibility would be to put them into the
2363     \family typewriter
2364     models
2365     \family default
2366    
2367 jpye 2785 \begin_inset Index idx
2368     status collapsed
2369 johnpye 825
2370 jpye 2785 \begin_layout Plain Layout
2371     models
2372     \end_layout
2373    
2374 johnpye 825 \end_inset
2375    
2376     subdirectory of the ASCEND installation
2377     \begin_inset Foot
2378     status collapsed
2379    
2380 jpye 2785 \begin_layout Plain Layout
2381 johnpye 825 On windows this might be
2382     \family typewriter
2383     c:
2384     \backslash
2385     Program File
2386     \backslash
2387     ASCEND
2388     \backslash
2389     models
2390     \family default
2391     .
2392     On Linux, this might be
2393     \family typewriter
2394     /usr/share/ascend/models
2395     \family default
2396     .
2397     The location can vary depending on how you went about installing ASCEND.
2398     \end_layout
2399    
2400     \end_inset
2401    
2402     .
2403     However, you really should leave the contents of this subdirectory untouched
2404     -- always.
2405     Hopefully the files will be read-only from your user account.
2406     We count on being able to replace the model library totally every time
2407     you install a new version of ASCEND.
2408     Whenever we add new model libraries or corrected versions of previously
2409     existing model libraries, we put them in this subdirectory.
2410     This subdirectory belongs to us (the developers of the system): hands off,
2411     please.
2412     \end_layout
2413    
2414     \begin_layout Standard
2415     \begin_inset Marginal
2416     status open
2417    
2418 jpye 2785 \begin_layout Plain Layout
2419 johnpye 825 rather put your things into the ascdata
2420 jpye 2785 \begin_inset Index idx
2421     status collapsed
2422 johnpye 825
2423 jpye 2785 \begin_layout Plain Layout
2424     ascdata
2425     \end_layout
2426    
2427 johnpye 825 \end_inset
2428    
2429     subdirectory (you own it)
2430     \end_layout
2431    
2432     \end_inset
2433    
2434     To avoid this problem, ASCEND also creates a subdirectory called
2435     \family typewriter
2436     ascdata
2437     \family default
2438     that it will not touch when you install a new version of ASCEND.
2439     It will look in this subdirectory first when looking for a file to load
2440     when you have not given a full path name for finding that file.
2441     The install process for ASCEND will place
2442     \family typewriter
2443     ascdata
2444     \family default
2445     into your home directory
2446 jpye 2785 \begin_inset CommandInset ref
2447     LatexCommand ref
2448 jpye 1766 reference "id:#id(pgfId-1007944)"
2449 johnpye 825
2450     \end_inset
2451    
2452    
2453     \begin_inset Foot
2454     status collapsed
2455    
2456 jpye 2785 \begin_layout Plain Layout
2457 johnpye 825 On Windows, your home directory will normally be the My Documents folder.
2458     On Linux, it will normally be
2459     \family typewriter
2460     /home/
2461     \emph on
2462     username
2463     \family default
2464     \emph default
2465     .
2466     Note that in both systems, you can set an
2467     \begin_inset Quotes eld
2468     \end_inset
2469    
2470     environment
2471     \begin_inset Quotes erd
2472     \end_inset
2473    
2474     variable to designate your home directory.
2475     \end_layout
2476    
2477     \end_inset
2478    
2479    
2480     \noun off
2481     .
2482     ASCEND tells you where it has placed this subdirectory when you install
2483     it.
2484     However, if you did not note where that was, then you will have to search
2485     for it (using a tool like "FIND file or folder").
2486     \end_layout
2487    
2488     \begin_layout Standard
2489     It is within the folder
2490     \family typewriter
2491     ascdata
2492     \family default
2493     that you should place any ASCEND models you create.
2494     When running a script (which we shall talk about later), ASCEND first looks
2495     in this subdirectory for files, and then it looks in the models subdirectory.
2496     It stops looking when it finds the first available version of the file.
2497     \end_layout
2498    
2499     \begin_layout Standard
2500     \begin_inset Marginal
2501     status collapsed
2502    
2503 jpye 2785 \begin_layout Plain Layout
2504 johnpye 825 create a text file containing the model definition
2505     \end_layout
2506    
2507     \end_inset
2508    
2509     Next open an editor
2510 jpye 2785 \begin_inset Index idx
2511     status collapsed
2512 johnpye 825
2513 jpye 2785 \begin_layout Plain Layout
2514     text editors
2515     \end_layout
2516    
2517 johnpye 825 \end_inset
2518    
2519     , such as
2520     \family typewriter
2521     emacs
2522     \family default
2523    
2524 jpye 2785 \begin_inset Index idx
2525     status collapsed
2526 johnpye 825
2527 jpye 2785 \begin_layout Plain Layout
2528     emacs
2529     \end_layout
2530    
2531 johnpye 825 \end_inset
2532    
2533     ,
2534     \family typewriter
2535     gedit
2536     \family default
2537    
2538 jpye 2785 \begin_inset Index idx
2539     status collapsed
2540 johnpye 825
2541 jpye 2785 \begin_layout Plain Layout
2542     gedit
2543     \end_layout
2544    
2545 johnpye 825 \end_inset
2546    
2547     ,
2548     \family typewriter
2549     vi
2550     \family default
2551    
2552 jpye 2785 \begin_inset Index idx
2553     status collapsed
2554 johnpye 825
2555 jpye 2785 \begin_layout Plain Layout
2556     vi
2557     \end_layout
2558    
2559 johnpye 825 \end_inset
2560    
2561     ,
2562     \family typewriter
2563     vim
2564     \family default
2565    
2566 jpye 2785 \begin_inset Index idx
2567     status collapsed
2568 johnpye 825
2569 jpye 2785 \begin_layout Plain Layout
2570     vim
2571     \end_layout
2572    
2573 johnpye 825 \end_inset
2574    
2575     , Notepad
2576 jpye 2785 \begin_inset Index idx
2577     status collapsed
2578 johnpye 825
2579 jpye 2785 \begin_layout Plain Layout
2580     Notepad
2581     \end_layout
2582    
2583 johnpye 825 \end_inset
2584    
2585     or TextPad
2586 jpye 2785 \begin_inset Index idx
2587     status collapsed
2588 johnpye 825
2589 jpye 2785 \begin_layout Plain Layout
2590     TextPad
2591     \end_layout
2592    
2593 johnpye 825 \end_inset
2594    
2595     .
2596     Now type in or, better yet, cut-and-paste the statements in Figure
2597 jpye 2785 \begin_inset CommandInset ref
2598     LatexCommand ref
2599 jpye 1766 reference "fig:model1.modelVessel"
2600 johnpye 825
2601     \end_inset
2602    
2603    
2604     \noun off
2605     .
2606     Be very careful to match the use of capital and small letters.
2607     Do not worry about blanks between symbols but do not embed blanks within
2608     symbols.
2609     In other words, do not put a blank in the middle of the symbol
2610     \family typewriter
2611     \noun default
2612     side_wall
2613     \family default
2614     \noun off
2615     but do not worry about putting zero or more blanks between
2616     \family typewriter
2617     \noun default
2618     side_wall
2619     \family default
2620     \noun off
2621     and
2622     \family typewriter
2623     \noun default
2624     =
2625     \family default
2626     \noun off
2627     in an equation.
2628     \end_layout
2629    
2630     \begin_layout Standard
2631     When you are finished, be sure to save the file as a text file.
2632     Call it
2633     \family typewriter
2634     vesselPlain.a4c
2635     \family default
2636     .
2637     The "
2638     \family typewriter
2639     .a4c
2640     \family default
2641     " stands for "ASCEND 4 Code".
2642     Many Windows editors will append "
2643     \family typewriter
2644     .txt
2645     \family default
2646     " to the file name.
2647     Remove the
2648     \family typewriter
2649     .txt
2650     \family default
2651     ending off the file name -- do not let Microsoft bully you into thinking
2652     you should not -- and change it to "
2653     \family typewriter
2654     .a4c
2655 jpye 2785 \begin_inset Index idx
2656     status collapsed
2657 johnpye 825
2658 jpye 2785 \begin_layout Plain Layout
2659     a4c
2660     \end_layout
2661    
2662 johnpye 825 \end_inset
2663    
2664    
2665     \family default
2666     ".
2667    
2668     \end_layout
2669    
2670     \begin_layout Standard
2671     (This model is also available as
2672     \family typewriter
2673     vesselPlain.a4c
2674     \family default
2675     in the ASCEND models library, but we suggest it would be better for you
2676     to go through the exercise of creating your own version here.
2677     At the least copy the library file to your ASCEND space so you can play
2678     with your own version at this time.)
2679     \end_layout
2680    
2681     \begin_layout Standard
2682     When you are done, you should have a text file called
2683     \family typewriter
2684     vesselPlain.a4c
2685     \family default
2686     stored in your ASCEND/models/vessel subdirectory.
2687     It should contain precisely the statements in Figure
2688 jpye 2785 \begin_inset CommandInset ref
2689     LatexCommand ref
2690 jpye 1766 reference "fig:model1.modelVessel"
2691 johnpye 825
2692     \end_inset
2693    
2694    
2695     \noun off
2696     with care having been taken to match capital and lower case letters as
2697     shown there.
2698     \end_layout
2699    
2700     \begin_layout Standard
2701     \begin_inset Marginal
2702     status collapsed
2703    
2704 jpye 2785 \begin_layout Plain Layout
2705 johnpye 825 start the ASCEND system.
2706     Move and resize the windows to make yourself comfortable.
2707     \end_layout
2708    
2709     \end_inset
2710    
2711     Start the ASCEND system by double clicking on the ASCEND icon if you are
2712     on Windows or typing
2713     \family typewriter
2714     ascend
2715     \family default
2716     at the command line if you are using a Linux machine
2717     \begin_inset Foot
2718     status collapsed
2719    
2720 jpye 2785 \begin_layout Plain Layout
2721 johnpye 825 Depending on the Linux version you have installed, you might find that the
2722     command is
2723     \family typewriter
2724     ascend4
2725     \family default
2726     or that you have an ASCEND option in your GNOME 'Applications' menu.
2727     \end_layout
2728    
2729     \end_inset
2730    
2731     .
2732     Four windows will appear, three smaller ones and one larger one that will,
2733     if left unattended, disappear by itself in a few seconds.
2734     Move the three smaller ones around on your screen so they do not overlap
2735     or so they overlap very little.
2736     Resize them if you want to.
2737     You might start by putting the one called Script
2738 jpye 2785 \begin_inset Index idx
2739     status collapsed
2740 johnpye 825
2741 jpye 2785 \begin_layout Plain Layout
2742     Script window
2743     \end_layout
2744    
2745 johnpye 825 \end_inset
2746    
2747     in the upper left, the one called Library
2748 jpye 2785 \begin_inset Index idx
2749     status collapsed
2750 johnpye 825
2751 jpye 2785 \begin_layout Plain Layout
2752     Library window
2753     \end_layout
2754    
2755 johnpye 825 \end_inset
2756    
2757     in the upper right and the one called Console
2758 jpye 2785 \begin_inset Index idx
2759     status collapsed
2760 johnpye 825
2761 jpye 2785 \begin_layout Plain Layout
2762     Console
2763     \end_layout
2764    
2765 johnpye 825 \end_inset
2766    
2767     in the lower right.
2768     We shall assume you have placed them in these positions in the following
2769     so, even if that is not your favorite placement, it might be useful to
2770     use it for now.
2771     \end_layout
2772    
2773     \begin_layout Standard
2774     \begin_inset Marginal
2775     status collapsed
2776    
2777 jpye 2785 \begin_layout Plain Layout
2778 johnpye 825 note that each window by itself looks pretty nonthreatening
2779     \end_layout
2780    
2781     \end_inset
2782    
2783     As you can see, each window by itself looks like a pretty normal window.
2784     Each has buttons across the top under which one will find different tools
2785     to run.
2786     Each also has one to three sub-windows for displaying things.
2787     Each has a Help button that you can push at any time that you want to read
2788     all kinds of detailed things about the window
2789     \begin_inset Foot
2790     status collapsed
2791    
2792 jpye 2785 \begin_layout Plain Layout
2793 johnpye 825 assuming you have got the help files installed on your system, which you
2794     may not find you have.
2795     \end_layout
2796    
2797     \end_inset
2798    
2799     .
2800     For the moment we will provide you with the "just-in-time" details here
2801     so you do not need to be sidetracked just yet by pushing these Help buttons.
2802     \end_layout
2803    
2804     \begin_layout Standard
2805     \begin_inset Marginal
2806     status collapsed
2807    
2808 jpye 2785 \begin_layout Plain Layout
2809 johnpye 825 hey, where did that window go? I want it back NOW!
2810     \end_layout
2811    
2812     \end_inset
2813    
2814     If you ever lose a window, open the Script window and under the Tools
2815 jpye 2785 \begin_inset Index idx
2816     status collapsed
2817 johnpye 825
2818 jpye 2785 \begin_layout Plain Layout
2819     Tools
2820     \end_layout
2821    
2822 johnpye 825 \end_inset
2823    
2824     button, select the window you wish to open.
2825     You cannot lose the Script window unless you shut down ASCEND.
2826     For other windows in ASCEND, you can close them and re-open them as required.
2827     Any window that you closed can usually be restored by going back to the
2828     Script window and selected it from the Tools menu there.
2829     \end_layout
2830    
2831     \begin_layout Standard
2832     \begin_inset Marginal
2833     status collapsed
2834    
2835 jpye 2785 \begin_layout Plain Layout
2836 johnpye 825 How do I quit
2837 jpye 2785 \begin_inset Index idx
2838     status collapsed
2839 johnpye 825
2840 jpye 2785 \begin_layout Plain Layout
2841     quit ASCEND
2842     \end_layout
2843    
2844 johnpye 825 \end_inset
2845    
2846     ASCEND?
2847     \end_layout
2848    
2849     \end_inset
2850    
2851     To exit
2852 jpye 2785 \begin_inset Index idx
2853     status collapsed
2854 johnpye 825
2855 jpye 2785 \begin_layout Plain Layout
2856     exit ASCEND
2857     \end_layout
2858    
2859 johnpye 825 \end_inset
2860    
2861     ASCEND, close the Script window.
2862     You will be asked to confirm that you want to exit ASCEND.
2863     If you have simulations in memory this will stop you from losing your results.
2864     \end_layout
2865    
2866     \begin_layout Standard
2867     \begin_inset Marginal
2868     status collapsed
2869    
2870 jpye 2785 \begin_layout Plain Layout
2871 johnpye 825 saving
2872 jpye 2785 \begin_inset Index idx
2873     status collapsed
2874 johnpye 825
2875 jpye 2785 \begin_layout Plain Layout
2876     saving window position
2877     \end_layout
2878    
2879 johnpye 825 \end_inset
2880    
2881     window positions
2882 jpye 2785 \begin_inset Index idx
2883     status collapsed
2884 johnpye 825
2885 jpye 2785 \begin_layout Plain Layout
2886     window position
2887     \end_layout
2888    
2889 johnpye 825 \end_inset
2890    
2891    
2892     \end_layout
2893    
2894     \end_inset
2895    
2896     ASCEND will not remember your window locations automatically.
2897     If you like where you have placed the windows for ASCEND on your display,
2898     go to the Script window and select 'Save all appearances
2899 jpye 2785 \begin_inset Index idx
2900     status collapsed
2901 johnpye 825
2902 jpye 2785 \begin_layout Plain Layout
2903     window locations, save
2904     \end_layout
2905    
2906 johnpye 825 \end_inset
2907    
2908    
2909 jpye 2785 \begin_inset Index idx
2910     status collapsed
2911 johnpye 825
2912 jpye 2785 \begin_layout Plain Layout
2913     appearances, save all
2914     \end_layout
2915    
2916 johnpye 825 \end_inset
2917    
2918     ' under the View
2919 jpye 2785 \begin_inset Index idx
2920     status collapsed
2921 johnpye 825
2922 jpye 2785 \begin_layout Plain Layout
2923     View
2924     \end_layout
2925    
2926 johnpye 825 \end_inset
2927    
2928     menu.
2929     A similar tool exists for each window for saving only its position.
2930     \end_layout
2931    
2932     \begin_layout Standard
2933     \begin_inset Marginal
2934     status collapsed
2935    
2936 jpye 2785 \begin_layout Plain Layout
2937 johnpye 825 start by loading and compiling using tools in the Library window
2938     \end_layout
2939    
2940     \end_inset
2941    
2942     We shall start with the Library window in the upper right.
2943     This window provides you with the tools to load and compile files containing
2944     type definitions.
2945     You can also display
2946 jpye 2785 \begin_inset Index idx
2947     status collapsed
2948 johnpye 825
2949 jpye 2785 \begin_layout Plain Layout
2950     display
2951     \end_layout
2952    
2953 johnpye 825 \end_inset
2954    
2955     the code for the different types you have loaded.
2956     \end_layout
2957    
2958     \begin_layout Standard
2959     \begin_inset Marginal
2960     status collapsed
2961    
2962 jpye 2785 \begin_layout Plain Layout
2963 johnpye 825 use the left mouse button unless we tell you otherwise (however, on you
2964     own explore using the right mouse button in any of the windows)
2965     \end_layout
2966    
2967     \end_inset
2968    
2969     Let's load your file.
2970     Under the File button select the 'Read types from File
2971 jpye 2785 \begin_inset Index idx
2972     status collapsed
2973 johnpye 825
2974 jpye 2785 \begin_layout Plain Layout
2975     Read Types from File
2976     \end_layout
2977    
2978 johnpye 825 \end_inset
2979    
2980     ' tool.
2981     You select this tool by clicking on it using the left mouse button - i.e.,
2982     the button you should have expected to use.
2983     A window will appear asking you to find the file you want to read into
2984     ASCEND.
2985     Navigate to where you stored
2986     \family typewriter
2987     vesselPlain.a4c
2988     \family default
2989     (in the subdirectory
2990     \family typewriter
2991     ascdata
2992     \family default
2993     ) and select that file.
2994     If you have the wrong ending on the file (you left
2995     \family typewriter
2996     .txt
2997     \family default
2998     or you forgot to put
2999     \family typewriter
3000     .a4c
3001     \family default
3002     as the ending), tell the system to list all files and pick the one you
3003     want.
3004     The
3005     \family typewriter
3006     .a4c
3007     \family default
3008     is used by the system to list only the files it thinks you might want to
3009     load, but ASCEND isn't fussy.
3010     It will attempt to load any file you pick.
3011     \end_layout
3012    
3013     \begin_layout Standard
3014     Look in the Console window at the lower right, and, if the file loads without
3015     any errors being listed there, you can skip past the next bit to where
3016     you should start to compile an instance.
3017     The next bit has some useful hints on how to debug your models.
3018     If you want some debugging experience, put a known error into your
3019     \family typewriter
3020     vesselPlain.a4c
3021     \family default
3022     file and see what happens.
3023     This move will give you a reason to read the following section.
3024     \end_layout
3025    
3026     \begin_layout Standard
3027     \begin_inset Marginal
3028     status open
3029    
3030 jpye 2785 \begin_layout Plain Layout
3031 johnpye 825 Do not ignore the diagnostics
3032 jpye 2785 \begin_inset Index idx
3033     status collapsed
3034 johnpye 825
3035 jpye 2785 \begin_layout Plain Layout
3036     diagnostics
3037     \end_layout
3038    
3039 johnpye 825 \end_inset
3040    
3041     that might appear in the Console window
3042     \end_layout
3043    
3044     \end_inset
3045    
3046     If the Console window in the lower right starts filling with several tens
3047     of lines of diagnostics, look to see if you included the
3048     \family typewriter
3049     REQUIRE
3050     \family default
3051    
3052 jpye 2785 \begin_inset Index idx
3053     status collapsed
3054 johnpye 825
3055 jpye 2785 \begin_layout Plain Layout
3056     REQUIRE
3057     \end_layout
3058    
3059 johnpye 825 \end_inset
3060    
3061     statement at the beginning of your model file.
3062     Without that statement, ASCEND is missing all the definitions for the types
3063     of variables in your model, and it will go wild telling you so
3064     \begin_inset Foot
3065     status collapsed
3066    
3067 jpye 2785 \begin_layout Plain Layout
3068 johnpye 825 It might also be choking on a Word document because you forgot to save
3069     it as a text file.
3070     \end_layout
3071    
3072     \end_inset
3073    
3074     .
3075     \end_layout
3076    
3077     \begin_layout Standard
3078     While loading the files containing these types, ASCEND will look very closely
3079     at the syntax and will give you all kinds of diagnostic messages in the
3080     Console window (lower right) if you have done something wrong.
3081     It will also at times spew out some warning messages
3082 jpye 2785 \begin_inset Index idx
3083     status collapsed
3084 johnpye 825
3085 jpye 2785 \begin_layout Plain Layout
3086     warning messages
3087     \end_layout
3088    
3089 johnpye 825 \end_inset
3090    
3091     if you have done something thought to be poor modeling style.
3092     You must heed the error messages as the file will not load if there are
3093     any.
3094     ASCEND will tell you if it did not load the file.
3095    
3096     \end_layout
3097    
3098     \begin_layout Standard
3099     You should consider heeding the warnings if you get any.
3100     If you ignore them now, they may come back and haunt you later.
3101     However, there are times when we issue a warning but everything will work,
3102     and you will think we were not too clever.
3103     Our response: better modeling style
3104 jpye 2785 \begin_inset Index idx
3105     status collapsed
3106 johnpye 825
3107 jpye 2785 \begin_layout Plain Layout
3108     modeling style
3109     \end_layout
3110    
3111 johnpye 825 \end_inset
3112    
3113     can eliminate these warnings.
3114     (It's been our system so we get to have the last word.)
3115     \end_layout
3116    
3117     \begin_layout Standard
3118     \begin_inset Marginal
3119     status collapsed
3120    
3121 jpye 2785 \begin_layout Plain Layout
3122 johnpye 825 how do I jump
3123 jpye 2785 \begin_inset Index idx
3124     status collapsed
3125 johnpye 825
3126 jpye 2785 \begin_layout Plain Layout
3127     jump to line
3128     \end_layout
3129    
3130 johnpye 825 \end_inset
3131    
3132    
3133 jpye 2785 \begin_inset Index idx
3134     status collapsed
3135 johnpye 825
3136 jpye 2785 \begin_layout Plain Layout
3137     line numbers
3138     \end_layout
3139    
3140 johnpye 825 \end_inset
3141    
3142     to line 100 of a file when using some of the standard editors?
3143     \end_layout
3144    
3145     \end_inset
3146    
3147     The error and warning messages will contain a line number in the file where
3148     the error has occurred.
3149     This will be the line number as counted by an editor with the first line
3150     being line 1 in the file.
3151     Editors always provide you with a means to get directly to a line number
3152     in a file.
3153     Find out how to do that or you will not be too happy with debugging a large
3154     file.
3155     \end_layout
3156    
3157     \begin_layout Standard
3158     You will be in the debug mode for a new system so do not expect it to be
3159     totally obvious the first few times you make an error.
3160     We have tried to use language that should be meaningful, but we may have
3161     failed or the error may be pretty subtle and not possible for us to anticipate
3162     how to describe it in your terms.
3163     (Send us a bug report if you have any good ideas on language.)
3164     \end_layout
3165    
3166     \begin_layout Standard
3167     \begin_inset Marginal
3168     status collapsed
3169    
3170 jpye 2785 \begin_layout Plain Layout
3171 johnpye 825 reloading a file
3172 jpye 2785 \begin_inset Index idx
3173     status collapsed
3174 johnpye 825
3175 jpye 2785 \begin_layout Plain Layout
3176     reloading a file
3177     \end_layout
3178    
3179 johnpye 825 \end_inset
3180    
3181    
3182 jpye 2785 \begin_inset Index idx
3183     status collapsed
3184 johnpye 825
3185 jpye 2785 \begin_layout Plain Layout
3186     file, reloading
3187     \end_layout
3188    
3189 johnpye 825 \end_inset
3190    
3191     overwrites the previous version
3192     \end_layout
3193    
3194     \end_inset
3195    
3196     You can reload any file your have corrected using the Read types from file
3197     tool under the File menu.
3198     It will overwrite the previous version of the file only if the file has
3199     changed since it was last loaded (note that we do not reload those big
3200     files unless you make a change even if you tell us to).
3201     \end_layout
3202    
3203     \begin_layout Standard
3204     \begin_inset Marginal
3205     status collapsed
3206    
3207 jpye 2785 \begin_layout Plain Layout
3208 johnpye 825 displaying the code
3209     \end_layout
3210    
3211     \end_inset
3212    
3213     You can display the code you have written.
3214     Select the model vessel in the right window of the Library.
3215     Then under the Display
3216 jpye 2785 \begin_inset Index idx
3217     status collapsed
3218 johnpye 825
3219 jpye 2785 \begin_layout Plain Layout
3220     Display window
3221     \end_layout
3222    
3223 johnpye 825 \end_inset
3224    
3225     menu at the top, select the tool Code.
3226     The Display window will open displaying the code for this model.
3227     \end_layout
3228    
3229     \begin_layout Standard
3230     \begin_inset Marginal
3231     status collapsed
3232    
3233 jpye 2785 \begin_layout Plain Layout
3234 johnpye 825 now compile as "
3235     \family typewriter
3236     v
3237     \family default
3238     "
3239     \end_layout
3240    
3241     \end_inset
3242    
3243     Okay, you have your file loaded without getting any diagnostics.
3244     You are ready to compile
3245 jpye 2785 \begin_inset Index idx
3246     status collapsed
3247 johnpye 825
3248 jpye 2785 \begin_layout Plain Layout
3249     compile
3250     \end_layout
3251    
3252 johnpye 825 \end_inset
3253    
3254     .
3255     In the Library window, look in the left window and select the file
3256     \family typewriter
3257     vesselPlain.a4c
3258     \family default
3259     .
3260     It contains the type definition you wish to compile.
3261     You should see the type vessel appear in the right window.
3262     Select vessel.
3263     Under the Edit button, select Create simulation.
3264     A small window opens and asks you to name the simulation.
3265     Call it
3266     \family typewriter
3267     v
3268     \family default
3269     -- yes, just the letter "v", and select "OK".
3270     Short names for instances often seem to be preferable.
3271    
3272     \end_layout
3273    
3274     \begin_layout Standard
3275     Look again in the Console window for diagnostics.
3276     If everything worked without error, you will see some statistics telling
3277     you how many models, relations and so forth you have created during the
3278     compile step.
3279     \end_layout
3280    
3281     \begin_layout Standard
3282     \begin_inset Marginal
3283     status collapsed
3284    
3285 jpye 2785 \begin_layout Plain Layout
3286 johnpye 825 and pass the instance
3287 jpye 2785 \begin_inset Index idx
3288     status collapsed
3289 johnpye 825
3290 jpye 2785 \begin_layout Plain Layout
3291     instance
3292     \end_layout
3293    
3294 johnpye 825 \end_inset
3295    
3296     to the Browser
3297 jpye 2785 \begin_inset Index idx
3298     status collapsed
3299 johnpye 825
3300 jpye 2785 \begin_layout Plain Layout
3301     Browser
3302     \end_layout
3303    
3304 johnpye 825 \end_inset
3305    
3306    
3307     \end_layout
3308    
3309     \end_inset
3310    
3311     Select
3312     \family typewriter
3313     v IS A vessel
3314     \family default
3315     in the bottom of the Library window.
3316     Then under the Export
3317 jpye 2785 \begin_inset Index idx
3318     status collapsed
3319 johnpye 825
3320 jpye 2785 \begin_layout Plain Layout
3321     Export
3322     \end_layout
3323    
3324 johnpye 825 \end_inset
3325    
3326     button, select 'Simulation to Browser
3327 jpye 2785 \begin_inset Index idx
3328     status collapsed
3329 johnpye 825
3330 jpye 2785 \begin_layout Plain Layout
3331     Export Simulation to Browser
3332     \end_layout
3333    
3334 johnpye 825 \end_inset
3335    
3336     ' to export
3337     \family typewriter
3338     v
3339     \family default
3340     to the Browser tool set.
3341     The Browser window will open and contain
3342     \family typewriter
3343     v
3344     \family default
3345     .
3346     It might be useful to enlarge this window and move it down a bit, placing
3347     it a bit to the right of the center of your screen.
3348     (Remember you can save this positioning and sizing of the Browser window
3349     by going under the View menu and picking 'Save appearance'.)
3350     \end_layout
3351    
3352     \begin_layout Standard
3353     \begin_inset Marginal
3354     status collapsed
3355    
3356 jpye 2785 \begin_layout Plain Layout
3357 johnpye 825 examine
3358     \family typewriter
3359     v
3360     \family default
3361     by playing with it in the Browser
3362     \end_layout
3363    
3364     \end_inset
3365    
3366     In the left upper window of the Browser, you will find
3367     \family typewriter
3368     v
3369     \family default
3370     to be the current object.
3371     Listed in the right window are all the parts of the current object.
3372     You will see the variables listed here along with an indication of their
3373     type.
3374     For example, you will find
3375     \family typewriter
3376     Cylinder IS A relation
3377     \family default
3378     and
3379     \family typewriter
3380     D IS A distance
3381     \family default
3382     listed, among many others.
3383    
3384     \family typewriter
3385     Cylinder
3386     \family default
3387     is one of the equations you wrote describing the model while
3388     \family typewriter
3389     D
3390     \family default
3391     was the diameter of the vessel.
3392    
3393     \end_layout
3394    
3395     \begin_layout Standard
3396     \begin_inset Marginal
3397     status collapsed
3398    
3399 jpye 2785 \begin_layout Plain Layout
3400 johnpye 825 included flags
3401 jpye 2785 \begin_inset Index idx
3402     status collapsed
3403 johnpye 825
3404 jpye 2785 \begin_layout Plain Layout
3405     included flags
3406     \end_layout
3407    
3408 johnpye 825 \end_inset
3409    
3410    
3411 jpye 2785 \begin_inset Index idx
3412     status collapsed
3413 johnpye 825
3414 jpye 2785 \begin_layout Plain Layout
3415     flag, included
3416     \end_layout
3417    
3418 johnpye 825 \end_inset
3419    
3420     for relations
3421     \end_layout
3422    
3423     \end_inset
3424    
3425     If you pick any of the parts in the right or bottom windows, it becomes
3426     the current object; its parts then show in the right window.
3427     For example, a relation has a boolean part (a flag that takes the value
3428    
3429     \family typewriter
3430     TRUE
3431     \family default
3432     or
3433     \family typewriter
3434     FALSE
3435     \family default
3436     ) indicating whether or not it is to be included when ASCEND solves the
3437     equations you defined for the model.
3438     \end_layout
3439    
3440     \begin_layout Standard
3441     If you wish to display the current value for this flag, pick 'Display Atom
3442     Values
3443 jpye 2785 \begin_inset Index idx
3444     status collapsed
3445 johnpye 825
3446 jpye 2785 \begin_layout Plain Layout
3447     Display Atom Values
3448     \end_layout
3449    
3450 johnpye 825 \end_inset
3451    
3452     ' under the View menu.
3453     This tool toggles a switch that causes either the value or the type to
3454     show for a variable, a constant or a relation in the upper right window
3455     of the Browser.
3456     Try toggling it back and forth and looking at different things in the Browser.
3457     \end_layout
3458    
3459     \begin_layout Standard
3460     Pick each of the tools under View and note what happens to the displaying
3461     of things in the Browser.
3462     \end_layout
3463    
3464     \begin_layout Standard
3465     Across the bottom of the Browser window note the buttons you can select
3466     labeled
3467     \family typewriter
3468     RV
3469     \family default
3470     ,
3471     \family typewriter
3472     DV
3473     \family default
3474     and so forth.
3475     If you have made the Browser window large enough, you will see to the right
3476     of these buttons the type of objects whose value you want to appear or
3477     not in the lower Browser window as you toggle each button.
3478     Toggle each of these buttons and see if the lower display changes.
3479     If it does not, then this type of part is not in the current object.
3480     \end_layout
3481    
3482     \begin_layout Section
3483     Solving
3484 jpye 2785 \begin_inset Index idx
3485     status collapsed
3486 johnpye 825
3487 jpye 2785 \begin_layout Plain Layout
3488     Solving
3489     \end_layout
3490    
3491 johnpye 825 \end_inset
3492    
3493     an ASCEND instance
3494     \end_layout
3495    
3496     \begin_layout Standard
3497     Well, you have been patient.
3498     While there are lots of interesting tools left to explore in the Browser,
3499     perhaps it is time to try to solve this model.
3500     To solve
3501     \family typewriter
3502     v
3503     \family default
3504     , make it the current object (it alone should be listed in the upper left
3505     window of the Browser).
3506     Then, under the Export
3507 jpye 2785 \begin_inset Index idx
3508     status collapsed
3509 johnpye 825
3510 jpye 2785 \begin_layout Plain Layout
3511     Export to Solver
3512     \end_layout
3513    
3514 johnpye 825 \end_inset
3515    
3516     menu, select 'to Solver'.
3517     The Solver window will open, along with a smaller window labeled Eligible
3518 jpye 2785 \begin_inset Index idx
3519     status collapsed
3520 johnpye 825
3521 jpye 2785 \begin_layout Plain Layout
3522     window, Eligible
3523     \end_layout
3524    
3525 johnpye 825 \end_inset
3526    
3527    
3528 jpye 2785 \begin_inset Index idx
3529     status collapsed
3530 johnpye 825
3531 jpye 2785 \begin_layout Plain Layout
3532     Eligible window
3533     \end_layout
3534    
3535 johnpye 825 \end_inset
3536    
3537     .
3538     Move the Eligible window up a bit so it does not cover any or very little
3539     of the Solver window.
3540     Move the Solver window to the lower left and enlarge it so you can see
3541     all of its contents.
3542    
3543     \end_layout
3544    
3545     \begin_layout Standard
3546     \begin_inset Marginal
3547     status collapsed
3548    
3549 jpye 2785 \begin_layout Plain Layout
3550 johnpye 825 if ASCEND stops responding
3551 jpye 2785 \begin_inset Index idx
3552     status collapsed
3553 johnpye 825
3554 jpye 2785 \begin_layout Plain Layout
3555     responding, ASCEND stops
3556     \end_layout
3557    
3558 johnpye 825 \end_inset
3559    
3560     , hunt down one of those "nasty" windows with a "yellow lock
3561 jpye 2785 \begin_inset Index idx
3562     status collapsed
3563 johnpye 825
3564 jpye 2785 \begin_layout Plain Layout
3565     yellow lock
3566     \end_layout
3567    
3568 johnpye 825 \end_inset
3569    
3570     " and close it properly
3571     \end_layout
3572    
3573     \end_inset
3574    
3575     This Eligible window is 'modal': if it is open and you do not do something
3576     to make it happy and go away, it will stop you from doing anything else
3577     in the ASCEND system.
3578     Such windows appear with a black lock icon in a yellow field -- we shall
3579     call it a "yellow lock." They demand you attend to them
3580     \emph on
3581     now
3582     \emph default
3583     .
3584     A good solution would be for such a window to stay open and on top of all
3585     the other open windows.
3586     Unfortunately we have not been able under all window managers to stop it
3587     from ducking under another window.
3588     If you ever find ASCEND unwilling to respond, iconify the other windows
3589     to get them out of the way, until you find one of these windows.
3590     On the PC you can go to the icon bar at the bottom of your screen and,
3591     by clicking on the window, bring it to the top.
3592     Then do whatever it takes to make it happy and close properly -- such as
3593     cancel it.
3594     If you are not careful here, for example, this window will hide under the
3595     Solver window before you are through with it.
3596     \end_layout
3597    
3598     \begin_layout Standard
3599     \begin_inset Marginal
3600     status open
3601    
3602 jpye 2785 \begin_layout Plain Layout
3603 johnpye 825 is our problem well-posed
3604 jpye 2785 \begin_inset Index idx
3605     status collapsed
3606 johnpye 825
3607 jpye 2785 \begin_layout Plain Layout
3608     well-posed
3609     \end_layout
3610    
3611 johnpye 825 \end_inset
3612    
3613     ?
3614     \end_layout
3615    
3616     \end_inset
3617    
3618     The Solver window contains the information we need to see to explain why
3619     the Eligible window opened in the first place.
3620     Examine the information the Solver displays.
3621     It tells you that
3622     \family typewriter
3623     v
3624     \family default
3625     has 6 relations defining it and that all are equalities and included.
3626     It has no inequalities.
3627     On the right side we see there are 10 variables and all are 'free
3628 jpye 2785 \begin_inset Index idx
3629     status collapsed
3630 johnpye 825
3631 jpye 2785 \begin_layout Plain Layout
3632     free variables
3633     \end_layout
3634    
3635 johnpye 825 \end_inset
3636    
3637     .' A free variable is one for which you want the system to compute a value.
3638     Hmm, 6 equations in 10 variables.
3639     Something is wrong here.
3640     For a well-posed problem, you want 6 equations in 6 variables (i.e., square
3641 jpye 2785 \begin_inset Index idx
3642     status collapsed
3643 johnpye 825
3644 jpye 2785 \begin_layout Plain Layout
3645     square
3646     \end_layout
3647    
3648 johnpye 825 \end_inset
3649    
3650     ).
3651     ASCEND reports that the system is underspecified
3652 jpye 2785 \begin_inset Index idx
3653     status collapsed
3654 johnpye 825
3655 jpye 2785 \begin_layout Plain Layout
3656     underspecified
3657     \end_layout
3658    
3659 johnpye 825 \end_inset
3660    
3661     by 4.
3662     This means you need to pick four of the variables and declare them to be
3663     fixed
3664 jpye 2785 \begin_inset Index idx
3665     status collapsed
3666 johnpye 825
3667 jpye 2785 \begin_layout Plain Layout
3668     fixed
3669     \end_layout
3670    
3671 johnpye 825 \end_inset
3672    
3673     .
3674     You will also have to pick values for these fixed variables before you
3675     can solve for the remaining 6.
3676     For such a small problem as this one, this task is not formidable.
3677     For a model with 50,000 equations and 60,000 variables, one would quit
3678     and go home.
3679     We have exposed a need here.
3680     We certainly would like ASCEND to help us here for this small problem.
3681     But we insist that it help us in major ways to make the 50,000 equation,
3682     60,000 variable problem possible.
3683     \end_layout
3684    
3685     \begin_layout Standard
3686     \begin_inset Marginal
3687     status collapsed
3688    
3689 jpye 2785 \begin_layout Plain Layout
3690 johnpye 825 picking variables we are going to fix
3691     \end_layout
3692    
3693     \end_inset
3694    
3695     Okay, the small help such as needed here is why the Eligible window opened.
3696     Let's return to it.
3697     It lists all the variables of those not yet fixed that are eligible to
3698     be fixed and still leave us a calculation that has a chance to solve.
3699     The algorithm to find eligible variables does an quick analysis of the
3700     structure of the equations.
3701     The variables it lists are those that can be fixed
3702     \emph on
3703 jpye 1766 without
3704 johnpye 825 \emph default
3705 jpye 1766 the system becoming numerically singular.
3706 johnpye 825 So any variables that are not shown
3707     \emph on
3708     cannot possibly
3709     \emph default
3710     help you.
3711     \end_layout
3712    
3713     \begin_layout Standard
3714     So look at the list and decide what you would like to fix for your first
3715     calculation with this model.
3716     Diameter (
3717     \family typewriter
3718     v.D
3719     \family default
3720     ) seems a good choice.
3721     Now you can see why we called the instance just plain old
3722     \family typewriter
3723     v
3724     \family default
3725     .
3726     A longer name would get tiring here.
3727     Anyway, pick
3728     \family typewriter
3729     v.D
3730     \family default
3731     .
3732     Immediately the list reappears with
3733     \family typewriter
3734     v.D
3735     \family default
3736     no longer on it.
3737     ASCEND has just repeated the eligibility analysis, and found that more
3738     variables still need to be fixed.
3739     \end_layout
3740    
3741     \begin_layout Standard
3742     We have three more to pick.
3743     On the list are both vessel height,
3744     \family typewriter
3745     v.H
3746     \family default
3747     , and
3748     \family typewriter
3749     v.H_to_D_ratio
3750     \family default
3751     .
3752     We certainly cannot pick both of these.
3753     One implies the other if we know a value for
3754     \family typewriter
3755     v.D
3756     \family default
3757     .
3758     Pick
3759     \family typewriter
3760     v.H_to_D_ratio
3761     \family default
3762     .
3763     Note that
3764     \family typewriter
3765     v.H
3766     \family default
3767     is no longer eligible.
3768     Good.
3769     We would be worried if it were still there.
3770     \end_layout
3771    
3772     \begin_layout Standard
3773     We see
3774     \family typewriter
3775     v.metal_density
3776     \emph on
3777     .
3778    
3779     \family default
3780     \emph default
3781     Pick it.
3782     Strange.
3783     Metal mass and volume stayed eligible.
3784     Why? If we pick metal mass, wall thickness is implied, and the same is
3785     true if we were to pick metal volume.
3786     However, as it seems much more natural to pick
3787     \family typewriter
3788     wall_thickness
3789     \family default
3790     , make that the last variable you choose.
3791     The Solver window now says this problem is square (i.e., it has 6 equations
3792     in the same number of unknowns).
3793     Table
3794 jpye 2785 \begin_inset CommandInset ref
3795     LatexCommand ref
3796 jpye 1766 reference "tab:model1.variableFixed"
3797 johnpye 825
3798     \end_inset
3799    
3800    
3801     \noun off
3802     summarizes the four variables we have elected here to fix.
3803     \end_layout
3804    
3805     \begin_layout Standard
3806     \begin_inset Float table
3807     wide false
3808     sideways false
3809     status open
3810    
3811 jpye 2785 \begin_layout Plain Layout
3812     \begin_inset Caption Standard
3813 johnpye 825
3814 jpye 2785 \begin_layout Plain Layout
3815     \begin_inset CommandInset label
3816     LatexCommand label
3817 jpye 1766 name "tab:model1.variableFixed"
3818    
3819 johnpye 825 \end_inset
3820    
3821     Variables we have fixed
3822 jpye 2785 \begin_inset Index idx
3823     status collapsed
3824 johnpye 825
3825 jpye 2785 \begin_layout Plain Layout
3826     fixed variables
3827     \end_layout
3828    
3829 johnpye 825 \end_inset
3830    
3831    
3832     \end_layout
3833    
3834 jpye 1766 \end_inset
3835    
3836    
3837     \end_layout
3838    
3839 jpye 2785 \begin_layout Plain Layout
3840 johnpye 825 \begin_inset Tabular
3841     <lyxtabular version="3" rows="5" columns="1">
3842 jpye 2785 <features rotate="0" tabularvalignment="middle">
3843     <column alignment="center" valignment="top">
3844     <row>
3845     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3846 johnpye 825 \begin_inset Text
3847    
3848 jpye 2785 \begin_layout Plain Layout
3849 johnpye 825 variable
3850     \end_layout
3851    
3852     \end_inset
3853     </cell>
3854     </row>
3855 jpye 2785 <row>
3856 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3857     \begin_inset Text
3858    
3859 jpye 2785 \begin_layout Plain Layout
3860 johnpye 825
3861     \family typewriter
3862     D
3863     \end_layout
3864    
3865     \end_inset
3866     </cell>
3867     </row>
3868 jpye 2785 <row>
3869 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3870     \begin_inset Text
3871    
3872 jpye 2785 \begin_layout Plain Layout
3873 johnpye 825
3874     \family typewriter
3875     H_to_D_ratio
3876     \end_layout
3877    
3878     \end_inset
3879     </cell>
3880     </row>
3881 jpye 2785 <row>
3882 johnpye 825 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3883     \begin_inset Text
3884    
3885 jpye 2785 \begin_layout Plain Layout
3886 johnpye 825
3887     \family typewriter
3888     meta_density
3889     \end_layout
3890    
3891     \end_inset
3892     </cell>
3893     </row>
3894 jpye 2785 <row>
3895     <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
3896 johnpye 825 \begin_inset Text
3897    
3898 jpye 2785 \begin_layout Plain Layout
3899 johnpye 825
3900     \family typewriter
3901     wall_thickness
3902     \end_layout
3903    
3904     \end_inset
3905     </cell>
3906     </row>
3907     </lyxtabular>
3908    
3909     \end_inset
3910    
3911    
3912     \end_layout
3913    
3914     \end_inset
3915    
3916    
3917     \end_layout
3918    
3919     \begin_layout Standard
3920     \begin_inset Marginal
3921     status collapsed
3922    
3923 jpye 2785 \begin_layout Plain Layout
3924 johnpye 825 ASCEND partitions the problem into smaller problems for solving
3925     \end_layout
3926    
3927     \end_inset
3928    
3929     Toward the bottom right of the
3930     \series bold
3931     Solver
3932     \series default
3933     window, we see there are 6 "blocks
3934 jpye 2785 \begin_inset Index idx
3935     status collapsed
3936 johnpye 825
3937 jpye 2785 \begin_layout Plain Layout
3938     blocks
3939     \end_layout
3940    
3941 johnpye 825 \end_inset
3942    
3943     ." What are blocks? ASCEND has examined the equations and, in this case,
3944     has discovered that not all the equations have to be solved simultaneously.
3945     There are 6 blocks of equations which it can solve in sequence.
3946     6 blocks and 6 equations means that ASCEND has found a way to solve the
3947     model by solving 6 individual equations in sequence -- i.e., one at a time.
3948     This is a good thing: it usually means that the solver will have less problems
3949     with locating the overall solution.
3950     \end_layout
3951    
3952     \begin_layout Standard
3953     As well as breaking down the system into blocks, ASCEND has the ability
3954     to rearrange some simple algebraic equations so that unknown variables
3955     can be evaluated directly from the known values, with no need for iterative
3956     numerical methods.
3957     This is only possible if there is just one equation in the block.
3958     In fact, this problem, with the 4 variables we selected to be fixed, can
3959     be solved entirely without iteration.
3960     \end_layout
3961    
3962     \begin_layout Standard
3963     \begin_inset Marginal
3964     status open
3965    
3966 jpye 2785 \begin_layout Plain Layout
3967 johnpye 825 displaying the incidence matrix
3968 jpye 2785 \begin_inset Index idx
3969     status collapsed
3970 johnpye 825
3971 jpye 2785 \begin_layout Plain Layout
3972     incidence matrix
3973     \end_layout
3974    
3975 johnpye 825 \end_inset
3976    
3977    
3978     \end_layout
3979    
3980     \end_inset
3981    
3982     Can we see what ASCEND has just discovered? It turns out we can (we would
3983     not have asked if we could not).
3984     Under the Display menu on the Solver, select the 'Incidence matrix tool
3985 jpye 2785 \begin_inset Index idx
3986     status collapsed
3987 johnpye 825
3988 jpye 2785 \begin_layout Plain Layout
3989     incidence matrix tool
3990     \end_layout
3991    
3992 johnpye 825 \end_inset
3993    
3994     '.
3995     A window pops open showing us the incidence of variables in the equations
3996     and display them in the order that ASCEND has found to solve them, also
3997     known as a sparsity matrix
3998 jpye 2785 \begin_inset Index idx
3999     status collapsed
4000 johnpye 825
4001 jpye 2785 \begin_layout Plain Layout
4002     sparsity matrix