From 7ebb7368fa53009acc87aaa8211fabee5608265b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 16 Apr 2009 16:08:57 +0000 Subject: mfpic4ode update (15apr09) git-svn-id: svn://tug.org/texlive/trunk@12734 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/mfpic4ode/demo/demo.pdf | Bin 229781 -> 221236 bytes .../texmf-dist/doc/latex/mfpic4ode/demo/demo.tex | 2 +- .../texmf-dist/doc/latex/mfpic4ode/mfpic4ode.pdf | Bin 112722 -> 113843 bytes .../texmf-dist/doc/latex/mfpic4ode/mfpic4ode.tex | 155 +++++++++++---------- 4 files changed, 86 insertions(+), 71 deletions(-) (limited to 'Master/texmf-dist/doc/latex/mfpic4ode') diff --git a/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.pdf b/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.pdf index ac85af20cbc..256f443f0bd 100644 Binary files a/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.pdf and b/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.pdf differ diff --git a/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.tex b/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.tex index e948ab6374e..0a56345461a 100644 --- a/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.tex +++ b/Master/texmf-dist/doc/latex/mfpic4ode/demo/demo.tex @@ -193,7 +193,7 @@ Runge--Kutta and fourth order Runge--Kutta method. \nomplabels \drawcolor{green} \mfsrc{ODEstep:=0.02; ODEstepcount:=30;} - \trajectoryRKF{0}{1} + \dashed\trajectoryRKF{0}{1} \tlabel[tr](0.39,2.4){\bf{Exact solution}} % We use bigger step to see the difference between various diff --git a/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.pdf b/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.pdf index ac4f81f6c90..1d6364ccfec 100644 Binary files a/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.pdf and b/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.pdf differ diff --git a/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.tex b/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.tex index a20ce6c6131..a20dcb81c35 100644 --- a/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.tex +++ b/Master/texmf-dist/doc/latex/mfpic4ode/mfpic4ode.tex @@ -38,51 +38,60 @@ %%% ODEstep and the number of steps is ODEstepcount. The points are %%% stored in metapost variables x1,y1. \def\trajectory#1#2{ - \mfsrc{x1:=#1;y1:=#2; - for i=1 upto ODEstepcount: - x2:=x1+ODEstep; - y2:=y1+ODEstep*ODErhs(x1,y1);} - \ODEline{z1}{z2} - \mfsrc{ - if ((y2>yneg) and (y2yneg) and (y2yneg) and (y2yneg) and (y2yneg) and (y2yneg) and (y2yneg) and (y2yneg) and (y2yneg) and (y2xneg)): x1:=x2; y1:=y2 fi; - endfor - }} + \begin{connect} + \mfsrc{x1:=#1;y1:=#2; + TIMEsteps:=abs(TIMEend/TIMEstep); + TIME:=0; + for i=1 upto TIMEsteps: + k1:=ASf(x1,y1); + l1:=ASg(x1,y1); + k2:=ASf(x1+(TIMEstep*k1/2),y1+(TIMEstep*l1/2)); + l2:=ASg(x1+(TIMEstep*k1/2),y1+(TIMEstep*l1/2)); + k3:=ASf(x1+(TIMEstep*k2/2),y1+(TIMEstep*l2/2)); + l3:=ASg(x1+(TIMEstep*k2/2),y1+(TIMEstep*l2/2)); + k4:=ASf(x1+(TIMEstep*k3),y1+(TIMEstep*l3)); + l4:=ASg(x1+(TIMEstep*k3),y1+(TIMEstep*l3)); + k5:=((k1)/6)+((k2)/3)+((k3)/3)+((k4)/6); + l5:=(l1/6)+(l2/3)+(l3/3)+(l4/6); + x2:=x1+(TIMEstep*k5); + y2:=y1+(TIMEstep*l5);} + \ODEline{z1}{z2} + \mfsrc{ + if ((y2>yneg) and (y2xneg)): x1:=x2; y1:=y2 fi; + endfor + } + \end{connect} +} \catcode`\@12\relax \endinput -- cgit v1.2.3