diff options
Diffstat (limited to 'Build/source/utils/asymptote/examples/odetest.asy')
-rw-r--r-- | Build/source/utils/asymptote/examples/odetest.asy | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Build/source/utils/asymptote/examples/odetest.asy b/Build/source/utils/asymptote/examples/odetest.asy index 68a7a2eca67..69f8ea3fd07 100644 --- a/Build/source/utils/asymptote/examples/odetest.asy +++ b/Build/source/utils/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(); |