Mercurial > repos > public > sbplib
comparison +time/SBPInTimeSecondOrderFormImplicit.m @ 463:45a3924140f4 feature/grids
Move f(t) to the RHS
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 22 Jun 2017 13:06:41 +0200 |
parents | e0caae9ef6ed |
children | d4b999585af1 |
comparison
equal
deleted
inserted
replaced
462:7dbdf7390265 | 463:45a3924140f4 |
---|---|
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) = 0 | 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, TYPE, order, blockSize) | 17 function obj = SBPInTimeSecondOrderFormImplicit(A, B, C, f, k, t0, v0, v0t, TYPE, order, blockSize) |
18 default_arg('f', []); | 18 default_arg('f', []); |
19 default_arg('TYPE', []); | 19 default_arg('TYPE', []); |
42 ]; | 42 ]; |
43 | 43 |
44 if ~isempty(f) | 44 if ~isempty(f) |
45 obj.ff = @(t)[ | 45 obj.ff = @(t)[ |
46 sparse(m,1); | 46 sparse(m,1); |
47 -f(t); | 47 f(t); |
48 ]; | 48 ]; |
49 else | 49 else |
50 obj.ff = @(t) sparse(2*m,1); | 50 obj.ff = @(t) sparse(2*m,1); |
51 end | 51 end |
52 | 52 |