87 |
def testLSODE(self): |
def testLSODE(self): |
88 |
self._testIntegrator('LSODE') |
self._testIntegrator('LSODE') |
89 |
|
|
90 |
|
def testnewton(self): |
91 |
|
self.L.load('johnpye/newton.a4c') |
92 |
|
T = self.L.findType('newton') |
93 |
|
M = T.getSimulation('sim') |
94 |
|
M.solve(ascpy.Solver("QRSlv"),ascpy.SolverReporter()) |
95 |
|
I = ascpy.Integrator(M) |
96 |
|
I.setEngine('LSODE') |
97 |
|
I.setReporter(ascpy.IntegratorReporterConsole(I)) |
98 |
|
I.setLinearTimesteps(ascpy.Units("s"), 0, 20.0/9.8, 2); |
99 |
|
I.analyse() |
100 |
|
I.solve() |
101 |
|
print "At end of simulation," |
102 |
|
print "x = %f" % M.sim.x |
103 |
|
print "v = %f" % M.sim.v |
104 |
|
M.run(T.getMethod('self_test')) |
105 |
|
|
106 |
def testlotka(self): |
def testlotka(self): |
107 |
self.L.load('johnpye/lotka.a4c') |
self.L.load('johnpye/lotka.a4c') |
108 |
M = self.L.findType('lotka').getSimulation('sim') |
M = self.L.findType('lotka').getSimulation('sim') |