Debian Codegraph @

07p/demos/python/plotter.auto

raw
1 # This script is a demonstration of some of the plotting
2 # capabilities of AUTO 2000
3
4 # We create a sub directory
5 ! rm -rf test
6 ! mkdir test
7 # and go into it
8 cd test
9 # We clean it up (in case it happen to exist previously)
10 ! rm -f *
11 # and copy the 'ab' into the current directory. This command
12 # also loads the c.ab and ab.c files into the AUTO command
13 # line user interface.
14 dm("ab")
15 # We now run the demo using the constants file 'c.ab.1'
16 run(c="ab.1")
17 # and save the resulting bifurcation diagram in the file 'b.ab',
18 # the resulting solution in the file 's.ab', and the resulting
19 # diagnostic file in 'd.ab'.
20 sv("ab")
21 # We run AUTO again, this time using the 'c.ab.2' constants file
22 # and the previously saved solution file 's.ab' as starting data.
23 run(c="ab.2",s="ab")
24 # This command plots the bifurcation diagram and solution contained
25 # in the files 'b.ab' and 's.ab'
26 plot1=pl("ab")
27 # This command plots the bifurcation diagram and solution contained
28 # in the files 'fort.7' and 'fort.8'
29 plot2=pl()
30 # Wait for the user to hit a key before proceeding.
31 wait()
32 # We change the background color of plot1 to black and the
33 # foreground color to white. 'color_list" is the list of
34 # colors used for the actual plot.
35 plot1.config(bg="black",fg="white",color_list="white")
36 # We plot solution with label number 2 instead of the bifurcation diagram
37 # in plot2.
38 plot2.config(type="solution",label=[2])
39 wait()
40 # These two commands put explicit bounds on the plotting
41 # bounds, instead of having them computed automatically
42 # from the data.
43 plot1.config(miny=1.5,maxy=3.4)
44 plot2.config(minx=0.8,maxx=0.9)
45 wait()
46 # This command plots column 0 vs column 3 in plot1
47 # instead of the default column 0 vs column 1
48 plot1.config(bifurcation_x=(0,),bifurcation_y=(3,))
49 # This command plots the value of the independent
50 # variable 'time' vs column 0 in plot2
51 plot2.config(solution_x=("time",),solution_y=(0,))
52 wait()
53 # This command changes the row and column labels
54 plot1.config(xlabel="Randy is cool",ylabel="Sebius is cool")
55 plot2.config(index=[1])
56 wait()
57 # This command goes back to the default plot of column 0 vs column 1 in plot1
58 plot1.config(bifurcation_x=(0,),bifurcation_y=(1,))
59 # This command creates two plots in plot2.
60 # The first is the independent variable 't' vs column 0 and the second
61 # is the independent variable 't' vs column 1
62 plot2.config(solution_x=("time","time"),solution_y=(0,1))
63 wait()
64 # This command places a marker at all the places where
65 # the independent variable 'time' have value 0.1.
66 plot2.config(mark_t=0.1)
67 wait()
68 # We now try to use the three dimensional plotting capabilities
69 # AUTO2000. NOTE: These commands will only work if
70 # three dimensional plotting has been enabled, and this
71 # is NOT done by default.
72 ##plot1=p3("ab")
73 ##plot2=p3()
74 ##wait()
75 ##plot1.config()
76 ##plot2.config(type="solution",label=[6])
77 ##wait()
78 # This command is different from the two dimensional case in that
79 # Z and color components can also be chosen.
80 ##plot1.config(bifurcation_x=[0],bifurcation_y=[1],bifurcation_z=[2],bifurcation_color=[3])
81 ##plot2.config(solution_x=["t"],solution_y=[0])
82 ##wait()
83 ##plot2.config(index=[4])
84 ##wait()
85 # Similarity to the previous command, these commands differ
86 # from the two dimensional case in that
87 # Z and color components can also be chosen.
88 ##plot1.config(bifurcation_x=(0,2),bifurcation_y=(1,3),bifurcation_z=(3,3),bifurcation_color=(0,0))
89 ##plot2.config(solution_x=("t","t"),solution_y=(0,1),solution_z=(0,1),solution_color=(0,1))
90 ##wait()
91 ##plot2.config(mark_t=0.1)
92 ##wait()
93
94
95