[FX,FY,FZ,...] = GRADIENT(F,...) [FX,FY,FZ,…] is numerical gradient of matrix F Distance between grid points in X,Y,Z,… direction FX corresponds to dF/dx,

Slides:



Advertisements
Similar presentations
Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed.
Advertisements

Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
EE3321 ELECTROMAGENTIC FIELD THEORY
Chapter 11 Above: Principal contraction rates calculated from GPS velocities. Visualized using MATLAB.
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
PARTIAL DERIVATIVES 14. PARTIAL DERIVATIVES 14.6 Directional Derivatives and the Gradient Vector In this section, we will learn how to find: The rate.
Maths for Computer Graphics
Matlab for Visualization Ray Gasser IS&T Scientific Visualization Tutorial – Spring 2010.
17 VECTOR CALCULUS.
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
VECTOR CALCULUS VECTOR CALCULUS Here, we define two operations that:  Can be performed on vector fields.  Play a basic role in the applications.
Introduction to Matlab 332:202 Discrete Mathematics Spring 2007.
The Coordinate Plane coordinate plane In coordinate Geometry, grid paper is used to locate points. The plane of the grid is called the coordinate plane.
Plotting 1.Overview 2.plot in 2D 3.Plot in 3D 4.Other possible charts 5.Engineers: label your plots! 6.Plots & Polynomial.
 1999 BG Mobasseri1 8/29/2015 MATLAB GRAPHICS - PART II ADVANCED PLOTTING June 4, ‘99.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
1 Chapter 2 Vector Calculus 1.Elementary 2.Vector Product 3.Differentiation of Vectors 4.Integration of Vectors 5.Del Operator or Nabla (Symbol  ) 6.Polar.
CMPS 1371 Introduction to Computing for Engineers PLOTTING.
MATLAB Week 4 01 December Outline More plotting – A few other 3-D plotting functions – Basic volume visualization Creating functions Vectorized.
Copyright © Cengage Learning. All rights reserved.
CDS 301 Spring, 2013 CH3: MATLAB 3-D Visualization February 07, TBD Jie Zhang Copyright ©
Parametric Equations. In a rectangular coordinate system, you will recall, a point in the plane is represented by an ordered pair of number (x,y), where.
Drill #16 List the relation (set of ordered pairs) and the domain and range of the following mapping: Draw a mapping, and state the domain and range.
Barak Shenhav Early Evolution Course 11 Feb 2001 MATLAB Visualization, Functions & Debugging.
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
 In mathematics, we use a grid to locate points..
1.1 Functions This section deals with the topic of functions, one of the most important topics in all of mathematics. Let’s discuss the idea of the Cartesian.
Numerical Analysis 3D Plots. A numerical method is a technique for computing a numerical approximation of the solution to a mathematical problem.
Recap Plots with More than one Line Plots of Complex Arrays Line, Color and Mark Style Axis Scaling and Annotating Plots Subplots Polar Plots Logarithmic.
Vector Analysis 15 Copyright © Cengage Learning. All rights reserved.
Angular Velocity: Sect Overview only. For details, see text! Consider a particle moving on arbitrary path in space: –At a given instant, it can.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Program design and algorithm development We will consider the design of your own toolbox to be included among the toolboxes already available with your.
GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Deniz Savas & Mike Griffiths May 2015.
By Danny Nguyen and Jimmy Nguyen.  Graph solids in space.  Use the Distance and Midpoint Formulas for points in space.
2-1 Relations and Functions Objective: To graph a relation, state its domain and range, and determine if it is a function, and to find values of functions.
Drill #10 List the relation (set of ordered pairs) and the domain and range of the following mapping: 1. Find the value of the following if f(x) = 2.f(
Motion Quiz. 1. The slope of a position (distance) vs time graph equals what quantity of the motion?
EEE 242 Computer Tools for Electrical Engineering
1-2 What is the Matlab environment? How can you create vectors ? What does the colon : operator do? How does the use of the built-in linspace function.
Lecture 17 More Plotting Chapter 12 Matrices. Outline from Chapter D Plotting 11.4 Surface Plots 11.5 Interacting with Plotted Data.
MA2213 Lecture 10 ODE. Topics Importance p Introduction to the theory p Numerical methods Forward Euler p. 383 Richardson’s extrapolation.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
Advanced Plotting Techniques Chapter 11 Above: Principal contraction rates calculated from GPS velocities. Visualized using MATLAB.
Copyright © Cengage Learning. All rights reserved.
Chapter 2 Vector Calculus
Reading and Writing Image Files
Vectors and the Geometry
ENEE222 Elements of Discrete Signal Analysis Lab 11 1.
3D-Graphs A 3D surface is defined as: z = f(x, y)
Ch3 Graphics Overview of Plotting Editing Plots
Graphing Equations and Inequalities
Two-Dimensional Plots
Graphing Ordered Pairs
Copyright © Cengage Learning. All rights reserved.
The Coordinate Plane Chapter 2 Integers pg. 88.
Vectors and the Geometry
Section 17.1 Parameterized Curves
/s Fig. P3.18, p.72.
MATH 1310 Section 1.1.
What do you think will be the values of y?
Finding the Total Area y= 2x +1 y= x Area = Area =
MATH 1310 Section 1.1.
Copyright © Cengage Learning. All rights reserved.
العلاقات والدوال أ. ريما عباس ريض 152.
Finding the Total Area y= 2x +1 y= x Area = Area =
Lesson 2-4 The Coordinate Plane
MATH 1310 Section 1.1.
Presentation transcript:

[FX,FY,FZ,...] = GRADIENT(F,...) [FX,FY,FZ,…] is numerical gradient of matrix F Distance between grid points in X,Y,Z,… direction FX corresponds to dF/dx, the differences in the x (column) direction

[x,y] = meshgrid(-2:.2:2, -2:.2:2); z = x.* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.2); contour(z),hold on, quiver(px,py), hold off [x,y] = meshgrid(-2:1:2, -2:1:2) Create a mesh on the domain of the function z. Examples: x(4,5)=1 y(4,5)=2 x(2,2)=-1 y(2,5)=2 (1,1) (1,2) (1,3) (1,4) (1,5) (2,1) (2,2) (2,3) (2,4) (2,5) (3,1) (3,2) (3,3) (3,4) (3,5) (4,1) (4,2) (4,3) (4,4) (4,5) (5,1) (5,2) (5,3) (5,4) (5,5) x y

(1,1) (1,2) (1,3) (1,4) (1,5) (2,1) (2,2) (2,3) (2,4) (2,5) (3,1) (3,2) (3,3) (3,4) (3,5) (4,1) (4,2) (4,3) (4,4) (4,5) (5,1) (5,2) (5,3) (5,4) (5,5) x y [x,y] = meshgrid(-2:.2:2, -2:.2:2); z = x.* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.2); contour(z),hold on, quiver(px,py), hold off z=x.*exp(-x.^2-y.^2) Element by element operation X(4,5)=1 Y(4,5)=2 Z(4,5)=1*exp(-1^2-2^2)=exp(-5)=

(1,1) (1,2) (1,3) (1,4) (1,5) (2,1) (2,2) (2,3) (2,4) (2,5) (3,1) (3,2) (3,3) (3,4) (3,5) (4,1) (4,2) (4,3) (4,4) (4,5) (5,1) (5,2) (5,3) (5,4) (5,5) x y [x,y] = meshgrid(-2:.2:2, -2:.2:2); z = x.* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.2); contour(z),hold on, quiver(px,py), hold off [px,py]=gradient(z,1,1) px = py =

CONTOUR(Z) is a contour plot of matrix Z treating the values in Z as heights above a plane. A contour plot are the level curves of Z for some values V. The values V are chosen automatically. px = py = z = x.* exp(-x.^2 - y.^2); [x,y] = meshgrid(-2:.2:2, -2:.2:2); z = x.* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.2); contour(z),hold on, quiver(px,py), hold off

[x,y] = meshgrid(-2:.2:2, -2:.2:2); z = x.* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.2); contour(z),hold on, quiver(px,py), hold off HOLD ON holds the current plot and all axis properties so that subsequent graphing commands add to the existing graph. HOLD OFF returns to the default mode whereby PLOT commands erase the previous plots and reset all axis properties before drawing new plots.

DIV = DIVERGENCE(X,Y,Z,U,V,W) computes the divergence of a 3-D vector field U,V,W. The arrays X,Y,Z define the coordinates for U,V,W and must be monotonic and 3-D plaid (as if produced by MESHGRID). load wind div = divergence(x,y,z,u,v,w); slice(x,y,z,div,[90 134],[59],[0]); shading interp daspect([1 1 1]) camlight

load wind div = divergence(x,y,z,u,v,w); slice(x,y,z,div,[90 134],[59],[0]); shading interp daspect([1 1 1]) camlight Wind is an array of (41,35,15). x z y Slice at (90,59,0) Origin: (70.2,17.5,0) End: (134.3, 60, 16)

load wind div = divergence(x,y,z,u,v,w); slice(x,y,z,div,[90 134],[59],[0]); shading interp daspect([1 1 1]) camlight

load wind div = divergence(x,y,z,u,v,w); slice(x,y,z,div,[90 134],[59],[0]); shading interp daspect([1 1 1]) camlight

load wind div = divergence(x,y,z,u,v,w); slice(x,y,z,div,[90 134],[59],[0]); shading interp daspect([1 1 1]) camlight

[CURLX, CURLY, CURLZ, CAV] = CURL(X,Y,Z,U,V,W) computes the curl and angular velocity perpendicular to the flow (in radians per time unit) of a 3D vector field U,V,W. The arrays X,Y,Z define the coordinates for U,V,W and must be monotonic and 3D plaid (as if produced by MESHGRID). Ω

load wind cav = curl(x,y,z,u,v,w); slice(x,y,z,cav,[90 134],[59],[0]); shading interp daspect([1 1 1]); axis tight colormap hot(16) camlight

L = DEL2(U), when U is a matrix, is a discrete approximation of 0.25*del^2 u = (d^2u/dx^2 + d^2/dy^2)/4. The matrix L is the same size as U, with each element equal to the difference between an element of U and the average of its four neighbors.