diff options
author | Karl Berry <karl@freefriends.org> | 2009-06-08 01:04:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-06-08 01:04:41 +0000 |
commit | efda44c2e2e6bd08bf58ebdfb2f1879cff9e6f37 (patch) | |
tree | 105b5092688d84851b40816150f4a5c77df3ed08 /Master/texmf/asymptote/ode.asy | |
parent | 9e32dd6aee7faf4e59888cfbd7a927d497b563ad (diff) |
first commit of asymptote binaries + support
git-svn-id: svn://tug.org/texlive/trunk@13665 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/asymptote/ode.asy')
-rw-r--r-- | Master/texmf/asymptote/ode.asy | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Master/texmf/asymptote/ode.asy b/Master/texmf/asymptote/ode.asy new file mode 100644 index 00000000000..5135dd9443f --- /dev/null +++ b/Master/texmf/asymptote/ode.asy @@ -0,0 +1,15 @@ +real euler(real y, real f(real x, real y), real a, real b=a, int n=0, + real h=0, bool dynamic=false, real tolmin=0, real tolmax=0) +{ + if(h == 0) { + if(b == a) return y; + if(n == 0) abort("Either n or h must be specified"); + else h=(b-a)/n; + } + real x=a; + for(int i=0; i < n; ++i) { + y += h*f(x,y); + x += h; + } + return y; +} |