We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published bySage Roxby
Modified about 1 year ago
Insight Through Computing 10. Plotting Continuous Functions Linspace Array Operations
Insight Through Computing Table Plot x sin(x) Plot based on 5 points
Insight Through Computing Table Plot x sin(x) Plot based on 9 points
Insight Through Computing Table Plot Plot based on 200 points—looks smooth
Insight Through Computing Generating Tables and Plots x sin(x) x = linspace(0,2*pi,9); y = sin(x); plot(x,y)
Insight Through Computing linspace x = linspace(1,3,5) x : “x is a table of values” “x is an array” “x is a vector”
Insight Through Computing linspace x = linspace(0,1,101) … x :
Insight Through Computing Linspace Syntax linspace(,, ) Left Endpoint Right Endpoint Number of Points
Insight Through Computing Built-In Functions Accept Arrays x sin(x) sin And…
Insight Through Computing Return Array of Function-evals x sin(x) sin
Insight Through Computing x = linspace(0,1,200); y = exp(x); plot(x,y) x = linspace(1,10,200); y = log(x); plot(x,y) Examples
Insight Through Computing Can We Plot This? -2 <= x <= 3
Insight Through Computing Can We Plot This? -2 <= x <= 3 x = linspace(-2,3,200); y = sin(5*x).*exp(-x/2)./(1 + x.^2) plot(x,y) Array operations Yes!
Insight Through Computing Must Learn How to Operate on Arrays Look at four simpler plotting challenges.
Insight Through Computing Example 1
Insight Through Computing Scale (*) a: s: c: c = s*a
Insight Through Computing Addition a: b: c: c = a + b
Insight Through Computing Subtraction a: b: c: c = a - b
Insight Through Computing E.g.1 Sol’n x = linspace(0,4*pi,200); y1 = sin(x); y2 = cos(3*x); y3 = sin(20*x); y = 2*y1 - y2 +.1*y3; plot(x,y)
Insight Through Computing Example 2.
Insight Through Computing Exponentiation a: s: c: c = a.^s.^
Insight Through Computing Shift a: s: c: c = a + s
Insight Through Computing Reciprocation a: c: c = 1./a
Insight Through Computing E.g.2 Sol’n x = linspace(-5,5,200); y = 5./(1+ x.^2); plot(x,y)
Insight Through Computing Example 3.
Insight Through Computing Negation a: c: c = -a
Insight Through Computing Scale (/) a: s: c: c = a/s
Insight Through Computing Multiplication a: b: c: c = a.* b.*
Insight Through Computing E.g.3 Sol’n x = linspace(0,3,200); y = exp(-x/2).*sin(10*x); plot(x,y)
Insight Through Computing Example 4.
Insight Through Computing Division a: b: c: c = a./ b./
Insight Through Computing E.g.4 Sol’n x = linspace(-2*pi,2*pi,200); y = (.2*x.^3 - x)./(1.1 + cos(x)); plot(x,y)
Insight Through Computing Question Time How many errors in the following statement given that x = linspace(0,1,100): Y = (3*x.+ 1)/(1 + x^2) A. 0 B. 1 C. 2 D. 3 E. 4
Insight Through Computing Question Time How many errors in the following statement given that x = linspace(0,1,100): Y = (3*x.+ 1)/(1 + x^2) A. 0 B. 1 C. 2 D. 3 E. 4 Y = (3*x + 1)./ (1 + x.^2)
Insight Through Computing Question Time Does this assign to y the values sin(0 o ), sin(1 o ),…,sin(90 o )? x = linspace(0,pi/2,90); y = sin(x); A. Yes B. No
Insight Through Computing Question Time Does this assign to y the values sin(0 o ), sin(1 o ),…,sin(90 o )? %x = linspace(0,pi/2,90); x = linspace(0,pi/2,91); y = sin(x); A. Yes B. No
Insight Through Computing b = linspace(.1,1,100); a = 1; h = (a - b)./(a + b); P1 = pi*(a+b); P2 = pi*sqrt(2*(a^2+b.^2)); P3 = pi*sqrt(2*(a^2+b.^2)-… ((a - b).^2)/2); P4 = pi*(a + b).*(1 + h/8).^2; plot(b,P1,b,P2,b,P3,b,P4) Ellipse Perimeter Estimates
Insight Through Computing Ellipse Perimeter Estimates
Insight Through Computing Plotting an Ellipse Better:
Insight Through Computing Solution a = input(‘Major semiaxis:’); b = input(‘Minor semiaxis:’); t = linspace(0,2*pi,200); x = a*cos(t); y = b*sin(t); plot(x,y) axis equal off
Insight Through Computing a = 5, b = 3
2.2 Limits Involving Infinity Finite Limits as – The symbol for infinity does not represent a real number. – We use infinity to describe the behavior of.
© Boardworks Ltd of 5 Graphs of quadratic functions.
Ordered pairs are used to locate points in a coordinate plane. x-axis (horizontal axis) origin (0,0) y-axis (vertical axis)
Graphs of Straight Lines How to graph equations and find equations from graphs.
LIMITS What is Calculus? What are Limits? Evaluating Limits –Graphically –Numerically –Analytically What is Continuity? Infinite Limits This presentation.
Section 4.2 Graphing Linear Equations Using Tables Wednesday 11/13/13 Class Notes.
IN ON UNDER IN FRONT OF BEHIND BETWEEN NEXT TO NEAR ON THE LEFT OF ON THE RIGHT OF.
Finding x- and y-intercepts algebraically. y-intercepts For every point along the y-axis, the value of x will be zero (x=0) We can use this fact to find.
Maximum ??? Minimum??? How can we tell? and decreasing just to the right of c, then f has a local minimum at c If f is increasing just to the left of a.
Part 4 Chapter 16 Splines and Piecewise Interpolation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Searching for an Application for Consent Tutorial 2.
MM2A3. Students will analyze quadratic functions in the forms f(x) = ax 2 + bx + c and f(x) = a(x – h) 2 + k. c. Investigate and explain characteristics.
Goal: By the end of the lesson, students will be able to find the slope of a line from a graph.
3.2 Graphing Quadratic Functions in Vertex or Intercept Form Definitions Definitions 3 Forms 3 Forms Graphing in vertex form Graphing in vertex form Examples.
Dot plots. What is an Individual? Individual: Individuals are the objects described by a set of data. Individuals may be people, but they may also be.
Graphing Absolute Value Functions Section 2.6 in your textbook.
Copyright © Cengage Learning. All rights reserved. 3 Exponential and Logarithmic Functions.
Vector Functions and Space Curves. A vector function is a function with domain the set of real numbers and with range a set of vectors. As t varies, the.
Data Structures Using C++ 2E The Big-O Notation and Array-Based Lists.
Improper Integrals II. Improper Integrals II by Mika Seppälä Improper Integrals An integral is improper if either: the interval of integration is infinitely.
3.1 Extrema On An Interval. After this lesson, you should be able to: Understand the definition of extrema of a function on an interval Understand the.
Section 18.2 Computing Line Integrals over Parameterized Curves.
Copyright © 2003 Pearson Education, Inc. Slide 1.
1 Integers and the Number Line. 2 Constructing a Number Line A number line is drawn by choosing a starting position, usually 0, and marking off equal.
One method of graphing a linear equation is to construct a table of values. Example: Consider the equation y = 2x + 3 xy When x = 0, y =
MATLAB Tutorial ECE 002 Professor S. Ahmadi. Tutorial Outline Functions using M-files. Numerical Integration using the Trapezoidal Rule. Example #1: Numerical.
Binomial Expansion and Maclaurin series Department of Mathematics University of Leicester.
Determining signs of Trig Functions (Pos/Neg) x y Last class we found trig values using an x-y coordinate. Not all trig values are positive We can determine.
Image Processing using Matlab Sumitha Balasuriya http//www.dcs.gla.ac.uk/~sumitha/
Holt Algebra Properties of Quadratic Functions in Standard Form axis of symmetry standard form minimum value maximum value Vocabulary.
© 2016 SlidePlayer.com Inc. All rights reserved.