{VERSION 2 3 "APPLE_PPC_MAC" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Out put" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "T itle" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 12 "Nelwin Tools" }}}{EXCHG {PARA 19 "" 0 "" {TEXT -1 62 "Version 20 Sep 96\n© Esben Sloth Anderse n, esa@business.auc.dk\n" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 12 "Intr oduction" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "x" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 26 "Programs for data analysis" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 288 "To ease the analysis of the results of evolutionary simulations, Andersen et al. (DRUIDIC) have made a series of helping \+ procedures. Here are a couple for plotting of time series data. We st art by increasing the printlevel of information (to give information f or debugging the programs)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "printlevel := 3:" }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 17 "DataNote s(Pretty)" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 513 "NWT[DataNotes] := proc(Pretty)\nglobal DATA,indexlist,paramseq;\nlocal i;\noptions ` DRUIDIC project. Revision 17 July 96`;\n\nDATA[version] := `VERSION..` , op(2,op(1,_descr));\nindexlist := sort([seq(op(indices(_)[j]),j=1..n ops([indices(_)]))]);\nparamseq := NULL;\nfor i from 1 to nops(indexli st) do\n\011paramseq:=paramseq,indexlist[i]=_[indexlist[i]];\nod;\nDAT A[param] := ` PARAMETERS..`, [paramseq];\nif Pretty = true then \n\011 print(cat(DATA[version],DATA[param]));\nelse\n\011lprint(DATA[version] );\n\011lprint(DATA[param]);\nfi;\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 17 "PlotDescr(Pretty)" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 398 "NWT[PlotDescr] := proc(Pretty)\nglobal DATA;\noptions `DRUIDIC \+ project. Revision 17 July 96`;\n\nDATA[type] := figure;\nDATA[insert] \+ := (`[insert figure here]`);\nif Pretty = true then\n\011print(DATA[te xt]);\n\011print(DATA[insert]);\n\011DataNotes(Pretty);\nelse\n\011lpr int(DATA[text]);\n\011lprint(DATA[insert]);\n\011DataNotes(Pretty);\nf i;\nif member(struct, \{args\}) then\n\011lprint(`PLOTSTRUCTURE...`, D ATA[plotdata]);\nfi;\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 9 "Le gend(N)" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "Legend(N) - N is the nu mber of firms" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 454 "NWT[Legen d] := proc(N)\nglobal periods,plotdata,text;\nlocal colour,i,n,a,b;\no ption `ES Andersen, Aalborg University, 28 Aug 96`;\n\ncolour := seq(' COLOUR'(HUE,n/N), n=1..N);\na:=NULL; b := NULL;\nfor n from 1 to N do \n\011a := a, 'CURVES'([[0,N-n],[10,N-n]],\n colour[n],THICKNESS(2) );\n b := b, 'TEXT'([11,N-n],`Firm `.n,FONT(TIMES,ROMAN,12));\nod;\n\n text := cat(`Legend for `,N,` firms`);\nplotdata := 'PLOT'(a, b, 'TITL E'(text), AXESSTYLE(NONE));\nplotdata;\n\nend:" }}}}{SECT 0 {PARA 4 " " 0 "" {TEXT -1 24 "MergeLists(list1, list2)" }}{EXCHG {PARA 0 "" 0 " " {TEXT -1 92 "This procedure performs a subtask for the plotting proc edures, namely to create data points." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 532 "NWT[MergeLists] := proc(list1, list2)\nlocal LookUpI tem,i;\noption `ES Andersen, Aalborg University, 24 Aug 96`;\n\n\011Lo okUpItem := proc(list1, list2, seriesnumber)\n\011local listnumber;\n \011if type(seriesnumber, even) then\n\011\011listnumber := seriesnumb er/2;\n\011\011RETURN(list1[listnumber]);\n\011else\n\011\011listnumbe r := (seriesnumber-1)/2;\n\011\011RETURN(list2[listnumber]);\n\011fi; \n\011end;\n\011\nif not nops(list1) = nops(list2) then\n\011ERROR(`th e number of elements in lists must be the same`);\nfi;\n[seq(LookUpIte m(list1, list2, i), \n\011\011\011\011i = 2..nops(list1)*2 + 1)];\011 \nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 24 "DrawVariable (var, N, T)" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 218 "This procedure draws time \+ series data for the firms of the industry. In order to allow simple co mparisons across time series for different variables, each firm is giv en a specific colour that is the same in all plots. " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 232 "DrawVariable(var,N,T)\n\011- var is the name o f the variable to be plotted\n\011- N is the number of firms - beginni ng with firm #1\n\011- T is the number of periods - beginning with per iod #1\n\011- var can only be one of the variable with a table" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 509 "NWT[DrawVariable] := proc(v ar,N,T)\nglobal periods,plotdata,text;\nlocal colour,tt,t,n,a;\noption `ES Andersen, Aalborg University, 24 Aug 96`;\n\nperiods := seq(t, t \+ = 1..T);\ncolour := seq('COLOUR'(HUE,n/N), n=1..N);\na:=NULL;\nfor n f rom 1 to N do\n\011a := a, 'CURVES'([seq(MergeLists([periods[tt]],[var [n,tt]]),tt=1..T)],\n colour[n],THICKNESS(2));\nod;\n\ntext := cat( `Variable `,var,` for `, N, ` firms and `, T, ` periods.`);\nplotdata \+ := 'PLOT'(a, 'TITLE'(text), AXESSTYLE(NORMAL), AXESTICKS(5,5));\nplotd ata;\n\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 19 "DrawIndVar(var, t)" }}{PARA 0 "" 0 "" {TEXT -1 226 "DrawIndVar(var,t)\n\011- var is \+ the name of the industry-level variable to be plotted\n\011- t is the \+ number of periods - beginning with period #1\n\011- var can only be on e of the variable with a table\n\011- 'pretty' is an optional argument " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 487 "NWT[DrawIndVar] := proc (var,t)\n\nglobal DATA, periods, Pretty;\nlocal i;\noptions `DRUIDIC p roject. Revison 17 July 96`;\n\nDATA:= table();\nDATA[text] := cat(`FI GURE: `, t, ` periods. `, `Variable = `, var);\nperiods := [seq(i, i = 1..t)];\nDATA[plotdata] := \n\011\011\{MergeLists(periods, [seq(var[i ], i = 1..t)])\};\nif member(pretty,\{args\}) then Pretty := true \nel se Pretty := false; \nfi;\nif member (struct,\{args\}) then PlotDescr( Pretty,struct);\nelse PlotDescr(Pretty)\nfi;\nplot(DATA[plotdata]); \011\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 29 "DrawScatter(var1, var2, n, t)" }}{PARA 0 "" 0 "" {TEXT -1 286 "DrawScatter(var1,var2,n, period)\n\011- var1 and var2 are the two variables to be plotted\n\011 - n is the number of firms - beginning with firm #1\n\011- period is t he period for which the plot is made\n\011- var1 and var2 can only be \+ one of the variable with a table\n\011- 'pretty' is an optional argume nt" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 608 "NWT[DrawScatter] := p roc(var1,var2,n,t)\nglobal DATA,list1,list2,plotlist,Text,Pretty;\nloc al i;\noptions `DRUIDIC project. Revision 17 July 96`;\n\nDATA := tabl e();\nlist1 := [seq(var1[i,t], i = 1..n)];\nlist2 := [seq(var2[i,t], i = 1..n)];\nplotlist := \{MergeLists(list1, list2)\};\nDATA[plotdata] \+ := plotlist, style = POINT;\nText := cat(n, ` firms in period `,t, ` V ar1=`,var1, ` Var2=`,var2);\nDATA[text] := cat(`FIGURE: `, Text);\nif \+ member(pretty,\{args\}) then Pretty := true \nelse Pretty := false; \n fi;\nif member (struct,\{args\}) then PlotDescr(Pretty,struct);\nelse \+ PlotDescr(Pretty)\nfi;\nplot(DATA[plotdata]);\011\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 18 "TableDescr(Pretty)" }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 292 "NWT[TableDescr] := proc(Pretty)\nglobal DATA; \noptions `DRUIDIC project. Revision 17 July 96`;\n\nDATA[type] := tab le;\nif Pretty = true then\n\011print(DATA[text]);\n\011print(DATA[sho wtable]);\n\011DataNotes(Pretty);\nelse\n\011lprint(DATA[text]);\n\011 lprint();\n\011print(DATA[showtable]);\n\011DataNotes(Pretty);\nfi;\ne nd:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 35 "TableFirmVar(varlist, n, t, digits)" }}{PARA 0 "" 0 "" {TEXT -1 345 "TableFirmVar(varlist,firm s,period,digits)\n\011- varlist is a list of variable to be tabulated \n\011- firms are the number of firms in the table, starting with #1\n \011- period is the period for which the plot is made\n\011- varlist m ust be written as a list, i.e. [x,y,z]\n\011- digits is the number of \+ digits printed in numbers\n\011- 'pretty' is an optional argument" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 688 "NWT[TableFirmVar] := proc(v arlist,n,t,digits)\nglobal DATA,firms,numvar,Pretty;\nlocal i,j;\nopti ons `DRUIDIC project. Revision 17 July 96`;\n\nDATA:= table();\nfirms \+ := [seq(i, i = 1..n)];\nnumvar := nops(varlist);\nDATA[showtable] := a rray(1..n+1,1..numvar+1);\nfor i from 1 to n do\n\011DATA[showtable][i +1,1] := firms[i];\nod;\nfor j from 1 to numvar do\n\011DATA[showtable ][1,j+1] := varlist[j];\nod;\nfor j from 1 to numvar do\n\011for i fro m 1 to n do\n\011\011DATA[showtable][i+1,j+1] := evalf(varlist[j][i,t] ,digits);\n\011od;\nod;\nDATA[showtable][1,1] := `Ñ`;\nDATA[text] := ` TABLE: Firms and variables.`. ` Period`=t;\nif member(pretty,\{args\}) then Pretty := true;\nelse Pretty := false; \nfi;\nTableDescr(Pretty) ;\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 46 "TablePerVar(varlist, firm, periodlist, digits)" }}{PARA 0 "" 0 "" {TEXT -1 322 "TablePerVa r(varlist,firm,periodlist,digits)\n\011- varlist is a list of variable s to be tabulated\n\011- firm is the firm to be included in the table \n\011- periodlist is a list or a range of periods\n\011- periodlist c an be either [2,4,6,8] or 2..8\n\011- digits is the number of digits p rinted in numbers\n\011- 'pretty' is an optional argument" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 904 "NWT[TablePerVar] := proc(varlist,f irm,periodlist,digits)\n\nglobal DATA,numvar,Pretty,periods,numper;\nl ocal i,j;\noptions `DRUIDIC project. Revision 17 July 96`;\n\nDATA:= t able();\nnumvar := nops(varlist);\nif type(args[3],range) then\n\011pe riods := [seq(i, i = args[3])];\nelif type(args[3],list) then\n\011per iods := args[3];\nelse\n\011ERROR(`wrong definition of periods`);\nfi; \nnumper := nops(periods);\nDATA[showtable] := array(1..numper+1,1..nu mvar+1);\nfor i from 1 to numper do\n\011DATA[showtable][i+1,1] := per iods[i];\nod;\nfor j from 1 to numvar do\n\011DATA[showtable][1,j+1] : = varlist[j];\nod;\nfor j from 1 to numvar do\n\011for i from 1 to num per do\n\011\011DATA[showtable][i+1,j+1] := \n\011\011\011\011evalf(va rlist[j][firm,periods[i]], digits);\n\011od;\nod;\nDATA[showtable][1,1 ] := `Ñ`;\nDATA[text] := `TABLE: Periods and variables.`, ` Firm`=firm ;\nif member(pretty,\{args\}) then Pretty := true;\nelse Pretty := fal se; \nfi;\nTableDescr(Pretty);\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 43 "TableIndPerVar(varlist, periodlist, digits)" }}{PARA 0 " " 0 "" {TEXT -1 272 "TableIndPerVar(varlist,periodlist,digits)\n\011- \+ varlist is a list of variables to be tabulated\n\011- periodlist is a \+ list or a range of periods\n\011- periodlist can be either [2,4,6,8] o r 2..8\n\011- digits is the number of digits printed in numbers\n\011- 'pretty' is an optional argument" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 879 "NWT[TableIndPerVar] := proc(varlist,periodlist,digit s)\nglobal DATA,numvar,Pretty,periods,numper;\nlocal i,j;\noptions `DR UIDIC project. Revision 17 July 96`;\n\nDATA:= table();\nnumvar := nop s(varlist);\nif type(args[2],range) then\n\011periods := [seq(i, i = a rgs[2])];\nelif type(args[2],list) then\n\011periods := args[2];\nelse \n\011ERROR(`wrong definition of periods`);\nfi;\nnumper := nops(perio ds);\nDATA[showtable] := array(1..numper+1,1..numvar+1);\nfor i from 1 to numper do\n\011DATA[showtable][i+1,1] := periods[i];\nod;\nfor j f rom 1 to numvar do\n\011DATA[showtable][1,j+1] := varlist[j];\nod;\nfo r j from 1 to numvar do\n\011for i from 1 to numper do\n\011\011DATA[s howtable][i+1,j+1] := \n\011\011\011\011\011evalf(varlist[j][periods[i ]], digits);\n\011od;\nod;\nDATA[showtable][1,1] := `Ñ`;\nDATA[text] : = `TABLE: Industry variables`;\nif member(pretty,\{args\}) then Pretty := true;\nelse Pretty := false; \nfi;\nTableDescr(Pretty);\nend:" }}} }{SECT 0 {PARA 4 "" 0 "" {TEXT -1 44 "TablePerFirm(var, firms, periodl ist, digits)" }}{PARA 0 "" 0 "" {TEXT -1 333 "TablePerFirm(var,firms,p eriodlist,digits)\n\011- var is the firm to be included in the table\n \011- firms are the number of firms in the table, starting with #1\n \011- periodlist is a list or a range of periods\n\011- periodlist can be either [2,4,6,8] or 2..8\n\011- digits is the number of digits pri nted in numbers\n\011- 'pretty' is an optional argument" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 919 "NWT[TablePerFirm] := proc(var,firm s,periodlist,digits)\nglobal DATA,numvar,Pretty,periods,numper,firmlis t;\nlocal i,j;\noptions `DRUIDIC project. Revision 17 July 96`;\n\nDAT A := table();\nfirmlist := [seq(i, i = 1..firms)];\nif type(args[3],ra nge) then\n\011periods := [seq(i, i = args[3])];\nelif type(args[3],li st) then\n\011periods := args[3];\nelse\n\011ERROR(`wrong definition o f periods`);\nfi;\nnumper := nops(periods);\nDATA[showtable] := array( 1..numper+1,1..firms+1);\nfor i from 1 to numper do\n\011DATA[showtabl e][i+1,1] := periods[i];\nod;\nfor j from 1 to firms do\n\011DATA[show table][1,j+1] := firmlist[j];\nod;\nfor j from 1 to firms do\n\011for \+ i from 1 to numper do\n\011\011DATA[showtable][i+1,j+1] := \n\011\011 \011\011\011evalf(var[firmlist[j],periods[i]], digits);\n\011od;\nod; \nDATA[showtable][1,1] := `Ñ`;\nDATA[text] := `TABLE: Periods and Firm s.`, `Variable`=var;\nif member(pretty,\{args\}) then Pretty := true; \nelse Pretty := false; \nfi;\nTableDescr(Pretty);\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 42 "TablePerTask(Periods, Tasks, Firm, digits )" }}{PARA 0 "" 0 "" {TEXT -1 254 "TablePerTask(Periods,Tasks,Firm,dig its)\n\011- Periods is a list or a range of periods\n\011- Tasks is a \+ list or a range of task numbers\n\011- Firm is the firm to be dealt wi th\n\011- digits is the number of digits printed in numbers\n\011- 'pr etty' is an optional argument" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1046 "NWT[TablePerTask] := proc(Periods,Tasks,Firm,digits)\n\nglobal DATA,numtask,tasks,Pretty,periods,numper;\nlocal i,j;options `DRUIDIC project. Revision 17 July 96`;\n\nDATA := table();\nif type(Tasks,ran ge) then\n\011tasks := [seq(i, i=Tasks)];\nelif type(Tasks,list) then \n\011tasks := Tasks;\nelse\n\011ERROR(`wrong definition of tasks`);\n fi;\nnumtask := nops(tasks);\nif type(Periods,range) then\n\011periods := [seq(i, i=Periods)];\nelif type(Periods,list) then\n\011periods := Periods;\nelse\n\011ERROR(`wrong definition of periods`);\nfi;\nnumpe r := nops(periods);\nDATA[showtable] := array(1..numper+1,1..numtask+1 );\nfor i from 1 to numper do\n\011DATA[showtable][i+1,1] := periods[i ];\nod;\nfor j from 1 to numtask do\n\011DATA[showtable][1,j+1] := tas ks[j];\nod;\nfor j from 1 to numtask do\n\011for i from 1 to numper do \n\011\011DATA[showtable][i+1,j+1] := \n\011\011\011\011evalf(A[Firm,t asks[j],periods[i]], digits);\n\011od;\nod;\nDATA[showtable][1,1] := ` Ñ`;\nDATA[text] := `TABLE: Periods and Tasks.`, `Firm:`=Firm;\nif memb er(pretty,\{args\}) then Pretty := true;\nelse Pretty := false; \nfi; \nTableDescr(Pretty);\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 43 " TableFirmTask(Firms, Tasks, Period, digits)" }}{PARA 0 "" 0 "" {TEXT -1 254 "TableFirmTask(Firms,Tasks,Period,digits)\n\011- Firms is a lis t or a range of firms\n\011- Tasks is a list or a range of task number s\n\011- Period is the perod to be dealt with\n\011- digits is the num ber of digits printed in numbers\n\011- 'pretty' is an optional argume nt" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1073 "NWT[TableFirmTask] : = proc(Firms,Tasks,Period,digits)\nglobal DATA,numvar,firms,numfirm,ta sks,numtask,Pretty,periods,numper;\nlocal i,j;\noptions `DRUIDIC proje ct. Revision 17 July 96`;\n\nif type(args[1],range) then\n\011firms := [seq(i, i=args[1])];\nelif type(args[1],list) then\n\011firms := args [1];\nelse\n\011ERROR(`wrong definition of firms`);\nfi;\nnumfirm := n ops(firms);\nif type(args[2],range) then\n\011tasks := [seq(i, i=args[ 2])];\nelif type(args[3],list) then\n\011tasks := args[2];\nelse\n\011 ERROR(`wrong definition of tasks`);\nfi;\nnumtask := nops(tasks);\n\n \nDATA := table();\nDATA[showtable] := array(1..numfirm+1,1..numtask+1 );\nfor i from 1 to numfirm do\n\011DATA[showtable][i+1,1] := firms[i] ;\nod;\nfor j from 1 to numtask do\n\011DATA[showtable][1,j+1] := task s[j];\nod;\nfor i from 1 to numfirm do\n\011for j from 1 to numtask do \n\011\011DATA[showtable][i+1,j+1] :=\n\011\011\011\011evalf(A[firms[i ],tasks[j],Period], digits);\n\011od;\nod;\nDATA[showtable][1,1] := `Ñ `;\nDATA[text] := `TABLE: Firms and Tasks.`, `Period:`=Period;\nif mem ber(pretty,\{args\}) then Pretty := true;\nelse Pretty := false; \nfi; \nTableDescr(Pretty);\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 15 " drvt(var, j, T)" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1193 "NWT[drv t] := proc(var,j,T)\n\nglobal DATA,periods,Legend,aa,label,varmax,varm in,text,Pretty;\nlocal a, m, n, t;\noptions `DRUIDIC project. Revision 17 July 96`;\n\nDATA := table();\nperiods := seq(t, t = 1..T);\nLegen d := NULL;\nfor m from 1 to j do\n \011Legend := Legend, Task.j=colour s[j];\nod;\na:=NULL;\nfor m from 1 to j do\n\011label := 'TEXT'([T, va r[j,T]], f.n, 'ALIGNRIGHT');\n\011a := a,'CURVES'([seq(MergeLists([per iods[t]], \n\011\011\011\011[var[j,t]]),t=1..T)],colourlist[j]),label; \nod;\nvarmax := -10^6;\nvarmin := 10^6;\nfor m from 1 to j do\n\011fo r t from 1 to T do\n\011\011if varmin > var[j,t] then varmin := var[j, t]; fi;\n\011\011if varmax < var[j,t] then varmax := var[j,t]; fi;\n \011od;\nod;\nvarmin := varmin*.9;\nvarmax := varmax*1.1;\ntext := cat (`Variable `,var,` for `, j, ` task and `, T, ` periods.`);\nDATA[plot data] := 'PLOT'(a, 'TITLE'(text), 'VIEW'(1..T+1,varmin..varmax), 'AXES TICKS'(4,4));\nDATA[text] := cat(`FIGURE: `, j, ` task and `, T, ` per iods. `, `Variable = `, var);\nDATA[legend] := cat(`LEGEND..`, [Legend ]);\nif member(pretty,\{args\}) then Pretty := true \nelse Pretty := f alse; \nfi;\nif member (struct,\{args\}) then PlotDescr(Pretty,struct) ;\nelse PlotDescr(Pretty)\nfi;\nprint(DATA[legend]);\nplot(DATA[plotda ta]);\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 15 "drv2(var, N, T) " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1207 "NWT[drv2] := proc(var, N,T)\n\nglobal DATA,periods,Legend,aa,label,varmax,varmin, text,Pretty ;\nlocal t, a, m,n;\noptions `DRUIDIC project. Revision 17 July 96`;\n \nDATA := table();\nperiods := seq(t, t = 1..T);\nLegend := NULL;\nfor n from 1 to N do\n \011Legend := Legend, Firm.n=colours[n];\nod;\na:= NULL;\nfor n from 1 to N do\n\011label := 'TEXT'([T, var[n,1,T]], f.n, 'ALIGNRIGHT');\n\011a := a,'CURVES'([seq(MergeLists([periods[t]], \n \011\011\011\011[var[n,1,t]]),t=1..T)],colourlist[n]),label;\nod;\nvar max := -10^6;\nvarmin := 10^6;\nfor n from 1 to N do\n\011for t from 1 to T do\n\011\011if varmin > var[n,1,t] then varmin := var[n,1,t]; fi ;\n\011\011if varmax < var[n,1,t] then varmax := var[n,1,t]; fi;\n\011 od;\nod;\nvarmin := varmin*.9;\nvarmax := varmax*1.1;\ntext := cat(`Va riable `,var,` for `, N, ` firms and `, T, ` periods.`);\nDATA[plotdat a] := 'PLOT'(a, 'TITLE'(text), 'VIEW'(1..T+1,varmin..varmax), 'AXESTIC KS'(4,4));\nDATA[text] := cat(`FIGURE: `, N, ` firms and `, T, ` perio ds. `, `Variable = `, var);\nDATA[legend] := cat(`LEGEND..`, [Legend]) ;\nif member(pretty,\{args\}) then Pretty := true \nelse Pretty := fal se; \nfi;\nif member (struct,\{args\}) then PlotDescr(Pretty,struct); \nelse PlotDescr(Pretty)\nfi;\nprint(DATA[legend]);\nplot(DATA[plotdat a]);\nend:" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 15 "drv3(var, N, T)" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1214 "NWT[drv3] := proc(var,N, T)\n\nglobal DATA,periods,Legend,aa,label,varmax,varmin,text,Pretty;\n local n,t;\noptions untrace, `DRUIDIC project. Revision 17 July 96`;\n \nDATA := table();\nperiods := seq(t, t = 1..T);\nLegend := NULL;\nfor n from 1 to N do\n \011Legend := Legend, Firm.n=colours[n];\nod;\naa: =NULL;\nfor n from 1 to N do\n\011label := 'TEXT'([T, var[n,4,T]], f.n , 'ALIGNRIGHT');\n\011aa := aa,'CURVES'([seq(MergeLists([periods[t]], \+ \n\011\011\011\011[var[n,4,t]]),t=1..T)],colourlist[n]),label;\nod;\nv armax := -10^6;\nvarmin := 10^6;\nfor n from 1 to N do\n\011for t from 1 to T do\n\011\011if varmin > var[n,4,t] then varmin := var[n,4,t]; \+ fi;\n\011\011if varmax < var[n,4,t] then varmax := var[n,4,t]; fi;\n \011od;\nod;\nvarmin := varmin*.9;\nvarmax := varmax*1.1;\ntext := cat (`Variable `,var,` for `, N, ` firms and `, T, ` periods.`);\nDATA[plo tdata] := 'PLOT'(aa, 'TITLE'(text), 'VIEW'(1..T+1,varmin..varmax), 'AX ESTICKS'(4,4));\nDATA[text] := cat(`FIGURE: `, N, ` firms and `, T, ` \+ periods. `, `Variable = `, var);\nDATA[legend] := cat(`LEGEND..`, [Leg end]);\nif member(pretty,\{args\}) then Pretty := true \nelse Pretty : = false; \nfi;\nif member (struct,\{args\}) then PlotDescr(Pretty,stru ct);\nelse PlotDescr(Pretty)\nfi;\nprint(DATA[legend]);\nplot(DATA[plo tdata]);\nend:\n" }}}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 33 "Saving and using the Nelwin tools" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 104 "First \+ we save the package after ALL the above functions has been defined in \+ the Maple engine by ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "save NWT, `NWT.m`;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 347 "Now \+ the package is (probably) saved in the Maple V.4 directory. Move the f ile to the Maple lib directory. Now the file is ready for loading as a package (if the package is not in the Maple lib directory, then you n eed a read command before the with command. When it has been loaded co rrectly, you will see a list of all the names of the functions." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "restart; with(NWT);" }} {PARA 12 "" 1 "" {XPPMATH 20 "6#73%*DataNotesG%+DrawIndVarG%,DrawScatt erG%-DrawVariableG%'LegendG%+MergeListsG%*PlotDescrG%+TableDescrG%.Tab leFirmTaskG%-TableFirmVarG%/TableIndPerVarG%-TablePerFirmG%-TablePerTa skG%,TablePerVarG%%drv2G%%drv3G%%drvtG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "In the future you write with(NWT); whenever you need the \+ Nelwin tools." }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "2 1 0 0" 1 }{VIEWOPTS 1 1 0 1 1 1803 }