-
Notifications
You must be signed in to change notification settings - Fork 0
/
GCHEB_POINTS.m
53 lines (47 loc) · 1.62 KB
/
GCHEB_POINTS.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
function [s,t,W] = GCHEB_POINTS(N,cas)
%GCHEB_POINTS Gauss Chebyshev collocation and integration points.
% [s,t,W] = GCHEB_POINTS(N,cas) gives the GAUSS CHEBYSHEV collocation s,
% integration t points and weights W for solving an SIE.
%
% The variable 'cas' denotes the case for the weight function behaviour
% w(s)=(1-s)^alpha*(1+s)^beta:
%
% Case | Behaviour at -1 | Behaviour at +1
% ----------------------------------------
% 1 (I) | Singular | Singular
% 2 (II) | Singular | Bounded
% 3 (III)| Bounded | Singular
% 4 (IV) | Bounded | Bounded
%
%
% University of Oxford
% Department of Engineering Science
% Jhonatan Da Ponte Lopes, PhD
% Feb, 2019; Last revision: 2019-02-12
%-------------------------------------------------------------------
% CASE DEFINITION
%-------------------------------------------------------------------
auxi=1:N;
switch cas
case 1 % Singular/Singular
s=cos(pi.*(2.*auxi-1)./(2.*N));
auxk=1:N-1;
t=cos(pi.*auxk./N);
W=1./N.*ones(1,N);
case 2 % Singular/Bounded
s=cos(pi.*(2.*auxi)./(2.*N+1));
auxk=1:N;
t=cos(pi.*(2.*auxk-1)./(2.*N+1));
W=2.*(1-s)./(2.*N+1);
case 3 % Bounded/Singular
s=cos(pi.*(2.*auxi-1)./(2.*N+1));
auxk=1:N;
t=cos(pi.*(2.*auxk)./(2.*N+1));
W=2.*(1+s)./(2.*N+1);
case 4 % Bounded/Bounded
s=cos(pi.*(auxi)./(N+1));
auxk=1:N+1;
t=cos(pi.*(2.*auxk-1)./(2.*N+2));
W=(1-s.^2)./(N+1);
end
end