@@ -449,7 +449,7 @@ def test_evalfr_mimo(self):
449449 np .testing .assert_array_almost_equal (sys (2.j ), resp )
450450
451451 def test_freqresp_siso (self ):
452- """Evaluate the magnitude and phase of a SISO system at
452+ """Evaluate the magnitude and phase of a SISO system at
453453 multiple frequencies."""
454454
455455 sys = TransferFunction ([1. , 3. , 5 ], [1. , 6. , 2. , - 1 ])
@@ -467,7 +467,7 @@ def test_freqresp_siso(self):
467467
468468 @unittest .skipIf (not slycot_check (), "slycot not installed" )
469469 def test_freqresp_mimo (self ):
470- """Evaluate the magnitude and phase of a MIMO system at
470+ """Evaluate the magnitude and phase of a MIMO system at
471471 multiple frequencies."""
472472
473473 num = [[[1. , 2. ], [0. , 3. ], [2. , - 1. ]],
@@ -547,6 +547,7 @@ def test_common_den(self):
547547 np .zeros ((3 , 5 , 6 )))
548548 np .testing .assert_array_almost_equal (den , denref )
549549
550+ @unittest .skipIf (not slycot_check (), "slycot not installed" )
550551 def test_pole_mimo (self ):
551552 """Test for correct MIMO poles."""
552553
@@ -804,6 +805,28 @@ def test_size_mismatch(self):
804805 self .assertRaises (NotImplementedError ,
805806 TransferFunction .feedback , sys2 , sys1 )
806807
808+ def test_latex_repr (self ):
809+ """ Test latex printout for TransferFunction """
810+ Hc = TransferFunction ([1e-5 , 2e5 , 3e-4 ],
811+ [1.2e34 , 2.3e-4 , 2.3e-45 ])
812+ Hd = TransferFunction ([1e-5 , 2e5 , 3e-4 ],
813+ [1.2e34 , 2.3e-4 , 2.3e-45 ],
814+ .1 )
815+ # TODO: make the multiplication sign configurable
816+ expmul = r'\times'
817+ for var , H , suffix in zip (['s' , 'z' ],
818+ [Hc , Hd ],
819+ ['' , r'\quad dt = 0.1' ]):
820+ ref = (r'$$\frac{'
821+ r'1 ' + expmul + ' 10^{-5} ' + var + '^2 '
822+ r'+ 2 ' + expmul + ' 10^{5} ' + var + ' + 0.0003'
823+ r'}{'
824+ r'1.2 ' + expmul + ' 10^{34} ' + var + '^2 '
825+ r'+ 0.00023 ' + var + ' '
826+ r'+ 2.3 ' + expmul + ' 10^{-45}'
827+ r'}' + suffix + '$$' )
828+ self .assertEqual (H ._repr_latex_ (), ref )
829+
807830
808831def suite ():
809832 return unittest .TestLoader ().loadTestsFromTestCase (TestXferFcn )
0 commit comments