MATLAB Plots and Models: Learning Goals and Techniques, Slides of Calculus for Engineers

Learning goals and techniques for creating complete plots using matlab, including constructing cartesian plots, distinguishing between interpolation and extrapolation, creating semi-log and log-log plots, using interactive plotting utility, creating linear-transform math models for physical data, and using regression analysis. It also covers building math models for physical data using nth degree polynomials and using matlab's basic fitting utility.

Typology: Slides

2012/2013

Uploaded on 03/26/2013

abduu
abduu šŸ‡®šŸ‡³

4.4

(49)

195 documents

1 / 41

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Engr/Math/Physics 25
Chp5 MATLAB
Plots & Models 2
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29

Partial preview of the text

Download MATLAB Plots and Models: Learning Goals and Techniques and more Slides Calculus for Engineers in PDF only on Docsity!

Engr/Math/Physics 25

Chp5 MATLAB

Plots & Models 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

Learning Goals cont

  • Use Regression Analysis as quantified by

the ā€œLeast Squaresā€ Method

  • Calculate
    • Sum-of-Squared Errors (SSE or J)
      • The Squared Errors are Called ā€œResidualsā€
    • ā€œBest Fitā€ Coefficients
    • Sum-of-Squares About the Mean (SSM or S)
    • Coefficient of Determination (r 2 )
  • Scale Data if Needed
    • Creates more meaningful spacing

Learning Goals cont

  • Build Math Models for Physical Data using

ā€œnth^ ā€ Degree Polynomials

  • Use MATLAB’s ā€œBasic Fittingā€ Utility to find

Math models for Plotted Data

  • Use MATLAB to Produce 3-Dimensional

Plots, including

  • Surface Plots
  • Contour Plots

Sys3 2X200 MultiBlok, 997671 250-13.8 PreWeld āˆ† P (^) i Tube-

0

25

50

75

100

125

150

175

200

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 Hole Number (1 = closest to Manifold Block)

Individual Hole

Ļ€ P (10X Torr)

DNS Tube-1 BMayer Tube DNS Normalized BMayer Normalized

PARAMETERS • For Single Tube Manifold

  • Flow = ??/0.24 slpm/hole• Exh to Atm Pressure (~750Torr)
  • Test Engr = DNStoddard, BMayer• Test Date = 09Mar00/10Mar

file = HbH997671PreW09Mar00.xls

Tic Mark

Tic Mark Label

Axis UNITS (^) Data Symbol Connecting Line

SubPlots

  • The subplot command creates several smaller ā€œ subplots ā€ in the same figure.
  • The syntax is subplot(m,n,p)
  • This command divides the Figure window into an array of rectangular panes with m rows and n columns.
  • The variable p tells MATLAB to place the output of the plot command following the subplot command into the p th^ pane.

SubPlot Example

  • By the ENGR36 & ENGR45 Methods Analyze how the load affects the Beam in Terms of - SHEARING Force, V - BENDING-Moment, M - Vertical DEFLECTION, y - The V, M, and y functions vs the Normalized Distance Dimension x/L

b h x

y

L

F

( ) (^1) max

VV x = (^) FF =

( ) ( ) (^1) max

MM x = F ā‹… FLx āˆ’ L = x āˆ’ LL = Lx āˆ’

( ) 

 

 (^) ļ£·āˆ’           =    

   

 = (^21)   āˆ’ (^3)   21 3

3 2 2 max L

x L

x L

x L

x y

y x

SubPlot Example

  • We Want to Plot V, M, and y ON TOP of each other vs the common independent Variable, x/L
  • This is a perfect Task for subplot
  • First Construct the functions

b h (^) x

y

L

F

  • Note the use of the ones Command to construct the Constant Shear (V) vector

**>> XoverL = [0:0.01:1]; V = ones(1, length(XoverL))

M = XoverL - 1; y = 0.5((XoverL).^2) .(XoverL -3);**

SubPlot Result

(^00) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1

2

x/L

V/Vmax

Cantilever Beam - Shear

-1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-0.

0

x/L

M/Mmax

Cantilever Beam - Bending

-1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-0.

0

x/L

y/ymax

Cantilever Beam - Deflection

Data-Markers & Line-Types

  • The Data Marker and Line Type specifications in a Plot consist of optional Fields in the Basic plot statement
  • To plot y versus x with a solid line and u versus v with a dashed line, type plot(x,y,u,v,’-- ’) - The symbols ’ -- ’ represent a dashed line
  • To plot y versus x with asterisks () connected with a dotted line, we must plot the data twice by typing plot(x,y,’’,x,y,’:’).

DataMark & LineType Example

ļ‚§ We Would Like to plot the Vertical Deflection, Y, versus time, t, for a Constant Load using

  • Blue Colored Data Makers in the from of a + mark
  • Magenta Colored Dash-Dot (- .) Line to connect the Data Points

DataMark & LineType Example

  • The Command Session for the Creep Plot
    • The Data Set as Row Vectors **>> 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];**

  • The Plot Statement >> plot(t_min,delY_mm, ’b+’, t_min,delY_mm, 'm-.’),... xlabel('Load Application Time, t (min)'),... ylabel('Vertical Deflection, y (mm)'),... title('Polystrene Cantilever Beam Creep'), grid
  • Notice the Data is plotted Twice
  • Notice also the Blue- Plus, and Magenta Dash-Dot Specs

More: Markers, Lines, Colors

  • Don’t forget the 'LineWidth', n Command to make thicker lines
  • MATLAB Provides a Wide Range of Options for Plot-Lines & Plot-Markers Data markers† Dot (.) Asterisk (*) Cross (Ɨ) Circle ( ) Plus sign (+) Square ( ) Diamond ( ) Five-pointed star (ļ‚¶) . * Ɨ + s d p

Line types Solid line Dashed line Dash-dotted line Dotted line

––

  • – -. ….

Colors Black Blue Cyan Green Magenta Red White Yellow

k b c g m r w y

† (^) Other data markers are available. Search for ā€œmarkersā€ or ā€œLineSpecā€ in MATLAB help.

Labeling Curves

  • The legend command automatically obtains from the plot the line type used for each data set and displays a sample of this line type in the legend box next to the selected text-string ļ‚§ For Example again Consider RLC Circuit ā€œRingingā€

V ( ) t = ( 9 V ) e āˆ’^0.^3 t^ cos 13 t ( ) ( )

t d t V e

  1. 3 9

āˆ’ = ±

ļ‚§ We Now wish to plot eāˆ’0.3t^ to Show the ENVELOPE of Exponential Decay