File: fixed.tk

package info (click to toggle)
dstooltk 2.0-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,520 kB
  • ctags: 3,169
  • sloc: ansic: 27,185; tcl: 4,770; makefile: 588; sh: 81; csh: 7
file content (141 lines) | stat: -rw-r--r-- 3,665 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#
# fixed.tk
#

proc fixed(build) name {
    global Fixed Model

    build_Title $name "Fixed Points"

    build_DismissButtonbar $name dbbar "window(dismiss) fixed" \
	{"Clear points" fixed(clear_points) } \
	{"Clear manifolds" fixed(clear_mans) }

#    build_Buttonbar $name bb0 \
	{"Find fixed points" fixed(find_fixpts)} \
	{"Compute 1-d manifolds" fixed(1dman) } \
	{"2-D manifolds..." {window(open) man2d}}

    build_Buttonbar $name bb0 \
	{"Find fixed points" fixed(find_fixpts)} \
	{"Compute 1-d manifolds" fixed(1dman) }

    pack $name.bb0 -side bottom

    set cmd [build_CmdFrame $name cmd]

    build_PopupMenu $cmd p1 "Fixed point algorithm:" \
	Fixed(Algorithm) fixed(leave) {"Newton" "Secant"}

    build_PopupMenu $cmd p2 "Seed algorithm:" \
	Fixed(Guess) fixed(leave) {"Monte Carlo" "Selected Point"}

    if {$Model(Mapping_Flag)} {
	build_LabelEntryColumns $cmd le0 \
	    {text {} {"Monte Carlo points:" "Period:"}} \
	    {ientry {} {Fixed(Mc_Guesses) Fixed(Map_Period)}} \
	    {text {} {"Found:"}} \
	    {ilabel {} {Fixed(Found)}}
    } else {
	build_LabelEntryColumns $cmd le0 \
	    {text {} {"Monte Carlo points:"}} \
	    {ientry {} {Fixed(Mc_Guesses)}} \
	    {text {} {"Found:"}} \
	    {ilabel {} {Fixed(Found)}}
    }
    bind_LabelEntryColumns $cmd.le0 1 <Return> fixed(update)

    build_LabelEntryColumns $cmd le1 \
	{text {Fixed point algorithm parameters} \
	     {"maximum iterations:"}} \
	{ientry " " {Fixed(Num_Iters)}}
    bind_LabelEntryColumns $cmd.le1 1 <Return> fixed(update)

    build_LabelEntryColumns $cmd le2 \
	{text {} {"     convergence criterion:" "     minimum step:" \
		      "     duplicate criterion:" "     finite difference step:"} } \
	{dentry {} {Fixed(Funct_Conv) Fixed(Var_Conv) \
			Fixed(Dups) Fixed(FD_Step)} }
    bind_LabelEntryColumns $cmd.le2 1 <Return> fixed(update)

    build_LabelEntryColumns $cmd le3 \
	{text {One-D manifold algorithm parameters} \
	     {"stable manifold steps:" "points:" \
		  "unstable manifold steps:" "points:"} } \
	{ientry " " {Fixed(Stab_Steps) Fixed(Stab_Points) \
			 Fixed(Unstab_Steps) Fixed(Unstab_Points)} }
    bind_LabelEntryColumns $cmd.le3 1 <Return> fixed(update)

    build_LabelEntryColumns $cmd le4 \
	{text {} {"             initial stepsize"}} {dentry {} {Fixed(Eigen_Dist)}}
    bind_LabelEntryColumns $cmd.le4 1 <Return> fixed(update)

    pack $cmd -fill both -expand 1

}

proc fixed(enter) {} {
    pm_to_tcl Fixed
}

proc fixed(leave) {} {
    fixed(update)
}

proc fixed(update) {} {
    tcl_to_pm Fixed
    pm_to_tcl Fixed
}

proc fixed(find_fixpts) {} {
    global Fixed

    begin_wait "Finding fixed points..."
    fixed(update)
    set n $Fixed(Found)
    pm EXEC Fixed.Find_Fixpts
    pm_to_tcl Fixed Memory
    set nf $Fixed(Found)
    if {$nf > $n} {
	end_wait "Found [expr $nf-$n] new fixed points."
    } else {
	end_wait "Found no new fixed points."
    }
}

proc fixed(1dman) {} {
    begin_wait "Computing 1-d manifolds..."
    tcl_to_pm Fixed
    pm_to_tcl Fixed
    pm EXEC Fixed.1dman
    pm_to_tcl Fixed Memory
    end_wait
}

proc fixed(clear_points) {} {
    global Defaults

    begin_wait "Clearing fixed points..."
    tcl_to_pm Fixed
    pm EXEC Fixed.Clear_Points
    pm_to_tcl Fixed Memory
    if {$Defaults(Auto_Refresh) == 1} {
	oneD(refresh_all)
	twoD(refresh_all)
    }
    end_wait "Fixed points cleared."
}

proc fixed(clear_mans) {} {
    global Defaults
    
    begin_wait "Clearing 1-d manifolds..."
    tcl_to_pm Fixed
    pm EXEC Fixed.Clear_Mans
    pm_to_tcl Fixed Memory
    if {$Defaults(Auto_Refresh) == 1} {
	oneD(refresh_all)
	twoD(refresh_all)
    }
    end_wait "1-d manifolds cleared."
}