0% found this document useful (0 votes)
24 views5 pages

SPS Matlab

This document discusses modeling continuous and discrete time systems using MATLAB. It contains examples of modeling first order systems using transfer functions and converting between continuous and discrete time models. Plots of impulse responses are generated for different sampling periods to illustrate the effects of discretization.

Uploaded by

Egy Kurniawan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

SPS Matlab

This document discusses modeling continuous and discrete time systems using MATLAB. It contains examples of modeling first order systems using transfer functions and converting between continuous and discrete time models. Plots of impulse responses are generated for different sampling periods to illustrate the effects of discretization.

Uploaded by

Egy Kurniawan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

03.

SPS IO SISTEM

clear all;clc; close all;


%Bentuk fungsi t
Ts=0.05;
t=0:0.05:10;
R=10;C=1
y1=R*(1-exp(-(1/(R*C))*t));

figure(1)
plot(y1)
grid on
ylabel('Output y');
xlabel('sampling ke k');

%Bentuk fungsi s (transfer function)


C=1;L=0.1;R=10;
num=[C 0];
den=[L*C R*C 1];
sysc=tf(num,den)
y2=impulse(sysc);

figure(2)
plot(y2)
grid on
ylabel('Output y');
xlabel('sampling ke k');
%bentuk fungsi t langsung
y3=2*exp(-2*t).*sin(16*t);

figure(3)
plot(y3)
grid on
ylabel('Output');
xlabel('sampling ke k dengan
Ts=0.05');
04 SPS Konversi Model
clear all;clc; close all;
syms s
Fs=1/(s^2+3*s+2);
Ft=ilaplace(Fs)

num=[5 2];den=[1 1 2];


Ts=0.01;
t=0:Ts:5;
sysc=tf(num,den)
sysd=c2d(sysc,Ts)
yc=impulse(sysc,t);
yd=impulse(sysd);
figure(1)
plot(yc,'-k')
hold on
plot(yd,'-.b')
grid on
ylabel('Output y');
xlabel('sampling ke k');
05 SPS Model diskrit
clear all;clc; close all;
syms s
Fs=1/(s^2+3*s+2);
Ft=ilaplace(Fs)
num=[5 2];den=[1 1 2];
Ts=0.01;
t=0:Ts:5;

sysc=tf(num,den)
sysd=c2d(sysc,Ts)
yc=impulse(sysc,t);
yd=impulse(sysd);

figure(1)
plot(yc,'-k')
hold on
plot(yd,'-.b')
grid on
ylabel('Output y');
xlabel('sampling ke k');
figure(2)
stairs(yc,'-k')
grid on
ylabel('Output y');
xlabel('sampling ke k');

tst=0:0.5:10;
ycs=impulse(sysc,tst);
figure(3)
stairs(ycs,'-k')
grid on
ylabel('Output y');
xlabel('sampling ke k');

You might also like