Mercurial > repos > public > sbplib
diff +time/Rungekutta4.m @ 75:ef5c9870f386
Cleand time.Rungekutta4 a bit.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 23 Nov 2015 17:32:56 +0100 |
parents | b18d3d201a71 |
children | b5e5b195da1e c6fcee3fcf1b |
line wrap: on
line diff
--- a/+time/Rungekutta4.m Mon Nov 23 15:56:41 2015 +0100 +++ b/+time/Rungekutta4.m Mon Nov 23 17:32:56 2015 +0100 @@ -26,7 +26,11 @@ obj.S = S; end - obj.F = @(v,t)(obj.D*v + obj.S); + if S == 0 + obj.F = @(v,t)(obj.D*v); + else + obj.F = @(v,t)(obj.D*v + obj.S); + end end function [v,t] = getV(obj)