comparison +time/Magnus4.m @ 510:71908bbce2e1 feature/quantumTriangles

tried to add 4th order magnus integrator which does not work
author Ylva Rydin <ylva.rydin@telia.com>
date Fri, 02 Jun 2017 17:46:01 +0200
parents
children bc39bb984d88
comparison
equal deleted inserted replaced
509:566304a5733e 510:71908bbce2e1
1 classdef Magnus4 < time.Timestepper
2 properties
3 D
4 S
5 F
6 k
7 t
8 v
9 m
10 n
11 end
12
13
14 methods
15 function obj = Magnus4(D, k, t0, v0)
16 obj.D = D;
17 obj.k = k;
18 obj.t = t0;
19 obj.v = v0;
20 obj.m = length(v0);
21 obj.n = 0;
22 end
23
24 function [v,t] = getV(obj)
25 v = obj.v;
26 t = obj.t;
27 end
28
29 function obj = step(obj)
30 obj.v = time.expint.Magnus_4(obj.v,obj.D, obj.t, obj.k);
31 obj.t = obj.t + obj.k;
32 obj.n = obj.n + 1;
33 end
34 end
35
36
37 methods (Static)
38 function k = getTimeStep(lambda)
39 k = rk4.get_rk4_time_step(lambda);
40 end
41 end
42
43 end