docstr: Test method='gbt' with alpha=0.25 for tf and zpk cases.
docstr_tok: ["Test","method='gbt","'","with","alpha=0.25","for","tf","and","zpk","cases","."]
code: def test_gbt_with_sio_tf_and_zpk(self):
      """Test method='gbt' with alpha=0.25 for tf and zpk cases."""
      # State space coefficients for the continuous SIO system.
      A = -1.0
      B = 1.0
      C = 1.0
      D = 0.5
  
      # The continuous transfer function coefficients.
      cnum, cden = ss2tf(A, B, C, D)
  
      # Continuous zpk representation
      cz, cp, ck = ss2zpk(A, B, C, D)
  
      h = 1.0
      alpha = 0.25
  
      # Explicit formulas, in the scalar case.
      Ad = (1 + (1 - alpha) * h * A) / (1 - alpha * h * A)
      Bd = h * B / (1 - alpha * h * A)
      Cd = C / (1 - alpha * h * A)
      Dd = D + alpha * C * Bd
  
      # Convert the explicit solution to tf
      dnum, dden = ss2tf(Ad, Bd, Cd, Dd)
  
      # Compute the discrete tf using cont2discrete.
      c2dnum, c2dden, dt = c2d(
          (cnum, cden), h, method="gbt", alpha=alpha
      )
  
      assert_allclose(dnum, c2dnum)
      assert_allclose(dden, c2dden)
  
      # Convert explicit solution to zpk.
      dz, dp, dk = ss2zpk(Ad, Bd, Cd, Dd)
  
      # Compute the discrete zpk using cont2discrete.
      c2dz, c2dp, c2dk, dt = c2d(
          (cz, cp, ck), h, method="gbt", alpha=alpha
      )
  
      assert_allclose(dz, c2dz)
      assert_allclose(dp, c2dp)
      assert_allclose(dk, c2dk)
  
imports: import numpy
  from numpy.testing import assert_array_almost_equal, assert_almost_equal, assert_allclose, assert_equal
  import pytest
  from scipy.signal import cont2discrete
  from scipy.signal import dlsim, ss2tf, ss2zpk, lsim, lti
  from scipy.signal import tf2ss, impulse, dimpulse, step, dstep
label_desc: Use image node_id 10 for calling the TestC2D obj's underlying member method code with example usage: obj.test_gbt_with_sio_tf_and_zpk() without return types