comparison +time/+expint/Magnus_mp.m~ @ 513:bc39bb984d88 feature/quantumTriangles

Added arnoldi krylov subspace approximation
author Ylva Rydin <ylva.rydin@telia.com>
date Mon, 26 Jun 2017 20:15:54 +0200
parents
children 8434063ed162
comparison
equal deleted inserted replaced
512:4ef2d2a493f1 513:bc39bb984d88
1 % Takes one time step of size k using the magnus midpoinr
2 % starting from v_0 and where the function F(v,t) gives the
3 % time derivatives.
4 function v = Magnus_mp(v,D, t , k,matrixexp,tol)
5
6 if isa(D,'function_handle')
7 switch matrixexp
8 case 'expm'
9 v = expm(k*D(t +k/2))*v;
10 case 'Arnol'
11 v = time.expint.expm_Arnoldi(-D(t +k/2),v,k,toler,100);
12 else
13 %v = krylov(k*D,v);
14 % v = expm(k*D)*v;
15 end
16
17 end