To Perform A Block Diagram Reduction Using MATLAB - Matlab Examples
To Perform A Block Diagram Reduction Using MATLAB - Matlab Examples
ToperformablockdiagramreductionusingMATLAB|MatlabExamples
Matlab Examples
Do You Speak Matlab?
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
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
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/] .
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
https://matlabexamples.wordpress.com/2013/11/29/toperformablockdiagramreductionusingmatlab/
5/5