Plot simulated time response of dynamic system to arbitrary inputs; simulated response data 您所在的位置:网站首页 cheb1ord函数matlab Plot simulated time response of dynamic system to arbitrary inputs; simulated response data

Plot simulated time response of dynamic system to arbitrary inputs; simulated response data

2023-03-20 06:08| 来源: 网络整理| 查看: 265

Open Live Script

In a MIMO system, at each time step t, the input u(t) is a vector whose length is the number of inputs. To use lsim, you specify u as a matrix with dimensions Nt-by-Nu, where Nu is the number of system inputs and Nt is the length of t. In other words, each column of u is the input signal applied to the corresponding system input. For instance, to simulate a system with four inputs for 201 time steps, provide u as a matrix of four columns and 201 rows, where each row u(i,:) is the vector of input values at the ith time step; each column u(:,j) is the signal applied at the jth input.

Similarly, the output y(t) computed by lsim is a matrix whose columns represent the signal at each system output. When you use lsim to plot the simulated response, lsim provides separate axes for each output, representing the system response in each output channel to the input u(t) applied at all inputs.

Consider the two-input, three-output state-space model with the following state-space matrices.

A = [-1.5 -0.2 1.0; -0.2 -1.7 0.6; 1.0 0.6 -1.4]; B = [ 1.5 0.6; -1.8 1.0; 0 0 ]; C = [ 0 -0.5 -0.1; 0.35 -0.1 -0.15 0.65 0 0.6]; D = [ 0.5 0; 0.05 0.75 0 0]; sys = ss(A,B,C,D);

Plot the response of sys to a square wave of period 4 s, applied to the first input sys and a pulse applied to the second input every 3 s. To do so, create column vectors representing the square wave and the pulsed signal using gensig. Then stack the columns into an input matrix. To ensure the two signals have the same number of samples, specify the same end time and sample time.

Tf = 10; Ts = 0.1; [uSq,t] = gensig("square",4,Tf,Ts); [uP,~] = gensig("pulse",3,Tf,Ts); u = [uSq uP]; lsim(sys,u,t)

Each axis shows the response of one of the three system outputs to the signals u applied at all inputs. Each plot also shows all input signals in gray.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有