Presentation is loading. Please wait.

Presentation is loading. Please wait.

ENGR-25_Lec-25_SimuLink-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.

Similar presentations


Presentation on theme: "ENGR-25_Lec-25_SimuLink-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical."— Presentation transcript:

1 ENGR-25_Lec-25_SimuLink-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Chp10: SimuLink-1

2 ENGR-25_Lec-25_SimuLink-1.ppt 2 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals  Implement Mathematical Operations in MATLAB using SimuLink InterConnected Functional Blocks  Employ FeedBack in the SimuLink Environment to numerically Solve ODEs  Create Simulations of Dynamic Control Systems using SimuLink Block Models Export Simulation result to MATLAB WorkSpace for Further Analysis

3 ENGR-25_Lec-25_SimuLink-1.ppt 3 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods What is SIMULINK?  SIMULINK is a tool for modeling, analyzing, and simulating a wide variety of physical & mathematical systems, including those with nonlinear elements and those which make use of continuous and discrete time  Applications Can be found in Dynamic Control Systems, Signal Processing, Communications, and other time-varying systems.

4 ENGR-25_Lec-25_SimuLink-1.ppt 4 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods More on SimuLink  SimuLink is a Graphical Environment where Math Operations are represented by BLOCK Icons Allows for FEEDBACK of Control Vars  Since SimuLink is used to Analyze Dynamic (time-varying) Systems, there are many References to the Variable, ‘s‘ s follows from LaPlace Transforms –Studied in 3 rd year courses on Electrical, or Dynamic Mechanical, Systems-Control

5 ENGR-25_Lec-25_SimuLink-1.ppt 5 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink Some More  Since LaPlace Transforms, and Dynamic-System Control Theory are beyond the scope of this Class, we will learn SimuLink by example  The Least intuitive Concept Employed will be FEEDBACK The LaPlace Transform

6 ENGR-25_Lec-25_SimuLink-1.ppt 6 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob 10.2 Solution (book typo)  Use FEEDBACK to Find y(t) for ODE

7 ENGR-25_Lec-25_SimuLink-1.ppt 7 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-1 Fire Up Simulink Library Browser

8 ENGR-25_Lec-25_SimuLink-1.ppt 8 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-2 Open “Model” Window/File

9 ENGR-25_Lec-25_SimuLink-1.ppt 9 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-3 The “Untitled” Model” Window

10 ENGR-25_Lec-25_SimuLink-1.ppt 10 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-4 Select “Sources” Library Drag SineWave icon to Model Window

11 ENGR-25_Lec-25_SimuLink-1.ppt 11 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-5 DoubleClick SineWave icon to Open Block- Parameters Dialog Box No Changes Needed

12 ENGR-25_Lec-25_SimuLink-1.ppt 12 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-6 Select “Math Ops” Library Drag Gain icon to Model Window

13 ENGR-25_Lec-25_SimuLink-1.ppt 13 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-7 DoubleClick Gain icon to Open Block-Parameters Dialog Box Set Gain to 10

14 ENGR-25_Lec-25_SimuLink-1.ppt 14 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-8 Set IC to Zero  Select Continous Library  Drag Integrator Block to Model Window  2X-Click the Icon to Open the DiaLog Box  Set the IC to Zero

15 ENGR-25_Lec-25_SimuLink-1.ppt 15 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-9  Select “Sinks”Library  Drag Scope Block to Model Window

16 ENGR-25_Lec-25_SimuLink-1.ppt 16 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-10 CConnect The Block OutPuts & InPuts Turns to Cross when Clik’d

17 ENGR-25_Lec-25_SimuLink-1.ppt 17 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-11  Open the Config Parameters Dialog Box  Set 13s Stop-Time

18 ENGR-25_Lec-25_SimuLink-1.ppt 18 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-12  Start Simulation  Opens the Scope Display  Wait for “Bell” to Sound  2X Click Scope  Clik Binoc’s to AutoScale

19 ENGR-25_Lec-25_SimuLink-1.ppt 19 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink-13  Simulation Result

20 ENGR-25_Lec-25_SimuLink-1.ppt 20 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX (1)  Export Simulation to WorkSpace for Plotting  Add/Subtract icons  2X-Clik “To WorkSpace” icon SINKS Library SOURCES Library SIGNAL ROUTING

21 ENGR-25_Lec-25_SimuLink-1.ppt 21 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX (2)  Export Result  Plot the Result >> plot(y(:,1),y(:,2)), xlabel('t'), ylabel('y'), grid

22 ENGR-25_Lec-25_SimuLink-1.ppt 22 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX (1) (with a few mods)  SimuLink Model for  Thus Simulate  Integrating, Find  Note that the variables are NOT Separable y is on BOTH sides  Then The Model

23 ENGR-25_Lec-25_SimuLink-1.ppt 23 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX (2) → Model Parameters Chg to 2

24 ENGR-25_Lec-25_SimuLink-1.ppt 24 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods (3) → Scope Result (IC=2)

25 ENGR-25_Lec-25_SimuLink-1.ppt 25 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods (4) → Scope Result (IC=0)

26 ENGR-25_Lec-25_SimuLink-1.ppt 26 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX (5) → OutPut Summary plot(y_of_t(:,1), y_of_t(:,2)),grid ODE Parameters Changed

27 ENGR-25_Lec-25_SimuLink-1.ppt 27 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX (6) → Misc

28 ENGR-25_Lec-25_SimuLink-1.ppt 28 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink Help

29 ENGR-25_Lec-25_SimuLink-1.ppt 29 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink Help  3 Choices

30 ENGR-25_Lec-25_SimuLink-1.ppt 30 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Naming SimuLink Blocks  Double-Click on the BlockName PlaceHolder  Type in a DESCRIPTIVE Name

31 ENGR-25_Lec-25_SimuLink-1.ppt 31 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX (1)  10s Simulation  100s Simulation  The SimuLink Model

32 ENGR-25_Lec-25_SimuLink-1.ppt 32 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Caveat: Hidden Functions  Many math Functions do NOT have their own block. Instead they “Hide” in a PullDown menu in another icon.  Examine Some of These.

33 ENGR-25_Lec-25_SimuLink-1.ppt 33 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TRIG Function Pull Down Box  On MATH OPRERATIONS can find SIN but not COS or TAN They are HIDDEN in the “TRIG” icon which just happens to have the label SIN –All the other Major Trig Function reside in this block on a pull Down menu  Start with Change the Lower Function to COS

34 ENGR-25_Lec-25_SimuLink-1.ppt 34 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Sin to Cos by PullDown  2X clik the “sin” icon to Reveal PullDown

35 ENGR-25_Lec-25_SimuLink-1.ppt 35 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Sin to Cos by PullDown  Clik on Cos  Changes Icon to the Cos Function That was easy  Run Sin & Cos

36 ENGR-25_Lec-25_SimuLink-1.ppt 36 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods All Done for Today Running a House Furnace OOne THERM is a unit of heating equal to 100,000 BTU.

37 ENGR-25_Lec-25_SimuLink-1.ppt 37 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Appendix

38 ENGR-25_Lec-25_SimuLink-1.ppt 38 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Problem  ThermoStat Control of Bldg Temp TThe Governing ODE AAlso Solve-For, and Plot, T(t) for Given Parameters WWhere did this Eqn Come from?

39 ENGR-25_Lec-25_SimuLink-1.ppt 39 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (1)  RELAY Block Relay  Switch output between two constants Library → Discontinuities  Relay Parameters

40 ENGR-25_Lec-25_SimuLink-1.ppt 40 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (2)  T-Stat Temp Gain Gain  Multiply the input by a constant Library → Math Operations For Case-2 will change Gain to 40  Fnce Gain  Parameter for Case-1

41 ENGR-25_Lec-25_SimuLink-1.ppt 41 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (3)  Ambient Temperature Model Sine Wave  Generate a sine wave Library → Sources  The Input Parameters for Bias Amplitude Frequency

42 ENGR-25_Lec-25_SimuLink-1.ppt 42 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (4)  Sin Fcn Parameters  The Summing Node Sum  Add or subtract inputs Library → Math Operations

43 ENGR-25_Lec-25_SimuLink-1.ppt 43 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (6)  Sum Parameters  1/RC Gain Block 0.5 per HR  COPY the R*qm Gain Block in Model Space and change Parameters

44 ENGR-25_Lec-25_SimuLink-1.ppt 44 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (7)  Now the LaPlace Integrator Integrator  Integrate a signal Library → Continuous  Integ Parameters

45 ENGR-25_Lec-25_SimuLink-1.ppt 45 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (8)  MUX (Many-to-One) for Ta and T Mux  Combine several input signals into a vector or bus output signal Library → Signal Routing  MUX Parameters for

46 ENGR-25_Lec-25_SimuLink-1.ppt 46 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (9)  Use ToWorkSpace to Send Ta & T to WorkSpace for Plotting To Workspace  Write data to the workspace Library → Sinks  The ToWorkSpace Parameters

47 ENGR-25_Lec-25_SimuLink-1.ppt 47 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (10)  Connect the Dots Be sure to Include FeedBack Link to the ThermoStat Scope Added for Diagnostic PurposesBack Link to the ThermoStat

48 ENGR-25_Lec-25_SimuLink-1.ppt 48 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob (11)  Compare Cases Small Furnace Large Furnace

49 ENGR-25_Lec-25_SimuLink-1.ppt 49 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob 10.15a (12) – Small Fnce % plot(tout, simout), xlabel('t (Hr)'), ylabel('T (°F)'), grid Unstable Inside Temp

50 ENGR-25_Lec-25_SimuLink-1.ppt 50 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob 10.15a (13) – Large Fnce STABLE Inside Temp

51 ENGR-25_Lec-25_SimuLink-1.ppt 51 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob 10.15b (14)  Part (B) → For Stable Temp Control Find Energy Used  The Modify Previous Model  Separate Gain Blok R*qm to gain Access to qm  Scale qm to get scale comparable to T(t)  Copy & Modify Bloks Gain Integrator

52 ENGR-25_Lec-25_SimuLink-1.ppt 52 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob 10.15b (15)  The Energy Integrator Model

53 ENGR-25_Lec-25_SimuLink-1.ppt 53 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob 10.15b (16) – Energy Use Daily Use = BTU/Day = Therm/Day → 21.7 ¢/Day But This Fnce is Microscopic; My Fnce rating is 80 kBTU/Hr

54 ENGR-25_Lec-25_SimuLink-1.ppt 54 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 10.2

55 ENGR-25_Lec-25_SimuLink-1.ppt 55 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 10.2

56 ENGR-25_Lec-25_SimuLink-1.ppt 56 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 10.2

57 ENGR-25_Lec-25_SimuLink-1.ppt 57 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Prob 10.2

58 ENGR-25_Lec-25_SimuLink-1.ppt 58 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink ↔ ODE45

59 ENGR-25_Lec-25_SimuLink-1.ppt 59 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

60 ENGR-25_Lec-25_SimuLink-1.ppt 60 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SimuLink ↔ ODE45

61 ENGR-25_Lec-25_SimuLink-1.ppt 61 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Problem

62 ENGR-25_Lec-25_SimuLink-1.ppt 62 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Problem

63 ENGR-25_Lec-25_SimuLink-1.ppt 63 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Problem

64 ENGR-25_Lec-25_SimuLink-1.ppt 64 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

65 ENGR-25_Lec-25_SimuLink-1.ppt 65 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods P10.2 with various forcing fcns

66 ENGR-25_Lec-25_SimuLink-1.ppt 66 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods mck Exmpl (1)  2X Mass, Spring, Damper System HHow Do x 1 & x 2 respond to the SUDDEN Application of a UNIT Pull (1lb or 1N)? C1C1 C2C2 x1x1 x2x2 f (Pull Force) k1k1 k2k2

67 ENGR-25_Lec-25_SimuLink-1.ppt 67 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX mck (2)  m 1 = 5  m 2 = 3  c 1 = 4  c 2 = 8  k 1 = 1  k 2 = 2 C1C1 C2C2 x1x1 x2x2 f (Pull Force) k1k1 k2k2

68 ENGR-25_Lec-25_SimuLink-1.ppt 68 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX mck (3)  2X Mass, Spring, Damper System  Set Simulation Time and check by 2X click Scope

69 ENGR-25_Lec-25_SimuLink-1.ppt 69 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX mck (4)  Simulation Time = 10s  Auto Scaling the Axes  Positions have NOT Yet Stabilized Try 100s StopTime

70 ENGR-25_Lec-25_SimuLink-1.ppt 70 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods EX mck (5)  StopTime = 100s  Stabilizes after about 25s Use 25s for Stop  Final Offsets x 1 = 1.0 x 2 = 1.25

71 ENGR-25_Lec-25_SimuLink-1.ppt 71 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods P10.2 with various forcing fcns


Download ppt "ENGR-25_Lec-25_SimuLink-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical."

Similar presentations


Ads by Google