Mercurial > repos > public > sbplib
view +time/+expint/Magnus_mp.m @ 695:ba0d31ce4121 feature/quantumTriangles
Changed jacobian at right side of the penalty term in 2D, seems like it is working
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Tue, 19 Sep 2017 09:51:08 +0200 |
parents | bc39bb984d88 |
children | 8434063ed162 |
line wrap: on
line source
% Takes one time step of size k using the magnus midpoinr % starting from v_0 and where the function F(v,t) gives the % time derivatives. function v = Magnus_mp(v,D, t , k,matrixexp,tol) if isa(D,'function_handle') Omega = D(t +k/2); else Omega = D; end switch matrixexp case 'expm' v = expm(k*Omega)*v; case 'Arnoldi' v = time.expint.expm_Arnoldi(-Omega,v,k,tol,100); otherwise error('No such matrix exponential evaluation') end end