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

Diff of /trunk/pygtk/test.py

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

revision 1057 by johnpye, Sat Jan 6 15:23:25 2007 UTC revision 1058 by johnpye, Sat Jan 6 23:14:11 2007 UTC
# Line 568  class TestIDADENSE(Ascend): Line 568  class TestIDADENSE(Ascend):
568          assert abs(float(M.y2) - 2.0437e-13) < 2e-14          assert abs(float(M.y2) - 2.0437e-13) < 2e-14
569          assert abs(float(M.y3) - 1.0) < 1e-5          assert abs(float(M.y3) - 1.0) < 1e-5
570    
571      def testkryx(self):  ## @TODO fails during IDACalcIC (model too big?)
572          self.L.load('johnpye/idakryx.a4c')  #   def testkryx(self):
573          ascpy.getCompiler().setUseRelationSharing(False)  #       self.L.load('johnpye/idakryx.a4c')
574          M = self.L.findType('idakryx').getSimulation('sim')  #       ascpy.getCompiler().setUseRelationSharing(False)
575          M.setSolver(ascpy.Solver('QRSlv'))  #       M = self.L.findType('idakryx').getSimulation('sim')
576          M.build()  #       M.setSolver(ascpy.Solver('QRSlv'))
577          I = ascpy.Integrator(M)  #       M.build()
578          I.setEngine('IDA')  #       I = ascpy.Integrator(M)
579          I.setReporter(ascpy.IntegratorReporterConsole(I))  #       I.setEngine('IDA')
580          I.setParameter('linsolver','DENSE')  #       I.setReporter(ascpy.IntegratorReporterConsole(I))
581          I.setParameter('maxl',8)  #       I.setParameter('linsolver','DENSE')
582          I.setParameter('gsmodified',False)  #       I.setParameter('maxl',8)
583          I.setParameter('autodiff',True)  #       I.setParameter('gsmodified',False)
584          I.setParameter('rtol',0)  #       I.setParameter('autodiff',True)
585          I.setParameter('atol',1e-3);  #       I.setParameter('rtol',0)
586          I.setParameter('atolvect',False)  #       I.setParameter('atol',1e-3);
587          I.setParameter('calcic','YA_YDP')  #       I.setParameter('atolvect',False)
588          I.analyse()  #       I.setParameter('calcic','YA_YDP')
589          I.setLogTimesteps(ascpy.Units("s"), 0.01, 10.24, 11)  #       I.analyse()
590          I.solve()  #       I.setLogTimesteps(ascpy.Units("s"), 0.01, 10.24, 11)
591          assert abs(M.u[2][2].getValue()) < 1e-5  #       I.solve()
592    #       assert abs(M.u[2][2].getValue()) < 1e-5
593            
594  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
595  # Testing of IDA models using SPGMR linear solver (Krylov)  # Testing of IDA models using SPGMR linear solver (Krylov)

Legend:
Removed from v.1057  
changed lines
  Added in v.1058

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