Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/lic.diderot
ViewVC logotype

Diff of /branches/pure-cfg/test/lic.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 938, Fri Apr 22 13:50:26 2011 UTC revision 939, Fri Apr 22 13:55:39 2011 UTC
# Line 22  Line 22 
22      vec2 pos0 = [xx,yy];      vec2 pos0 = [xx,yy];
23      vec2 forw = pos0;      vec2 forw = pos0;
24      vec2 back = pos0;      vec2 back = pos0;
25      output real avg = R(pos0);      output real sum = R(pos0);
26      int step = 0;      int step = 0;
27    
28      update {      update {
# Line 32  Line 32 
32          // Midpoint method step          // Midpoint method step
33          forw = forw + h*V(forw + 0.5*h*V(forw));          forw = forw + h*V(forw + 0.5*h*V(forw));
34          back = back - h*V(back - 0.5*h*V(back));          back = back - h*V(back - 0.5*h*V(back));
35          avg = avg + R(forw) + R(back);          sum = sum + R(forw) + R(back);
36          step = step + 1;          step = step + 1;
37          if (step == stepNum) {          if (step == stepNum) {
38            // modulate output by velocity at initial position            // modulate output by velocity at initial position
39            avg = |V(pos0)|*avg/real(1 + 2*stepNum);            sum = |V(pos0)|*sum/real(1 + 2*stepNum);
40            stabilize;            stabilize;
41          }          }
42      }      }

Legend:
Removed from v.938  
changed lines
  Added in v.939

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0