
# -*- coding: utf8 -*- from control.matlab import * f = tf(1, [1, 1]); g = tf(1, [2 ,1]); 
# -*- coding: utf8 -*- from control.matlab import * f = tf(1, [1, 1]); g = tf(1, [2 ,1]); w = f + g print (w) (3 s + 2)/(s^2 + 3 s + 1)
# -*- coding: utf8 -*- from control.matlab import * f = tf(1, [1, 1]); g = tf(1, [2 ,1]); w = f* g print (w) 1/(2 s^2 + 3 s + 1)
# -*- coding: utf8 -*- from control.matlab import * f = tf(1, [1, 1]); g = tf(1, [2 ,1]); w = feedback(f, g) print(w) (2 s + 1)/(2 s^2 + 3 s + 2) # -*- coding: utf8 -*- from control.matlab import * f = tf(1, [1, 1]); g = tf(1, [2 ,1]); w = f/(1-f*g) print(w) (2 s^2 + 3 s + 1)/(2 s^3 + 5 s^2 + 3 s)
# -*- coding: utf8 -*- from control.matlab import * """ LTI- w, :""" num= [1., 2.] den= [3., 4., 5.,3] w= tf(num, den) """ pole, zero""" print(' : \n %s'%w) print(": \n %s"%pole(w)) print(":\n %s -\n "%zero(w)) ( s + 2)/(3 s^3 + 4 s^2 + 5 s + 3)-0.26392546+1.08251346j
-0.26392546-1.08251346j
-0. 80548241+0.j
: -2 # -*- coding: utf8 -*- from control.matlab import * import matplotlib.pyplot as plt """ LTI- w, :""" num= [1., 2.] den= [3., 4., 5.,3] w= tf(num, den) y,x=step(w) plt.plot(x,y,"b") plt.title('Step Responsse ') plt.ylabel('Amplitude') plt.xlabel('Time(sec)') plt.grid(True) plt.show() 
# -*- coding: utf8 -*- from control.matlab import * import matplotlib.pyplot as plt """ LTI- w, :""" num= [1., 2.] den= [3., 4., 5.,3] w= tf(num, den) y,x=impulse(w) plt.plot(x,y,"r") plt.title('impulse Responsse ') plt.ylabel('Amplitude') plt.xlabel('Time(sec)') plt.grid(True) plt.show() 
# -*- coding: utf8 -*- from control.matlab import * import matplotlib.pyplot as plt """ LTI- w, :""" num= [1., 2.] den= [3., 4., 5.,3] w= tf(num, den) mag, phase, omega = bode(w, dB=True) plt.plot() plt.show() 
import matplotlib.pyplot as plt from control.matlab import * num= [1., 2.] den= [3., 4., 5.,3] w= tf(num, den) plt.title('Nyquist Diagram ') plt.ylabel('Imaginary Axis') plt.xlabel('Real Axis') nyquist(w) plt.grid(True) plt.plot() plt.show() 
(one)
(2)
(3)
(four)
(five)
(6)
(7) # -*- coding: utf8 -*- import matplotlib.pyplot as plt from control.matlab import * import numpy as np A=np.matrix([[-1,0],[1,0]]) B=np.matrix([[1],[0]]) C=np.matrix([[0,1]]) D=0 sn=ss(A,B,C,D) wd=tf(sn) print(" : \n %s"%sn) print(" \n %s"%wd) y,x=step(wd) plt.plot(x,y,"b") plt.title('Step Responsse ') plt.ylabel('Amplitude') plt.xlabel('Time(sec)') plt.grid(True) plt.show() h=1 sd=c2d(sn,h) print(" : \n %s"%sd) 
A = [[-1 0] [ 1 0]] B = [[1] [0]] C = [[0 1]] D = [[0]] A = [[0.36787944 0. ] [0.63212056 1. ]] B = [[0.63212056] [0.36787944]] C = [[0 1]] D = [[0]] dt = 1 Source: https://habr.com/ru/post/352492/
All Articles