-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexample_multiply_u2.m
86 lines (85 loc) · 2.8 KB
/
example_multiply_u2.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
% example_multiply_u3.m
% Nasser, September 6, 2019
% In this code, we consider:
% unbounded multiply connected domain G of connectivity 2
%
%
clc
clear all
%
% The vertices of the polygons (the vertices must be clockwise oriented)
ver{1}=[ 1.5+1.0i ; 1.5+0.0i ; 0.5+0.0i ; 0.5+1.0i];
ver{2}=[-0.5+1.0i ; -1.5+0.0i ;-1.5+1.0i];
% The domain G is unbounded. So, we choose alpha=inf.
alpha = inf;
%%
tic
% f=plgcirmap(ver,alpha);% f is the conformal mapping from the domain G
% onto the circular domain D with the
% normalization f(z)=z+O(1/z) near infinity
f=plgcirmap(ver,alpha,ver{end}(end));% f is the conformal mapping from
% the domain G onto the circular domain D with the
% normalization: f(inf)=inf, cent(m)=0, rad(m)=1,
% and f(ver{end}(end))=1
toc
%%
plotmap(f); % to plot the domain G and the circular domain D
plotmap(f,'v','plr',21,21); % to plot polar grids in the circular domain
% D and their images in the domain G under
% the invers map
plotmap(f,'v','rec',21,21); % to plot rectangular grids in the circular
% domain D and their images in the domain G
% under the invers map
plotmap(f,'d','rec',21,21); % to plot rectangular grids in the domain
% G and their images in the circular domain
% D under the conformal map
plotmap(f,'d','plr',21,21); % to plot polar grids in the domain
% G and their images in the circular domain
% D under the conformal map
%%
%%
% Checking the accuracy of the toolbox PlgCirMap:
%
% we choose test points: ztest in the domain G
ttest = linspace(0,2*pi,1000);
ztest = 2.*exp(i.*ttest);
% We compute the images of the test points ztest under the conformal map
% from G onto D
wtest = evalu(f,ztest,'d');
% We compute the values of f^-1(f(zztest))
ztest2 = evalu(f,wtest,'v');
% We compute the maximum norm of the different between the test points
% ztest and ztest2
error_norm = norm(ztest-ztest2,inf)
Error = abs(ztest-ztest2);
%
nv = f.nv;
et = f.et;
zet = f.zet;
imgver = f.imgver;
m = length(ver);
%
figure;
hold on
box on
axis equal
for k=1:m
crv=et(1+sum(nv(1:k-1)):sum(nv(1:k)),1);
plot(real(crv),imag(crv),'-k','LineWidth',2);
end
plot(real(ztest),imag(ztest),'.b')
%
figure;
hold on
box on
axis equal
for k=1:m
crv=zet(1+sum(nv(1:k-1)):sum(nv(1:k)),1);
plot(real(crv),imag(crv),'-k','LineWidth',2);
end
plot(real(wtest),imag(wtest),'.b')
%
figure
semilogy(ttest,Error,'b','LineWidth',1);
grid on
%%