Mercurial > repos > public > sbplib
changeset 75:ef5c9870f386
Cleand time.Rungekutta4 a bit.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 23 Nov 2015 17:32:56 +0100 |
parents | d0df12c03aac |
children | 5c569cbef49e |
files | +time/Rungekutta4.m |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
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)