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

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

Parent Directory Parent Directory | Revision Log Revision Log


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