comparison +time/SBPInTimeSecondOrderFormImplicit.m @ 1113:47e86b5270ad feature/timesteppers

Change name of property k to dt in time.Timestepper
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 10 Apr 2019 22:40:55 +0200
parents f5e14e5986b5
children
comparison
equal deleted inserted replaced
1112:835c8fa456ec 1113:47e86b5270ad
3 A, B, C, f 3 A, B, C, f
4 AA, BB, ff 4 AA, BB, ff
5 5
6 n 6 n
7 t 7 t
8 k 8 dt
9 9
10 firstOrderTimeStepper 10 firstOrderTimeStepper
11 end 11 end
12 12
13 methods 13 methods
14 % Solves A*u_tt + B*u_t + C*u = f(t) 14 % Solves A*u_tt + B*u_t + C*u = f(t)
15 % A, B can either both be constants or both be function handles, 15 % A, B can either both be constants or both be function handles,
16 % They can also be omitted by setting them equal to the empty matrix. 16 % They can also be omitted by setting them equal to the empty matrix.
17 function obj = SBPInTimeSecondOrderFormImplicit(A, B, C, f, k, t0, v0, v0t, do_scaling, TYPE, order, blockSize) 17 function obj = SBPInTimeSecondOrderFormImplicit(A, B, C, f, dt, t0, v0, v0t, do_scaling, TYPE, order, blockSize)
18 default_arg('f', []); 18 default_arg('f', []);
19 default_arg('TYPE', []); 19 default_arg('TYPE', []);
20 default_arg('order', []); 20 default_arg('order', []);
21 default_arg('blockSize',[]); 21 default_arg('blockSize',[]);
22 default_arg('do_scaling', false); 22 default_arg('do_scaling', false);
51 obj.ff = @(t) sparse(2*m,1); 51 obj.ff = @(t) sparse(2*m,1);
52 end 52 end
53 53
54 w0 = [v0; v0t]; 54 w0 = [v0; v0t];
55 55
56 obj.k = k; 56 obj.dt = dt;
57 obj.t = t0; 57 obj.t = t0;
58 obj.n = 0; 58 obj.n = 0;
59 59
60 if do_scaling 60 if do_scaling
61 scaling = [ones(m,1); sqrt(diag(C))]; 61 scaling = [ones(m,1); sqrt(diag(C))];
62 obj.firstOrderTimeStepper = time.SBPInTimeScaled(obj.AA, obj.BB, obj.ff, obj.k, obj.t, w0, scaling, TYPE, order, blockSize); 62 obj.firstOrderTimeStepper = time.SBPInTimeScaled(obj.AA, obj.BB, obj.ff, obj.dt, obj.t, w0, scaling, TYPE, order, blockSize);
63 else 63 else
64 obj.firstOrderTimeStepper = time.SBPInTimeImplicitFormulation(obj.AA, obj.BB, obj.ff, obj.k, obj.t, w0, TYPE, order, blockSize); 64 obj.firstOrderTimeStepper = time.SBPInTimeImplicitFormulation(obj.AA, obj.BB, obj.ff, obj.dt, obj.t, w0, TYPE, order, blockSize);
65 end 65 end
66 end 66 end
67 67
68 function [v,t] = getV(obj) 68 function [v,t] = getV(obj)
69 w = obj.firstOrderTimeStepper.getV(); 69 w = obj.firstOrderTimeStepper.getV();