Mercurial > repos > public > sbplib
diff +rv/+time/BdfDerivative.m @ 1152:010bb2677230 feature/rv
Clean up in +rv/+time. Make the time stepping more efficient by not storing unnessecary properties in the RK-RV time steppers
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 05 Mar 2019 10:53:34 +0100 |
parents | 4b42999874c0 |
children | a4c00628a39d |
line wrap: on
line diff
--- a/+rv/+time/BdfDerivative.m Mon Feb 18 09:00:00 2019 +0100 +++ b/+rv/+time/BdfDerivative.m Tue Mar 05 10:53:34 2019 +0100 @@ -2,16 +2,10 @@ properties coefficients end - methods %TBD: Decide if the BDF order should be passed in construction - % and only a row of coefficients stored based on the order. - % There would still be an implicit dependancy on the number - % of vectors in v_prev and elements in coefficients. - % In addition, dt could be stored, but this would be - % inflexible if different step sizes are employed. + methods function obj = BdfDerivative() obj.coefficients = obj.getBdfCoefficients(); end - % Add asserts here? function DvDt = evaluate(obj, v, v_prev, dt) order = size(v_prev,2); DvDt = (obj.coefficients(order,1)*v - sum(obj.coefficients(order,2:order+1).*v_prev,2))/dt;