Presentation is loading. Please wait.

Presentation is loading. Please wait.

HossamTalaat - MATLAB Course - KSU - 17/08/14231 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink (part 2) By Prof. Hossam.

Similar presentations


Presentation on theme: "HossamTalaat - MATLAB Course - KSU - 17/08/14231 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink (part 2) By Prof. Hossam."— Presentation transcript:

1 HossamTalaat - MATLAB Course - KSU - 17/08/14231 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink (part 2) By Prof. Hossam Talaat

2 HossamTalaat - MATLAB Course - KSU - 17/08/14232 Step-by-Step Model Construction Design of a First order L.P.F. Theoretical Background

3 HossamTalaat - MATLAB Course - KSU - 17/08/14233 Required Construct a Simulink Model that describes the dynamic performance of a L.P.F. Use an original low frequency signal x with a noise high frequency signal y: x=100 sin(120  t) y= 10 sin(4000  t).

4 HossamTalaat - MATLAB Course - KSU - 17/08/14234 Step I Insert a “sine wave” input from Sources. Copy it to have another one. Double click each one to adjust its parameters (Amplitude and Freq.). Edit the Block name. Right-click to adjust foreground color.

5 HossamTalaat - MATLAB Course - KSU - 17/08/14235 Step II Insert a “scope” from Sinks. Double click it then select parameters icon to set “no. of axes” = 2. Use mouse to connect each of the sine wave outputs to one of the scope inputs. Name the two signals.

6 HossamTalaat - MATLAB Course - KSU - 17/08/14236 Step III Use the icon on toolbar to start simulation. Double-click the scope to check the signals. If the obtained plots are not as expected select simulation parameters and adjust the stop time (say 0.05), the max step (say 0.00001), the min and initial steps (say 0.000001) and relative accurracy (say 1e- 6).

7 HossamTalaat - MATLAB Course - KSU - 17/08/14237 Step IV Insert a “sum” from Math. Connect the output of each sine to on of the sum inputs. Connect the output of sum to a scope. Start simulation and verify if the plot is as expected..

8 HossamTalaat - MATLAB Course - KSU - 17/08/14238 Step V Insert a transfer function ”T.F.” from continuous. Set its parameters such that the numerator =1 and denominator = 0.00001 s +1. Name it L.P.F Connect the output of sum to the input of the T.F.

9 HossamTalaat - MATLAB Course - KSU - 17/08/14239 Step VI Insert a scope and name it “filtered signal”. Connect the output of T.F. to the scope input. Start simulation then verify the obtained plot. Change the time constant to 0.0001,.001 and.01 and comment.

10 HossamTalaat - MATLAB Course - KSU - 17/08/142310 Step VII Insert a scope and name it “filtered signal”. Connect the output of T.F. to the scope input. Start simulation then verify the obtained plot. Change the time constant to 0.0001,.001 and.01 and comment.

11 HossamTalaat - MATLAB Course - KSU - 17/08/142311 Step VIII Insert a scope with 2 inputs to compare the filtered and unfiltered signals.

12 HossamTalaat - MATLAB Course - KSU - 17/08/142312 Step IX Select the L.P.F. block. From edit select “Create subsystem”. Name it L.P.F. Double click to verify. Set the numerator to “k” (gain) and the denominator to Ts +1 (T is the time constant).

13 HossamTalaat - MATLAB Course - KSU - 17/08/142313 Step X Close the subsystem From edit select “Mask the subsystem”. In the “Initialization” tab under prompt write Gain and under variable k. Click Add then write Time Constant and T. Double click the subsystem and set k and T as required.

14 HossamTalaat - MATLAB Course - KSU - 17/08/142314 Find the Roots of a Second Order Equation Theoretical Background The roots of are

15 HossamTalaat - MATLAB Course - KSU - 17/08/142315 Required Construct a Simulink subsystem that calculates the two roots. The input to the subsystem is the three constants A, B, C. The outputs of the subsystem are the two roots.

16 HossamTalaat - MATLAB Course - KSU - 17/08/142316 Step I Insert 4 constant blocks from “Sources” 3 for A,B&C and 1 for (-2). Insert two product blocks from Math. Double click each one to adjust its parameters as the shown function. Connect as shown

17 HossamTalaat - MATLAB Course - KSU - 17/08/142317 Step II Insert 2 “Math function” from Math and adjust one to a square the other to square root. Insert a “sum” from Math. Connect as shown

18 HossamTalaat - MATLAB Course - KSU - 17/08/142318 Step III Insert 2 “sum” from Math and adjust them as shown. Insert 2 “display” from “Sinks”. Connect as shown

19 HossamTalaat - MATLAB Course - KSU - 17/08/142319 Step IV Select the whole system except the three input constants and the 2 output display. Select Create subsystem from Edit Name the new subsystem “Roots of 2 nd order Equation”. Name the inputs and outputs of the Subsystem

20 HossamTalaat - MATLAB Course - KSU - 17/08/142320 End of tutorial


Download ppt "HossamTalaat - MATLAB Course - KSU - 17/08/14231 IEEE Student Branch - College of Engineering - KSU Getting started with Simulink (part 2) By Prof. Hossam."

Similar presentations


Ads by Google