File tree 1 file changed +11
-19
lines changed
1 file changed +11
-19
lines changed Original file line number Diff line number Diff line change 6
6
methods
7
7
function obj = Canonical(varargin )
8
8
p = inputParser ;
9
- p .addParameter(' Size' , 32 , @ isscalar );
9
+ p .addParameter(' Size' , 32 );
10
10
p .addParameter(' epsilon' , 1e-4 );
11
11
p .addParameter(' sigma' , 1 / 144 );
12
-
13
12
p .parse(varargin{: });
14
-
15
- s = p .Results ;
16
-
17
- n = s .Size ;
13
+ opts = p .Results ;
18
14
19
15
params = otp .cusp .CUSPParameters ;
20
- params.Size = n ;
21
- params.Epsilon = s .epsilon ;
22
- params.Sigma = s .sigma ;
23
-
24
- xs = linspace(0 , 1 , n + 1 )' ;
25
-
26
- % The last point is the same as the first, so we will ignore it.
27
- xs = xs(1 : (end - 1 ));
28
-
29
- y0 = zeros(n , 1 );
30
- a0 = - 2 * cos(2 * pi * xs );
31
- b0 = - 2 * cos(2 * pi * xs );
16
+ params.Size = opts .Size ;
17
+ params.Epsilon = opts .epsilon ;
18
+ params.Sigma = opts .sigma ;
19
+
20
+ ang = 2 * pi / opts .Size * (1 : opts .Size ).' ;
21
+ y0 = zeros(opts .Size , 1 );
22
+ a0 = - 2 * cos(ang );
23
+ b0 = 2 * sin(ang );
32
24
33
25
u0 = [y0 ; a0 ; b0 ];
34
- tspan = [0 1.1 ];
26
+ tspan = [0 ; 1.1 ];
35
27
36
28
obj
= [email protected] (
tspan ,
u0 ,
params );
37
29
end
You can’t perform that action at this time.
0 commit comments