Functions | |
| def | plot_sim (sim, title='', xlabel='', ylabel1='', ylabel2='', fig_size=(4, 5)) |
| This function creates an appropriately formatted system test plot. More... | |
| def | comp_plot_sim (sim1, sim2, ylim1='auto', ylim2='auto', title='', subtitle1='', subtitle2='', xlabel='', ylabel1='', ylabel2='', fig_size=(13, 6)) |
| This function creates an appropriately formatted system test plot. More... | |
| def | plot_pole (p, title, fig_size) |
| This function creates an appropriately formatted system test plot. More... | |
Variables | |
| A = np.asmatrix(np.loadtxt('A.txt',delimiter=',')) | |
| B = np.asmatrix(np.loadtxt('B.txt',delimiter=',')).transpose() | |
| C = np.matrix() | |
| int | D = 0 |
| sys_full_OL = control.StateSpace(A,B,C,D) | |
| A_p = np.matrix([[A[1,1], A[1,3]], [A[3,1], A[3,3]]]) | |
| B_p = np.matrix([[B[1,0]], [B[3,0]]]) | |
| C_p = np.matrix() | |
| int | D_p = 0 |
| sys_plat_OL = control.StateSpace(A_p,B_p,C_p,D_p) | |
| plat_OL_pole = control.pole(sys_plat_OL) | |
| Q_plat = np.diag([1,1]) | |
| R_plat = np.diag([1]) | |
| K | |
| S | |
| E | |
| K_plat_0 = np.matrix(K) | |
| A_p_CL0 = A_p - (B_p*K_plat_0) | |
| sys_plat_CL0 = control.StateSpace(A_p_CL0,0*B_p,C_p,D_p) | |
| plat_CL0_pole = control.pole(sys_plat_CL0) | |
| T = np.arange(0,3,.001) | |
| list | X0 = [5*3.14159/180, 0] |
| R_plat_CL0 = control.initial_response(sys_plat_CL0,T,X0) | |
| fig = plt.figure() | |
| title | |
| xlabel | |
| ylabel1 | |
| ylabel2 | |
| K_plat_1 = np.matrix(K) | |
| A_p_CL1 = A_p - (B_p*K_plat_1) | |
| sys_plat_CL1 = control.StateSpace(A_p_CL1,0*B_p,C_p,D_p) | |
| plat_CL1_pole = control.pole(sys_plat_CL1) | |
| R_plat_CL1 = control.initial_response(sys_plat_CL1,T,X0) | |
| subtitle1 | |
| subtitle2 | |
| sys_OL_pole = control.pole(sys_full_OL) | |
| Q_sys = np.diag([1,1,1,1]) | |
| R_sys = np.diag([1]) | |
| K_sys_0 = np.matrix(K) | |
| A_CL0 = A - (B*K_sys_0) | |
| sys_CL0 = control.StateSpace(A_CL0,0*B,C,D) | |
| sys_CL0_pole = control.pole(sys_CL0) | |
| R_sys_CL0 = control.initial_response(sys_CL0,T,X0) | |
| K_sys_1 = np.matrix(K) | |
| A_CL1 = A - (B*K_sys_1) | |
| sys_CL1 = control.StateSpace(A_CL1,0*B,C,D) | |
| sys_CL1_pole = control.pole(sys_CL1) | |
| R_sys_CL1 = control.initial_response(sys_CL1,T,X0) | |
| def system_ctrl_design.comp_plot_sim | ( | sim1, | |
| sim2, | |||
ylim1 = 'auto', |
|||
ylim2 = 'auto', |
|||
title = '', |
|||
subtitle1 = '', |
|||
subtitle2 = '', |
|||
xlabel = '', |
|||
ylabel1 = '', |
|||
ylabel2 = '', |
|||
fig_size = (13,6) |
|||
| ) |
This function creates an appropriately formatted system test plot.
This function plots the time response of a given parameter and its derrivative. The parameter sim shold be a nx3 array type object of the following format [time,x,x_dot]
| sim1 | A matrix with the first system simulation output. |
| sim2 | A matrix with the second system simulation output. |
| ylim1 | Tuple describing the ylimits for the first comparison |
| ylim2 | Tuple describing the ylimits for the second comparison |
| title | A str describing the whole figure. |
| subtitle1 | A str describing the first simulation |
| subtitle2 | A str describing the second simulation |
| xlabel | A str describing the x axes |
| ylabel1 | A str describing the y axis of the first comparison |
| ylabel2 | A str describing the y axis of the second comparison |
| fig_size | A tuple giving the width and height of the figure. |
| def system_ctrl_design.plot_pole | ( | p, | |
| title, | |||
| fig_size | |||
| ) |
This function creates an appropriately formatted system test plot.
| p | A vector containing the system poles for plotting. |
| sim_results | a matrix with the system simulation output. |
| title | A str describing the plot. |
| fig_size | A tuple giving the width and height of the figure. |
| def system_ctrl_design.plot_sim | ( | sim, | |
title = '', |
|||
xlabel = '', |
|||
ylabel1 = '', |
|||
ylabel2 = '', |
|||
fig_size = (4,5) |
|||
| ) |
This function creates an appropriately formatted system test plot.
This function plots the time response of a given parameter and its derrivative. The parameter sim shold be a nx3 array type object of the following format [time,x,x_dot]
| sim_results | a matrix with the system simulation output. |
| title | A str describing the whole figure. |
| xlabel | A str describing the x axis |
| ylabel1 | A str describing the y axis of the first plot |
| ylabel2 | A str describing the y axis of the second plot |
| fig_size | A tuple giving the width and height of the figure. |
| system_ctrl_design.A = np.asmatrix(np.loadtxt('A.txt',delimiter=',')) |
| system_ctrl_design.B = np.asmatrix(np.loadtxt('B.txt',delimiter=',')).transpose() |
| system_ctrl_design.C = np.matrix() |
| system_ctrl_design.C_p = np.matrix() |
| int system_ctrl_design.D = 0 |
| int system_ctrl_design.D_p = 0 |
| system_ctrl_design.E |
| system_ctrl_design.fig = plt.figure() |
| system_ctrl_design.K |
| system_ctrl_design.K_plat_0 = np.matrix(K) |
| system_ctrl_design.K_plat_1 = np.matrix(K) |
| system_ctrl_design.K_sys_0 = np.matrix(K) |
| system_ctrl_design.K_sys_1 = np.matrix(K) |
| system_ctrl_design.plat_CL0_pole = control.pole(sys_plat_CL0) |
| system_ctrl_design.plat_CL1_pole = control.pole(sys_plat_CL1) |
| system_ctrl_design.plat_OL_pole = control.pole(sys_plat_OL) |
| system_ctrl_design.Q_plat = np.diag([1,1]) |
| system_ctrl_design.Q_sys = np.diag([1,1,1,1]) |
| system_ctrl_design.R_plat = np.diag([1]) |
| system_ctrl_design.R_plat_CL0 = control.initial_response(sys_plat_CL0,T,X0) |
| system_ctrl_design.R_plat_CL1 = control.initial_response(sys_plat_CL1,T,X0) |
| system_ctrl_design.R_sys = np.diag([1]) |
| system_ctrl_design.S |
| system_ctrl_design.subtitle1 |
| system_ctrl_design.subtitle2 |
| system_ctrl_design.sys_CL0_pole = control.pole(sys_CL0) |
| system_ctrl_design.sys_CL1_pole = control.pole(sys_CL1) |
| system_ctrl_design.sys_OL_pole = control.pole(sys_full_OL) |
| system_ctrl_design.T = np.arange(0,3,.001) |
| system_ctrl_design.title |
| list system_ctrl_design.X0 = [5*3.14159/180, 0] |
| system_ctrl_design.xlabel |
| system_ctrl_design.ylabel1 |
| system_ctrl_design.ylabel2 |