14.3 Programs
177
>> plot(objdse.z, sedse), grid on , shg% visualization
% if you want to test the result:
>> obj = mathieuFun(’se’, n, q, objdse.z, ’eigen’, 2);
>> hold on, plot(obj.z, obj.value(2,:),’--’), shg
Eigensolution “eiga” and “eigb”
The syntax is, e.g., obj = mathieuFun(’eiga’, n, q). All even or odd
eigenvalues and eigenvectors up to n will be computed. “n” has to be a positive
integer. “eiga” stands for the positive parity solutions and “eigb” for the negative
parity solutions.
14.3.2 Additional SPECFUNPHYS Functions
Evaluation of Eigenvalues and Eigenvectors
The eigenvalues of the integer periodic Mathieu functions can be computed either
with the class mathieuFun or with the SPECFUNPHYS functions eiga and
eigb. The evaluation is based on the MATLAB function eigs. The functions
eiga and eigb allow in addition to evaluate all eigenvalues of definite parity. The
syntax for both is equal, and thus as an example, the syntax for eiga is shown. The
syntax is [a, v] = eiga(n, q) or a= eiga(n, q, ’all’). The input
argument “n” is the maximum number of the eigenvalue. In the first case, all even
or odd eigenvalues and eigenvectors up to n will be computed and with the qualifier
“all” all eigenvalues from 0 to n.
Example: Fig. 14.1 was plotted with the following code (eigenvaluevisu.m):
q = linspace(0,10); % q-parameter of the differential
q = q(:);
% equation
a = [];
% array for eigenvalues a_n
for k = 1:length(q)
ak = eiga(4,q(k),’all’);
a = [a,ak];
end
%%
b = [];
% array for eigenvalues b_n
for k = 1:length(q)
bk = eigb(4,q(k),’all’);
b = [b,bk]; %#ok< * AGROW>
end
%%
figure, hold on
% visualization
plot(q,a)
plot(q,b), shg
legend(’a(0)’, ’a(1)’, ’a(2)’, ’a(3)’, ’a(4)’, ...
’b(1)’, ’b(2)’, ’b(3)’, ’b(4)’), shg
Précédent

- 185/287

Suivant