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

## 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:

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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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*(1- 0.01*x.^2).^2 + 0.02*x.^2)./((1-x.^2).^2 + 0.1*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

BMayer@ChabotCollege.edu 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.

BMayer@ChabotCollege.edu 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 3000. This separation is referred to as a decade or cycle

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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')

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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 10 6 70.7% left at ω = 1/τ This Ckt Leaves UNCHANGED, or PASSES, Low Frequency signals, but attenuates High Frequency Versions

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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([0.8 1 1]); % Chg Plot BackGround to Blue-Green plot(x,y, zxv,zyv, 'k', zxh,zyh, 'k', 'LineWidth', 3),axis([-6 6 -6 6]),... grid, xlabel('\fontsize{14}x'), ylabel('\fontsize{14}y = f(x)'),... title(['\fontsize{16}MTH15 Bruce Mayer, PE',]),... annotation('textbox',[.51.05.0.1], 'FitBoxToText', 'on', 'EdgeColor', 'none', 'String', 'XYfcnGraph6x6BlueGreenBkGndTemplate1306.m','FontSize',7)

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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 = 19.3197 B = 5562.30 Kelvins

BMayer@ChabotCollege.edu 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 → 17.54 mm-Hg Liquid Density (g/cm 3 ): 0.94 Flash point: 39 C (closed cup) http://ptcl.chem.ox.ac.uk/MSDS/TE/tetraethyl_orthosilicate.html

BMayer@ChabotCollege.edu 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: 60-85 °C = 333-358 K P hs : 250-750 Torr

BMayer@ChabotCollege.edu 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 = 19.3197; B = 5562.30; >> 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

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

BMayer@ChabotCollege.edu 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')

BMayer@ChabotCollege.edu 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 → 250 000 Points Along with the 250 000 Q o calc Points, MATLAB had to operate on a Half a MILLION pts (took “forever”)

BMayer@ChabotCollege.edu 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 = 19.3197; B = 5562.30; >> 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')

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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

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

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

BMayer@ChabotCollege.edu 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)

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

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

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

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

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

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

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

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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

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

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

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

BMayer@ChabotCollege.edu 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)

BMayer@ChabotCollege.edu 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.

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

BMayer@ChabotCollege.edu 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

BMayer@ChabotCollege.edu 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

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

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

Similar presentations