You are on page 1of 5

17/10/2016

ToperformablockdiagramreductionusingMATLAB|MatlabExamples

Matlab Examples
Do You Speak Matlab?

To perform a block diagram reduction


usingMATLAB
Its not convenient to derive a complex transfer function for a complex control system, therefore, the
transfer function of each element of a control system is represented by a block diagram and the concerned
system mentioned in the block represents the transfer function of the element. This symbolic
representation in short form gives a pictorial representation relating the output and the input of a control
system based on cause and eect approach.

Simple Block Diagram

Block diagram shown above. Here G1(s) and G2(s) represents the transfer function of the individual
elements of a control system. The system given is a feedback system or can also be called a closed loop
system. The output signal C(s) is fed back to be compared with the input R(s) , the dierence E(s)=[R(s) C(S)]
is actuating signal or error signal.

Problem: To reduce the given block diagram using sumblk and Ind impulse,step and ramp response.

https://matlabexamples.wordpress.com/2013/11/29/toperformablockdiagramreductionusingmatlab/

1/5

17/10/2016

ToperformablockdiagramreductionusingMATLAB|MatlabExamples

Given Block Diagram

Matlab Program

%
%Experiment2BlockDiagramReduction
%BySiddharthKaul
%
%
%ReducethegivenBlockDiagramusingsumblkfunction.
%[seetheimageattached]
%
%Given
s=tf('s');
G1=1/(s+1);
G2=2/((s^2)+(5*s)+100);
G3=10/((2*s)+1);
G4=100/(s+1);
%
%Nowwearerequiredtodefinealltheblocksinputandoutput.Asshown
%below.Usingthesedefinedinputoutputwewillbeusingsumblk
G1.InputName='r';
G1.OutputName='ug1';
G2.InputName='e';
G2.OutputName='ug2';
G3.InputName='ym';
G3.OutputName='y';
G4.InputName='u';
G4.OutputName='ym';
%
%Note:Nowwearerequiredtorelatealltheseinputsandoutputs.Why??
https://matlabexamples.wordpress.com/2013/11/29/toperformablockdiagramreductionusingmatlab/

2/5

17/10/2016

ToperformablockdiagramreductionusingMATLAB|MatlabExamples

%Becausetherearetwosummingpointsinourblockdiagram.Thisway
%matlabwillbeabletorelatethetransferfuctionwitheachother.
%Youcannoticeymisouroutputanditsnotattachedtoanysummingpoint
%henceitisnotincludedinthesumming.
%
sum1=sumblk('e','r','y','+');%e=ry
sum2=sumblk('u','ug1','ug2');%u=ug1+ug2
%Restisprettysimple
%wehavetofindtherelationshipbetweenrandymforouroutputtransfer
%function.
OutputTF=connect(G1,G2,G4,G3,sum1,sum2,'r','ym');
%
%Calculatingresponses.Responsestakenintoaccountarestepand
%ramp.Otherscanalsobeincluded.Ageneralisedformhasbeengiven
%below.
%
%FirstImpulse
inputTime=[0:.1:10];
[outputResp,time]=impulse(OutputTF,inputTime);
subplot(3,1,1);
plot(time,outputResp);
title('ImpulseResponse');
xlabel('Time>');
ylabel('Magnitude>');
%StepResponse
inputTime=[0:.1:10];
inputSignal=ones(size(inputTime));
[outputResp,time]=step(OutputTF);%,inputSignal,inputTime);
subplot(3,1,2);
plot(time,outputResp);
title('StepResponse');
xlabel('Time>');
ylabel('Magnitude>');
%RampResponse
inputTime=[0:.1:10];
inputSignal=1*inputTime;
[outputResp,time]=lsim(OutputTF,inputSignal,inputTime);
subplot(3,1,3);
plot(time,outputResp);
title('RampResponse');
xlabel('Time>');
ylabel('Magnitude>');
%
%EndofProgram.CreatedBySiddharthKaul
%

Output:

https://matlabexamples.wordpress.com/2013/11/29/toperformablockdiagramreductionusingmatlab/

3/5

17/10/2016

ToperformablockdiagramreductionusingMATLAB|MatlabExamples

Given Block Diagrams Output Response

This entry was posted in State Space Modelling and tagged Block Diagram, Block Diagram Reduction, Matlab
Programming on November 29, 2013 [https://matlabexamples.wordpress.com/2013/11/29/to-perform-ablock-diagram-reduction-using-matlab/] .

4 thoughts on To perform a block diagram reduction usingMATLAB

Pingback: Eects of addition of poles and zeros to closed loop transfer function | MyClassBook
Pingback: Addition of poles and zeros to the forward path transfer function MATLAB Program |
MyClassBook
Pingback: Eects of addition of poles and zeros to closed loop transfer function - MyClassBook

Asim
https://matlabexamples.wordpress.com/2013/11/29/toperformablockdiagramreductionusingmatlab/

4/5

17/10/2016

ToperformablockdiagramreductionusingMATLAB|MatlabExamples

April 2, 2016 at 6:44 am

Very Good Example.

https://matlabexamples.wordpress.com/2013/11/29/toperformablockdiagramreductionusingmatlab/

5/5

You might also like