1 / 55

Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege

Engr/Math/Physics 25. Chp5 MATLAB Plots & Models 3. Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu. Learning Goals. List the Elements of a COMPLETE Plots e.g.; axis labels, legend, units, etc. Construct Complete Cartesian (XY) plots using MATLAB

kasen
Télécharger la présentation

Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Engr/Math/Physics 25 Chp5 MATLABPlots & Models 3 Bruce Mayer, PE Licensed Electrical & Mechanical EngineerBMayer@ChabotCollege.edu

  2. 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. 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. Rectilinear Plots do Not Reveal Important Features when one or both of the variables range over several orders of magnitude Logarithmic Plots >> 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

  5. Important Points to Remember You cannot plot negative numbers on a log scale Recall the logarithm of a negative number is not defined as a real number You cannot plot the number 0 (zero)on a log scale Recall log10(0) = ln(0) = − Therefore choose an appropriately small number (e.g., 10−18) as the lower limit on the plot. 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 102 = 100. Making Logarithmic Plots

  6. Gridlines and tick marks within a decadeare 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. 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 Making Logarithmic Plots cont

  7. MATLAB has three commands for generating plots with log scales: Use the loglog(x,y) command to have both scales logarithmic. Use the semilogx(x,y) command to have the x scale logarithmic and the y scale RECTILINEAR. Use the semilogy(x,y) command to have the y scale logarithmic and the x scale RECTILINEAR MATLAB Log & semiLog Plots

  8. Again Plot SemiLog Plot Comparisons semilogx(x,y), xlabel('x'), ylabel('y') semilogy(x,y), xlabel('x'), ylabel('y') • x → log; y → linear • x → linear; y → log

  9. Consider a Simple RC “Voltage Divider” Example  Low Pass Filter • Finding the Magnitude of Gv 4.7 kΩ 22 nF • By the Methods of Junior-Level EE Find the Voltage “Gain”, Gv • In this Case the Time Constant, RC

  10. Recall the Mag of G Example  Low Pass Filter Plot • Thus Make a log-log Plot for M (called a “Bode” Plot) with the Domain • 102≤ω≤106 • Lets “Center” out the Gv(ω) plot at ω = 1/τ = 9671 rad/s  104 rad/s

  11. Low Pass Filter Plot 4.7 kΩ 22 nF • This Ckt Leaves UNCHANGED, or PASSES, Low Frequency signals, but attenuates High Frequency Versions 70.7% left at ω = 1/τ 1% left at 106

  12. 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. 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. Recall the Sagging Cantilever Beam Interactive Plotting • Plot Sag vs Time Using Interactive to • Go From This • To This Time For Live Demo

  15. Example  Consider a Humidification Vapor-Generator used to Fabricate Integrated Circuits 3D Surface Plots • A Carrier Gas, Nitrogen in this case, “bubbles” thru the Liquid Chemical, Becoming Humidified in the Process • The “Bubbler OutPut”, Qmix, is the sum of Carrier N2, QN2, and the Chem Vapor, Qv

  16. Patent 5,078,922 Bubbler in Operation Water Surface Bubble Carrier N2 Flow Rate in slpm 6.35 mm Sparger Tube

  17. The Details of Bubbler Operation Found in Bubbler-OutPut Physics • Chemical Vapor Output • Phs Absolute Pressure in Bubbler HeadSpace • Pv = Thermodynamic Vapor Pressure

  18. Over a substantial Range of Temperatures Between Freezing & Boiling The ThermoDyamic Vapor Pressure of the Liquid Chemical Can be described by the Antoine Eqn1 Bubbler Physics • Where • T  Absolute Temperature • A, B, C are CONSTANTS in Units consistent with T & Pv 1. R. C. Reid, J. M. Prausnitz, B. E. Poling, Properties of Gases & Liquids, 4th Ed., New York, McGraw-Hill, 1987, pg 208

  19. In many cases C  0 In This Case The Antione Eqn Reduces to the Clapeyron Eqn2 Bubbler Physics cont • Then the Bubbler Eqn in terms of the Independent Vars QN2, Phs & T • or • Thus Pv(T) 2. R. C. Reid, J. M. Prausnitz, B. E. Poling, Properties of Gases & Liquids, 4th Ed., New York, McGraw-Hill, 1987, pg 206

  20. Thus the Normalized Output, Qo, Can be Modulated by Pressure and Temperature Control We would Now Like to Plot Qo(Phs,T) for The Chemical TEOS Bubbler Physics cont • From the Manufacturer’s Data A summarized in [Mayer96], Find the Antoine/Clapeyron Constants for Pv in Torr • A = 19.3197 • B = 5562.30 Kelvins

  21. General Synonyms: ethyl silicate, tetraethoxysilane, silicic acid tetraethyl ester, TEOS, tetraethyl silicate Molecular formula: (C2H5O)4Si 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 H2O → 17.54 mm-Hg Liquid Density (g/cm3): 0.94 Flash point: 39 C (closed cup) TEOS Chemical/Physical Data http://ptcl.chem.ox.ac.uk/MSDS/TE/tetraethyl_orthosilicate.html

  22. Thus for TEOS the Clapeyron Eqn Bubbler OutPut - TEOS • We Now Want to Make a MATLAB Plot of Qo,TEOS for these Conditions • Now the TEOS Bubbler Normally Operates under these Conditions • T: 60-85 °C = 333-358 K • Phs: 250-750 Torr

  23. The Command Session mesh Plot Example Time For Live Demo >> 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 252 (225) points Bubbler_Qo_of_TPhs_1010.m

  24. mesh Plot Result

  25. 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')

  26. 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 Qo Plot with a 500x500 Grid → 250 000 Points • Along with the 250 000 Qo calc Points, MATLAB had to operate on a Half a MILLION pts (took “forever”)

  27. The Command Session contour Plot Example >> 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')

  28. X → Phs X → T contour Plot Result

  29. Other 3D Plot Commands

  30. Other 3D Plot Commands cont meshz surf

  31. 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

  32. All Done for Today Excel Plot:BubblerOutPut

  33. Engr/Math/Physics 25 Appendix Time For Live Demo Bruce Mayer, PE Licensed Electrical & Mechanical EngineerBMayer@ChabotCollege.edu

  34. Starting Commands Interactive-1 >> 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)

  35. Interactive-2

  36. Interactive-3

  37. Interactive-4

  38. Interactive-5

  39. Interactive-6

  40. Interactive-7

  41. Activate the FIGURE PALETTE Interactive-8 DoubleClick

  42. Interactive-9

  43. Activate Axis-Title Format Box by Double-Clicking the Title Interactive 10

  44. Interactive-11 • Change the Plot BackGround Color to Match the PowerPoint BackGround

  45. Interactive 12

  46. Interactive 13

  47. COPY FIGURE result

  48. 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)

  49. 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.

More Related