150
11 Elliptic Integrals
Figure (11.1) was plotted with visuRJ.m:
x = linspace(-1,1,30); % complex p-value (avoiding "0")
[X,Y] = meshgrid(x,x);
%
px = 0.75 * X;
py = 0.75 * Y;
p = px + i * py; %#ok
% additional input arguments for RJ(xr,yr,zr, p)
xr = 0.5; yr = 0.75; zr = pi;
for k= 1:numel(p)
% evaluation
rj(k) = ellipInt(’RJ’, xr, yr, zr, p(k)).value;
end
rj = reshape(rj, size(px));% reshape for visualisation
%
figure
% visulatization
surface(px,py,abs(rj),angle(rj)), shg, hold on
xlabel(’real(p)’), ylabel(’imag(p)’), colorbar
view(-70,40), axis tight
figure, surface(px,py,abs(rj),angle(rj)), shg, hold on
xlabel(’real(p)’), ylabel(’imag(p)’)
The Function ellipIntQuadtest
The function res = ellipIntQuadtest(whichEI,x,y,z,p) serves for
test purposes and uses the MATLAB function integral for evaluation. The input
variable “whichEI” could have the values “RC” (RC(x, y)), “RF” (RF (x, y, z)),
“RJ” (RJ (x, y, z, p), and “RD” (RD(x, y, z)) for Carlson’s elliptic integrals; “F”
(F (φ, k)), “E” (E(phi, k)), and “PI” (Π(φ, n, k)) for the elliptic integrals of first,
second, and third kind in Legendre form. The input variables “x,y,z,p” are the input
variables in dependence of the selected integral as listed above. The corresponding
integral value is “res.” Because this function is only for test purposes, the input
arguments are not tested.
Example
win = linspace(-pi,pi); % input data
phi = pi/4 + 0.1 * i; % pi/4;
k = 1.25 * exp(i * win); % 0.75 * exp(i * win);
%%
for n = 1:length(k)
% evaluation ellipIntQuadtest
res(n) = ellipIntQuadtest(’E’, phi, k(n));
end
%%
for n = 1:length(k)
% ellipInt for comparison
resvalue(n) = ellipInt(’E’, phi, k(n)).value;
end
%%
dres = abs(res-resvalue)./abs(res);
max(dres)
% output maximum deviation
plot(win,dres)
%%
11 Elliptic Integrals
Figure (11.1) was plotted with visuRJ.m:
x = linspace(-1,1,30); % complex p-value (avoiding "0")
[X,Y] = meshgrid(x,x);
%
px = 0.75 * X;
py = 0.75 * Y;
p = px + i * py; %#ok
% additional input arguments for RJ(xr,yr,zr, p)
xr = 0.5; yr = 0.75; zr = pi;
for k= 1:numel(p)
% evaluation
rj(k) = ellipInt(’RJ’, xr, yr, zr, p(k)).value;
end
rj = reshape(rj, size(px));% reshape for visualisation
%
figure
% visulatization
surface(px,py,abs(rj),angle(rj)), shg, hold on
xlabel(’real(p)’), ylabel(’imag(p)’), colorbar
view(-70,40), axis tight
figure, surface(px,py,abs(rj),angle(rj)), shg, hold on
xlabel(’real(p)’), ylabel(’imag(p)’)
The Function ellipIntQuadtest
The function res = ellipIntQuadtest(whichEI,x,y,z,p) serves for
test purposes and uses the MATLAB function integral for evaluation. The input
variable “whichEI” could have the values “RC” (RC(x, y)), “RF” (RF (x, y, z)),
“RJ” (RJ (x, y, z, p), and “RD” (RD(x, y, z)) for Carlson’s elliptic integrals; “F”
(F (φ, k)), “E” (E(phi, k)), and “PI” (Π(φ, n, k)) for the elliptic integrals of first,
second, and third kind in Legendre form. The input variables “x,y,z,p” are the input
variables in dependence of the selected integral as listed above. The corresponding
integral value is “res.” Because this function is only for test purposes, the input
arguments are not tested.
Example
win = linspace(-pi,pi); % input data
phi = pi/4 + 0.1 * i; % pi/4;
k = 1.25 * exp(i * win); % 0.75 * exp(i * win);
%%
for n = 1:length(k)
% evaluation ellipIntQuadtest
res(n) = ellipIntQuadtest(’E’, phi, k(n));
end
%%
for n = 1:length(k)
% ellipInt for comparison
resvalue(n) = ellipInt(’E’, phi, k(n)).value;
end
%%
dres = abs(res-resvalue)./abs(res);
max(dres)
% output maximum deviation
plot(win,dres)
%%
