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

Diff of /trunk/test.py

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

revision 1269 by johnpye, Sat Feb 3 06:18:11 2007 UTC revision 1270 by johnpye, Sun Feb 4 01:01:18 2007 UTC
# Line 569  class TestSteam(AscendSelfTester): Line 569  class TestSteam(AscendSelfTester):
569          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())          M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
570          return M          return M
571    
572        def testdsgsatrepeat(self):
573            self.L.load('steam/dsgsat3.a4c')
574            T = self.L.findType('dsgsat3')
575            M = T.getSimulation('sim',False)
576            M.run(T.getMethod('on_load'))
577            M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
578            M.run(T.getMethod('on_load'))
579            M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
580            M.run(T.getMethod('on_load'))
581            M.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())
582    
583      def teststeadylsode(self):      def teststeadylsode(self):
584          "test that steady conditions are stable with LSODE"          "test that steady conditions are stable with LSODE"
585          M = self.testdsgsat()          M = self.testdsgsat()
# Line 631  class TestSteam(AscendSelfTester): Line 642  class TestSteam(AscendSelfTester):
642          T = self.L.findType('dsgsat3')          T = self.L.findType('dsgsat3')
643          M.run(T.getMethod('free_states'))          M.run(T.getMethod('free_states'))
644          # here is the peturbation...          # here is the peturbation...
645          M.qdot_s.setRealValueWithUnits(1000,"W/m")          M.qdot_s.setRealValueWithUnits(2000,"W/m")
646          # IDA has its own initial conditions solver, so no need to call QRSlv here          # IDA has its own initial conditions solver, so no need to call QRSlv here
647          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
648          I.setEngine('IDA')          I.setEngine('IDA')
# Line 639  class TestSteam(AscendSelfTester): Line 650  class TestSteam(AscendSelfTester):
650          I.setParameter('safeeval',True)          I.setParameter('safeeval',True)
651          I.setParameter('rtol',1e-5)          I.setParameter('rtol',1e-5)
652          I.setParameter('atolvect',False)          I.setParameter('atolvect',False)
653          I.setParameter('atol',1e-4)          I.setParameter('atol',1e-5)
654          I.setInitialSubStep(0.0001)          I.setInitialSubStep(0.0001)
655          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
656          I.setLogTimesteps(ascpy.Units("s"), 1, 3600, 20)          I.setLogTimesteps(ascpy.Units("s"), 1, 5, 20)
657          I.analyse()          I.analyse()
658          I.solve()          I.solve()
659                    

Legend:
Removed from v.1269  
changed lines
  Added in v.1270

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