When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T, and as many columns as input channels problem
Show older comments
clear all clc
Ms = 267; Mu = 36.6; Ks = 18.742; Kt = 193.915; Bs = 700; Bt = 200;
A = [0 1 0 0; -Ks/Ms -Bs/Ms Ks/Ms Bs/Ms; 0 0 0 1; Ks/Mu Bs/Mu -(Kt+Ks)/Mu -(Bt+Bs)/Mu]; B = [0 0;0 0;0 0; Kt/Mu Bt/Mu]; C = [1 0 0 0 ; 0 0 1 0]; D = [0];
t = 0:0.01:10; u = 100*sin(5*t); sys = ss(A,B,C,D); x0 = [0;0;0;0];
y = lsim(sys,u,t,x0) x1 = y(:,1); x2 = y(:,1);
Accepted Answer
More Answers (0)
Categories
Find more on Model Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!