-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathscdlong.m
200 lines (174 loc) · 6.03 KB
/
scdlong.m
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
function slide=scdlong
% This is a slideshow file for use with playshow.m and makeshow.m
% To see it run, type 'playshow scdlong',
% Copyright (c) 1984-98 by The MathWorks, Inc.
% $Id: scdlong.m 298 2009-09-15 14:36:37Z driscoll $
if nargout<1,
playshow scdlong
else
%========== Slide 1 ==========
slide(1).code={
'' };
slide(1).text={
'Press "Start" to see a demonstration of mapping to elongated regions.'};
%========== Slide 2 ==========
slide(2).code={
'p = polygon([ 2.0000 + 3.0000i',
' -3.0000 + 3.0000i',
' -3.0000 - 3.0000i',
' -2.0000 - 2.0000i',
' -2.0000 + 2.0000i',
' 2.0000 + 2.0000i ]);',
'plot(p)',
'f=diskmap(p,sctool.scmapopt(''tol'',1e-6,''trace'',''on''));',
'',
'',
'' };
slide(2).text={
'Here is a mildly elongated region.',
'>> plot(p)',
'',
'We find its SC disk map.',
'>> f = diskmap(p);'};
%========== Slide 3 ==========
slide(3).code={
'z=prevertex(f);',
'plot(exp(i*linspace(0,2*pi)),''b'')',
'hold on',
'plot(z,''ro'',''markerfacecolor'',''r'',''markersize'',5)',
'axis equal',
'axis(1.07*[-1 1 -1 1])',
'title prevertices',
'hold off' };
slide(3).text={
'There are six prevertices, but two pair are quite close together.',
'>> z = prevertex(f); plot(z,''ro'')',
'>> angle( z([4 1])./z([3 6] )',
'ans =',
' 4.8136e-006',
' 1.1612e-005',
'',
'This is the *crowding phenonenon*. The prevertices are separated by an amount which is exponential in the effective aspect ratio of the region.'};
%========== Slide 4 ==========
slide(4).code={
'' };
slide(4).text={
'The crowding phenomenon not only makes solution of the parameter problem difficult, but if a region locally has an aspect ratio larger than, say, 20, the prevertices may not even be distinguishable in double precision (MATLAB''s default).'};
%========== Slide 5 ==========
slide(5).code={
'cla',
'f=rectmap(p,[1 3 4 6],sctool.scmapopt(''tol'',1e-6));',
'plot(f,4,8)',
'title(''Map from rectangle'')' };
slide(5).text={
'An elegant solution to crowding is to use a canonical domain that is also elongated. Here, we compute the map to a rectangle. We have to specify which polygon vertices map to rectangle corners.',
'>> f = rectmap(p,[1 3 4 6]);',
'>> plot(f,4,8)',
'',
''};
%========== Slide 6 ==========
slide(6).code={
'' };
slide(6).text={
'The aspect ratio of the rectangle is known as the *conformal modulus*. It is determined by the geometry, and would be different for different choices of the rectangle corner images.',
'',
'>> modulus(f)',
'ans =',
' 8.8381',
''};
%========== Slide 7 ==========
slide(7).code={
'f=stripmap(p,[3 6],sctool.scmapopt(''tol'',1e-6));',
'plot(f,8,4)',
'title(''Map from strip'')' };
slide(7).text={
'Another elongated canonical domain is the strip {0 < Im z< 1}. This is especially useful for maps to infinite flow channels, but we can apply it here, too.',
'>> f = stripmap(p,[3 6]);',
'>> plot(f,8,4)',
'',
'Here we chose the vertices that map to the "ends" of the strip at plus/minus infinity.'};
%========== Slide 8 ==========
slide(8).code={
'p = polygon([ -0.5000 - 2.5000i',
' 0.5000 - 2.5000i',
' 0.5000 + 1.0000i',
' 3.0000 + 2.5000i',
' 2.5000 + 3.0000i',
' 0 + 1.5000i',
' -1.5000 + 3.5000i',
' -2.0000 + 3.0000i',
' -0.5000 + 1.0000i',
' ]);',
'plot(p)' };
slide(8).text={
'Both the rectangle and the strip have just one primary elongation. For regions which are multiply elongated, such as this Y, crowding again occurs.'};
%========== Slide 9 ==========
slide(9).code={
'f=rectmap(p,[2 4 5 1],sctool.scmapopt(''tol'',1e-4));',
'plot(f,4,6)' };
slide(9).text={
'>> f = rectmap(p,[2 4 5 1]);',
'>> min(abs(diff(prevertex(f))))',
'',
'ans =',
' 3.1196e-006',
'',
'No matter how one chooses two arms to match the elongation of the rectangle, the remaining arm causes crowding.'};
%========== Slide 10 ==========
slide(10).code={
'f=crdiskmap(p,sctool.scmapopt(''tol'',1e-4));',
'f=center(f,i);',
'plot(f)',
'' };
slide(10).text={
'An algorithm known as CRDT uses a representation of the prevertices that is not affected by crowding. Using it, one can map to arbitrarily elongated regions from the disk.',
'>> f = crdiskmap(p);',
'>> f = center(f,i);',
'>> plot(f)',
'',
'As you can see, much of the polygon maps to a tiny portion of the disk. This is the hallmark of crowding.'};
%========== Slide 11 ==========
slide(11).code={
'' };
slide(11).text={
'As the disk may not be a useful canonical domain for many problems, an alternative is offered. We can "rectify" the polygon by making each of its angles be an integer multiple of pi/2. Such a rectified polygon has each side parallel to one of the cartesian axes.',
'',
'This is accomplished by using the disk as an intermediate domain and constructing two S--C maps: the usual one, and another one with the same prevertices and rectified angles.',
''};
%========== Slide 12 ==========
slide(12).code={
'alpha = [ 0.5000',
' 0.5000',
' 1.0000',
' 1.0000',
' 1.5000',
' 1.0000',
' 1.0000',
' 0.5000',
' 0.5000',
' 1.0000',
' 1.0000',
' 1.0000',
' 0.5000',
' 0.5000',
' 1.5000',
' 1.0000',
' 1.0000];',
'f = crrectmap(f,alpha);',
'plot(rectpoly(f))',
'' };
slide(12).text={
'Here we map the previous polygon to a "T" (it''s suited to that). The angles in alpha were predetermined.',
'>> f = crrectmap(f,alpha);',
'',
'Here''s a plot of the target T.',
'>> plot(rectpoly(f))',
'',
'The side lengths are not freely chosen; rather, they result from the prevertices of the disk map. This is a generalization of conformal modulus.'};
%========== Slide 13 ==========
slide(13).code={
'plot(f,18,12)' };
slide(13).text={
'We now plot the images of vertical and horizontal lines inside the T.',
'>> plot(f,18,12)'};
end