Mercurial > repos > public > sbplib
annotate +util/tt2t.m @ 103:bc5db54f9efd feature/arclen-param
fzero_vec, integral_vec and spline are now local functions in Curve. Renamed arcLengthStretch to arcLengthParametrization. Removed plot_derivative. Added some comments and extra lines + removed unneccesary lines. arcLength is now a method and not static. Constructor does not accept difference operator anymore.
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Mon, 07 Dec 2015 17:24:28 +0100 |
parents | 48b6fb693025 |
children |
rev | line source |
---|---|
0 | 1 % Converts a semidiscretized PDE from second order in time to first order in time. |
2 % v_tt = Dv + S | |
3 % becomes | |
4 % w_t = Mw + C | |
5 % where | |
6 % w = [ v ; v_t] | |
7 % and | |
8 % M = [0 I; | |
9 % D 0]; | |
10 % C = [0; | |
11 % S]; | |
12 function [M,C] = tt2t(D,S) | |
13 default_arg('S',sparse(size(D))) | |
14 time_dependent_bc = isa(S,'function_handle'); | |
15 | |
16 I = eye(size(D)); | |
17 O = zeros(size(D)); | |
18 | |
19 M = [O I; | |
20 D O]; | |
21 | |
22 if ~time_dependent_bc | |
23 C = [zeros(size(S)); S]; | |
24 else | |
25 o = zeros(size(S(0))); | |
26 C = @(t)([o; S(t)]); | |
27 end | |
28 end |