File tree Expand file tree Collapse file tree 1 file changed +11
-19
lines changed
Expand file tree Collapse file tree 1 file changed +11
-19
lines changed Original file line number Diff line number Diff line change 66 methods
77 function obj = Canonical(varargin )
88 p = inputParser ;
9- p .addParameter(' Size' , 32 , @ isscalar );
9+ p .addParameter(' Size' , 32 );
1010 p .addParameter(' epsilon' , 1e-4 );
1111 p .addParameter(' sigma' , 1 / 144 );
12-
1312 p .parse(varargin{: });
14-
15- s = p .Results ;
16-
17- n = s .Size ;
13+ opts = p .Results ;
1814
1915 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 );
3224
3325 u0 = [y0 ; a0 ; b0 ];
34- tspan = [0 1.1 ];
26+ tspan = [0 ; 1.1 ];
3527
3628 obj = obj@otp.cusp.CUSPProblem(tspan , u0 , params );
3729 end
You can’t perform that action at this time.
0 commit comments