Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

1 ENGR-25_Plot_Model-3.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Chp5 MATLAB Plots & Models 3

2 ENGR-25_Plot_Model-3.ppt 2 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals  List the Elements of a COMPLETE Plots e.g.; axis labels, legend, units, etc.  Construct Complete Cartesian (XY) plots using MATLAB Modify or Specify MATLAB Plot Elements: Line Types, Data Markers,Tic Marks  Distinguish between INTERPolation and EXTRAPolation

3 ENGR-25_Plot_Model-3.ppt 3 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals cont  Construct using MATLAB SemiLog and LogLog Cartesian Plots  Use MATLAB’s InterActive Plotting Utility to Fine-Tune Plot Appearance  Use MATLAB to Produce 3-Dimensional Plots, including Surface Plots Contour Plots

4 ENGR-25_Plot_Model-3.ppt 4 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Logarithmic Plots  Rectilinear Plots do Not Reveal Important Features when one or both of the variables range over several orders of magnitude >> x = [0:0.1:100]; >> y = sqrt((100*( *x.^2).^ *x.^2)./((1-x.^2).^ *x.^2)); >> plot(x,y), xlabel('x'), ylabel('y'); >> loglog(x,y), xlabel('x'), ylabel('y')  Rectilinear Plot  Log-Log Plot LogLog Plot is MUCH More Revealing

5 ENGR-25_Plot_Model-3.ppt 5 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Making Logarithmic Plots  Important Points to Remember 1.You cannot plot negative numbers on a log scale –Recall the logarithm of a negative number is not defined as a real number 2.You cannot plot the number 0 (zero) on a log scale – Recall log 10 (0) = ln(0) = −   Therefore choose an appropriately small number (e.g., 10 −18 ) as the lower limit on the plot. 3.Tick-mark labels on a log scale are the actual values being plotted; they are not logs of the No.s –The x values in the previous log-log plot range over 10 −1 = 0.1 to 10 2 = 100.

6 ENGR-25_Plot_Model-3.ppt 6 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Making Logarithmic Plots cont 4.Gridlines and tick marks within a decade are unevenly spaced. –If 8 gridlines or tick marks occur within the decade, they correspond to values equal to 2, 3, 4,..., 8, 9 times the value represented by the first gridline or tick mark of the decade. 5.Equal distances on a log scale correspond to multiplication by the same constant –as opposed to addition of the same constant on a rectilinear scale –e.g.; all numbers that differ by a factor of 10 are separated by the same distance on a log scale. That is, the distance between 0.3 and 3 is the same as the distance between 300 and This separation is referred to as a decade or cycle

7 ENGR-25_Plot_Model-3.ppt 7 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods MATLAB Log & semiLog Plots  MATLAB has three commands for generating plots with log scales: 1.Use the loglog(x,y) command to have both scales logarithmic. 2.Use the semilogx(x,y) command to have the x scale logarithmic and the y scale RECTILINEAR. 3.Use the semilogy(x,y) command to have the y scale logarithmic and the x scale RECTILINEAR

8 ENGR-25_Plot_Model-3.ppt 8 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SemiLog Plot Comparisons  Again Plot  x → log; y → linear  x → linear; y → log semilogx(x,y), xlabel('x'), ylabel('y') semilogy(x,y), xlabel('x'), ylabel('y')

9 ENGR-25_Plot_Model-3.ppt 9 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example  Low Pass Filter  Consider a Simple RC “Voltage Divider” 4.7 kΩ 22 nF  By the Methods of Junior-Level EE Find the Voltage “Gain”, G v  In this Case the Time Constant, RC  Finding the Magnitude of G v

10 ENGR-25_Plot_Model-3.ppt 10 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example  Low Pass Filter Plot  Recall the Mag of G  Lets “Center” out the M(ω) plot at ωτ = 1  Thus ω = 1/τ = 9671 rad/s  10 4 rad/s  Thus Make a log-log Plot for M(ω) (called a “Bode” Plot) with the Domain 10 2 ≤ ω ≤ 10 6

11 ENGR-25_Plot_Model-3.ppt 11 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Low Pass Filter Plot 4.7 kΩ 22 nF 1% left at % left at ω = 1/τ This Ckt Leaves UNCHANGED, or PASSES, Low Frequency signals, but attenuates High Frequency Versions

12 ENGR-25_Plot_Model-3.ppt 12 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive Plotting in MATLAB  The “SemiAutomatic” interface can be very convenient when You Need to create a large number of different types of plots, Construct plots involving many data sets, Want to add annotations such as rectangles and ellipses Desire to change plot characteristics such as tick spacing, fonts, bolding, italics, and colors

13 ENGR-25_Plot_Model-3.ppt 13 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods MATLAB Interactive Plots cont MATLAB Interactive Plots cont  The interactive plotting environment in MATLAB Includes tools for Creating different types of graphs, Selecting variables to plot directly from the Workspace Browser Creating and editing subplots, Adding annotations such as lines, arrows, text, rectangles, and ellipses, and Editing properties of graphics objects, such as their color, line weight, and font

14 ENGR-25_Plot_Model-3.ppt 14 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive Plotting  Go From This  To This  Recall the Sagging Cantilever Beam Plot Sag vs Time Using Interactive to

15 ENGR-25_Plot_Model-3.ppt 15 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

16 ENGR-25_Plot_Model-3.ppt 16 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Format Plots by Coding  A Tedious Process for ONE-Time Use HELP must be consulted a LOT to implement Complex Formatting  Useful for Constructing a Personal “Standard Format” for Plots

17 ENGR-25_Plot_Model-3.ppt 17 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Code for Previous Plot % Bruce Mayer, PE % MTH-15 23Jun13 % XY_fcn_Graph_6x6_BlueGreen_BkGnd_Template_1306.m % % The FUNCTION x = linspace(-6,6,500); y = -x.^2/3 +5.5; % % The ZERO Lines zxh = [-6 6]; zyh = [0 0]; zxv = [0 0]; zyv = [-6 6]; % % the 6x6 Plot axes; set(gca,'FontSize',12); whitebg([ ]); % Chg Plot BackGround to Blue-Green plot(x,y, zxv,zyv, 'k', zxh,zyh, 'k', 'LineWidth', 3),axis([ ]),... grid, xlabel('\fontsize{14}x'), ylabel('\fontsize{14}y = f(x)'),... title(['\fontsize{16}MTH15 Bruce Mayer, PE',]),... annotation('textbox',[ ], 'FitBoxToText', 'on', 'EdgeColor', 'none', 'String', 'XYfcnGraph6x6BlueGreenBkGndTemplate1306.m','FontSize',7)

18 ENGR-25_Plot_Model-3.ppt 18 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 3D Surface Plots  Example  Consider a Humidification Vapor-Generator used to Fabricate Integrated Circuits  A Carrier Gas, Nitrogen in this case, “bubbles” thru the Liquid Chemical, Becoming Humidified in the Process  The “Bubbler OutPut”, Q mix, is the sum of Carrier N 2, Q N2, and the Chem Vapor, Q v

19 ENGR-25_Plot_Model-3.ppt 19 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Patent 5,078,922 Bubbler in Operation Carrier N 2 Flow Rate in slpm Bubble 6.35 mm Sparger Tube Water Surface

20 ENGR-25_Plot_Model-3.ppt 20 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bubbler-OutPut Physics  The Details of Bubbler Operation Found in  Chemical Vapor Output P hs  Absolute Pressure in Bubbler HeadSpace P v = Thermodynamic Vapor Pressure

21 ENGR-25_Plot_Model-3.ppt 21 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bubbler Physics  Over a substantial Range of Temperatures Between Freezing & Boiling The ThermoDyamic Vapor Pressure of the Liquid Chemical Can be described by the Antoine Eqn 1  Where T  Absolute Temperature A, B, C are CONSTANTS in Units consistent with T & P v 1. R. C. Reid, J. M. Prausnitz, B. E. Poling, Properties of Gases & Liquids, 4th Ed., New York, McGraw-Hill, 1987, pg 208

22 ENGR-25_Plot_Model-3.ppt 22 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bubbler Physics cont  In many cases C  0  In This Case The Antione Eqn Reduces to the Clapeyron Eqn 2  Then the Bubbler Eqn in terms of the Independent Vars Q N2, P hs & T 2. R. C. Reid, J. M. Prausnitz, B. E. Poling, Properties of Gases & Liquids, 4th Ed., New York, McGraw-Hill, 1987, pg 206  Thus P v (T)  or

23 ENGR-25_Plot_Model-3.ppt 23 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bubbler Physics cont  Thus the Normalized Output, Q o, Can be Modulated by Pressure and Temperature Control  We would Now Like to Plot Q o (P hs,T) for The Chemical TEOS  From the Manufacturer’s Data A summarized in [Mayer96], Find the Antoine/Clapeyron Constants for P v in Torr A = B = Kelvins

24 ENGR-25_Plot_Model-3.ppt 24 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TEOS Chemical/Physical Data  General Synonyms: ethyl silicate, tetraethoxysilane, silicic acid tetraethyl ester, TEOS, tetraethyl silicate Molecular formula: (C 2 H 5 O) 4 Si  Physical data Appearance: colorless liquid with an alcohol-like odor  Physical data Melting point: −86 C Boiling point: 169 C Vapor density: 7.2 (air = 1) Vapor pressure: 2 mm-Hg at 20 C –H 2 O → mm-Hg Liquid Density (g/cm 3 ): 0.94 Flash point: 39 C (closed cup)

25 ENGR-25_Plot_Model-3.ppt 25 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bubbler OutPut - TEOS  Thus for TEOS the Clapeyron Eqn  We Now Want to Make a MATLAB Plot of Q o,TEOS for these Conditions  Now the TEOS Bubbler Normally Operates under these Conditions T: °C = K P hs : Torr

26 ENGR-25_Plot_Model-3.ppt 26 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods mesh Plot Example  The Command Session >> Trng = linspace(333,358,25); >> Prng = linspace(250,750,25); >> [T,Phs] = meshgrid(Trng,Prng); >> A = ; B = ; >> Pv = exp(A - B./T); >> Qo = Pv./(Phs - Pv); >> mesh((T-273),Phs,Qo), xlabel('T (°C)'), ylabel('Phs (Torr)'),... zlabel('Qo (slpm-TEOS/Slpm-N2)'), grid on,... title('Vapor Output From TEOS Bubbler') SQUARE XY Grid of 25 2 (225) points Bubbler_Qo_of_TPhs_1010.m

27 ENGR-25_Plot_Model-3.ppt 27 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods mesh Plot Result

28 ENGR-25_Plot_Model-3.ppt 28 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods mesh Plot Result: Swap X↔Y mesh(Phs,(T-273),Qo), xlabel('Phs (Torr)'), ylabel('T (°C)'),... zlabel('Qo (slpm-TEOS/Slpm- N2)'), grid on,... title('Vapor Output From TEOS Bubbler')

29 ENGR-25_Plot_Model-3.ppt 29 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Mesh Plot Caveats  To Make the Simple Surface Plot Shown the X-Y Grid Must be SQUARE i.e.; [No. X-pts] = [No. Y-pts] –25 in this case  Do NOT make the grid too DENSE I tried the Q o Plot with a 500x500 Grid → Points Along with the Q o calc Points, MATLAB had to operate on a Half a MILLION pts (took “forever”)

30 ENGR-25_Plot_Model-3.ppt 30 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods contour Plot Example  The Command Session >> Trng = linspace(333,358,25); >> Prng = linspace(250,750,25); >> [T,Phs] = meshgrid(Trng,Prng); >> A = ; B = ; >> Pv = exp(A - B./T); >> Qo = Pv./(Phs - Pv); >> contour(Phs,(T-273),Qo), xlabel('Phs (Torr)'), ylabel('T (°C)'),... zlabel('Qo (slpm-TEOS/Slpm-N2)'), grid on,... title('Vapor Output From TEOS Bubbler') >> contour((T-273),Phs,Qo), xlabel('T (°C)'), ylabel('Phs (Torr)'),... zlabel('Qo (slpm-TEOS/Slpm-N2)'), grid on,... title('Vapor Output From TEOS Bubbler')

31 ENGR-25_Plot_Model-3.ppt 31 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods contour Plot Result  X → Phs  X → T

32 ENGR-25_Plot_Model-3.ppt 32 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Other 3D Plot Commands CommandPlot Description [X,Y] = meshgrid(x,y) Creates the matrices X and Y from the vectors x and y to define a rectangular grid [X,Y] = meshgrid(x) Same as [X,Y]= meshgrid(x,x). mesh(x,y,z) Creates a 3D mesh surface plot meshc(x,y,z) Same as mesh but draws contours under the surface meshz(x,y,z) Same as mesh but draws vertical reference lines under the surface

33 ENGR-25_Plot_Model-3.ppt 33 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Other 3D Plot Commands cont CommandPlot Description contour(x,y,z) Creates a contour plot. surf(x,y,z) Creates a shaded 3D mesh surface plot surfc(x,y,z) Same as surf but draws contours under the surface waterfall(x,y,z) Same as mesh but draws mesh lines in one direction only meshzsurf

34 ENGR-25_Plot_Model-3.ppt 34 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Caveat on 3D Surface Plots  3D Surfaces are Difficult for Many ENGINEERS/SCIENTISTS to Quickly Interpret If you have a NonTechnical Audience for your Plots, I suggest Sticking with 2D, Cartesian Plots

35 ENGR-25_Plot_Model-3.ppt 35 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods All Done for Today Excel Plot: Bubbler OutPut

36 ENGR-25_Plot_Model-3.ppt 36 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Appendix

37 ENGR-25_Plot_Model-3.ppt 37 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-1  Starting Commands >> delY_mm = [0, 2, 4, 4.5, 5.5, 6, 6.5, 8, 9, 11]; >> t_min = [0, 2, 4, 6, 9, 12, 15, 18, 21, 24]; >> plot(t_min, delY_mm)

38 ENGR-25_Plot_Model-3.ppt 38 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-2

39 ENGR-25_Plot_Model-3.ppt 39 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-3

40 ENGR-25_Plot_Model-3.ppt 40 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-4

41 ENGR-25_Plot_Model-3.ppt 41 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-5

42 ENGR-25_Plot_Model-3.ppt 42 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-6

43 ENGR-25_Plot_Model-3.ppt 43 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-7

44 ENGR-25_Plot_Model-3.ppt 44 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-8  Activate the FIGURE PALETTE Double Click

45 ENGR-25_Plot_Model-3.ppt 45 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-9

46 ENGR-25_Plot_Model-3.ppt 46 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive 10  Activate Axis- Title Format Box by Double- Clicking the Title

47 ENGR-25_Plot_Model-3.ppt 47 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive-11  Change the Plot BackGround Color to Match the PowerPoint BackGround

48 ENGR-25_Plot_Model-3.ppt 48 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive 12

49 ENGR-25_Plot_Model-3.ppt 49 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Interactive 13

50 ENGR-25_Plot_Model-3.ppt 50 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods COPY FIGURE result

51 ENGR-25_Plot_Model-3.ppt 51 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods WJ’s Patented Bubbler  C. C. Collins, M. A. Richie, F. F. Walker, B. C. Goodrich, L. B. Campbell, “Liquid Source Bubbler”, United States Patent 5,078,922 (Jan 1992)

52 ENGR-25_Plot_Model-3.ppt 52 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods WJ Bubbler Design Schematic diagram of a the WJ chemical vapor generating bubbler system used in CVD applications. Note the use of the dilution MFC to maintain constant mass flow in the output line. An automatic temperature controller sets the electric heater power level Cut-away view of a WJ chemical source vapor bubbler. The bubbler features a total internal volume of  0.95 liters, and a 25 mm thick isothermal mass jacket with an exterior diameter of  180 mm.

53 ENGR-25_Plot_Model-3.ppt 53 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Graphics from [Mayer96]

54 ENGR-25_Plot_Model-3.ppt 54 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Why Plot?  Engineering, Math, and Science are QUANTITATIVE Endeavors, we want NUMBERS as Well as Words  Many times we Need to Understand The (functional) relationship between two or More Variables Compare the Values of MANY Data sets

55 ENGR-25_Plot_Model-3.ppt 55 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Plot Title Axis Title Tic Mark Tic Mark Label Legend Data Symbol Annotations Axis UNITS Connecting Line

56 ENGR-25_Plot_Model-3.ppt 56 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

57 ENGR-25_Plot_Model-3.ppt 57 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods


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

Similar presentations


Ads by Google