summaryrefslogtreecommitdiff
path: root/Master/texmf/doc/asymptote/examples/odetest.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf/doc/asymptote/examples/odetest.asy')
-rw-r--r--Master/texmf/doc/asymptote/examples/odetest.asy19
1 files changed, 9 insertions, 10 deletions
diff --git a/Master/texmf/doc/asymptote/examples/odetest.asy b/Master/texmf/doc/asymptote/examples/odetest.asy
index 68a7a2eca67..69f8ea3fd07 100644
--- a/Master/texmf/doc/asymptote/examples/odetest.asy
+++ b/Master/texmf/doc/asymptote/examples/odetest.asy
@@ -8,7 +8,7 @@ write();
write("system integration test");
real[] f(real t, real[] x) {return new real[] {x[1],1.5*x[0]^2};}
write(integrate(new real[] {4,-8},f,0,1,n=100,dynamic=true,tolmin=0.0002,
- tolmax=0.0004,RK3BS,verbose=true));
+ tolmax=0.0004,RK3BS,verbose=false));
write();
write("simultaneous newton test");
@@ -29,16 +29,15 @@ real[] initial(real[] x) {
}
real[] discrepancy(real[] x) {
- write("Error: ",x[0]-1);
- return new real[] {x[0]-1};
+ real error=x[0]-1;
+ write("Error: ",error);
+ return new real[] {error};
}
-write(solveBVP(f,0,1,n=10,initial,discrepancy,guess=new real[] {-30},RK4,
- iterations=10));
+real[] w0=solveBVP(f,0,1,n=10,dynamic=true,tolmin=0.0002,tolmax=0.0004,RK3BS,
+ initial,discrepancy,guess=new real[] {-30},iterations=10);
+write(w0);
write();
-write(solveBVP(f,0,1,n=100,initial,discrepancy,guess=new real[] {-30},RK4,
- iterations=10));
-write();
-write(solveBVP(f,0,1,n=10000,initial,discrepancy,guess=new real[] {-30},RK4,
- iterations=10));
+write(integrate(w0,f,0,1,n=10,dynamic=true,tolmin=0.0002,tolmax=0.0004,RK3BS,
+ verbose=false));
write();