Simulation Program For State Space Model
Simulation Program For State Space Model
clear all
t=0; % Initial time
dt=0.01; % step size
tsim=10.0; % Simulation time
n=round( (tsim-t)/dt); % number of iterations
%system parameters
k1=5;
k2=7;
m1=2;
m2=3;
Pl= 0.2; num= [0.1 0.7 1];
den= [1 7.08 10.56 20.8];
t= 0:.02:10;
c= -Pl*step(num,den,t);
plot(t, c), xlabel('t, sec'), ylabel('pu')
title('Frequency deviation step response'),grid
timespec(num, den)