/[ascend]/trunk/test.py
ViewVC logotype

Diff of /trunk/test.py

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

revision 1127 by johnpye, Sat Jan 13 07:05:23 2007 UTC revision 1132 by johnpye, Sun Jan 14 10:40:58 2007 UTC
# Line 464  class TestSteam(AscendSelfTester): Line 464  class TestSteam(AscendSelfTester):
464          self.assertAlmostEqual(M.dTw_dt[4],0.0);          self.assertAlmostEqual(M.dTw_dt[4],0.0);
465          M.run(T.getMethod('configure_dynamic'))          M.run(T.getMethod('configure_dynamic'))
466          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
467            return M
468    
469        def testintegLSODE(self):
470            M = self.testdsgsat()
471            M.qdot_s.setRealValueWithUnits(1000,"W/m")
472            M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
473            I = ascpy.Integrator(M)
474            I.setEngine('LSODE')
475            I.setParameter('meth','AM')
476            I.setReporter(ascpy.IntegratorReporterConsole(I))
477            I.setLinearTimesteps(ascpy.Units("s"), 0, 5, 1)
478            I.analyse()
479            I.solve()
480    
481        def testintegIDA(self):
482          self.assertAlmostEqual(M.dTw_dt[4],0.0)          self.assertAlmostEqual(M.dTw_dt[4],0.0)
483          Tw1 = float(M.T_w[4])          Tw1 = float(M.T_w[4])
484          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
485          I.setEngine('LSODE')          I.setEngine('IDA')
486          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setParameter('linsolver','DENSE')
487            I.setParameter('safeeval',True)
488            I.setParameter('rtol',1e-8)
489            I.setInitialSubStep(0.01)
490            I.setMinSubSteps(0.001)    
491            I.setMaxSubSteps(100)      
492          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
493          I.setLinearTimesteps(ascpy.Units("s"), 0, 3600, 10)          I.setLinearTimesteps(ascpy.Units("s"), 0, 3600, 100)
494          I.setMinSubStep(0.0001)          I.analyse()
495          I.setMaxSubStep(100)          I.solve()
         I.setInitialSubStep(0.1)  
496          I.analyse()          I.analyse()
497          I.solve()          I.solve()
498          self.assertAlmostEqual(float(M.T_w[4]),Tw1)          self.assertAlmostEqual(float(M.T_w[4]),Tw1)

Legend:
Removed from v.1127  
changed lines
  Added in v.1132

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22