PH36010 Numerical Methods Advanced Plotting and Animation.

Slides:



Advertisements
Similar presentations
MS-Word XP Lesson 7.
Advertisements

MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Animation and CS Philip Chan. Animation Hand-drawn Early Disney movies.
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 10.
Material obtained from a Guilford County Workshop, July, 2014 V
Introduction to Matlab:
An Introduction to MathCAD
Post-processing J.Cugnoni, LMAF/EPFL, Finite element « outputs » Essential variables:  Displacement u, temperature T find u such that : K u = f.
Maths for Computer Graphics
Mechanical Engineering Dept.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
Lecture 6: Surface Integrals Recall, area is a vector (0,1,0) (1,0,0) x y z (1,0,1) (0,1,1) Vector area of this surface is which has sensible magnitude.
Charts and Macros Pretty Pictures. Charts Graphical display of information Often referred to as “Visualization” Allows a more innate grasp of numeric.
Lecture 7 Sept 19, 11 Goals: two-dimensional arrays (continued) matrix operations circuit analysis using Matlab image processing – simple examples Chapter.
Revision – A simple program How to start a program? How to end a program? How to declare variables? What are the mathematical operators? How to start a.
Lecture 6 Sept 15, 09 Goals: two-dimensional arrays matrix operations circuit analysis using Matlab image processing – simple examples.
Introduction to 3D Graphics Lecture 3: General Camera Model Anthony Steed University College London.
The Finite Element Method
2IV60 Computer Graphics Basic Math for CG
Instructor: Professor Cora Martinez, PhD Department of Civil and Environmental Engineering Florida International University.
Infinity-project.org Engineering education for today’s classroom The Infinity Project SM LabVIEW for The Infinity Project.
Geometric Intuition Randy Gaul. Vectors, Points and Basis Matrices Rotation Matrices Dot product and how it’s useful Cross product and how it’s useful.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
13.1 day 2 level curves. Level curves One way to visualize a function of two variables is to use a scalar field in which the scalar z = f(x,y) is assigned.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
PART A3A - ADDITION Give the general formula for adding 2 complex numbers z1 = a + bi and z2 = c + di Give a simple example demonstrating the addition.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
MATLAB WORKSHOP FOR EE 327FOR EE 327 MWF 8: AMMWF 8: AM August 26-30, 2002August 26-30, 2002 Dr. Ali A. Jalali.
Computational Biology, Part E Basic Principles of Computer Graphics Robert F. Murphy Copyright  1996, 1999, 2000, All rights reserved.
Chapter 10: Graphics MATLAB for Scientist and Engineers Using Symbolic Toolbox.
PSOD Lecture 2. Matrices and vectors in Chemical & Process Engineering Appear in calculations when process is described by the system of equations:
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
From Simulation to Visualization: Astrophysics Goes Hollywood Frank Summers January 17, 2002.
1 Principles of IT Using the Tool Palette Vocabulary Copyright © Texas Education Agency, All rights reserved.
Matlab 14.html Cost: $100 Available in labs on Windows and Unix machines.
Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful.
; Copyright © 1999, 2000, 2001 rht+sg Introduction to Vectors and Frames CIS Russell Taylor Sarah Graham.
Chapter 7 Advanced Part Modeling Techniques. After completing this chapter, you will be able to perform the following: –Extrude an open profile –Create.
PH15720 Laboratory Techniques - An Introduction to MATHCAD.
Digital Image Processing Lecture4: Fundamentals. Digital Image Representation An image can be defined as a two- dimensional function, f(x,y), where x.
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
Rotation matrices 1 Constructing rotation matricesEigenvectors and eigenvalues 0 x y.
Finite Element Analysis
2D Routines in 3D. Outline Announcements –HW II--due Friday. 5PM HW1 & Cookie Grids & Meshes Representing f(x,y) Lines & Surfaces in 3D Survey.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Computer Graphics, KKU. Lecture 41 The Computer Programming Laws Any given program, when running, is obsolete. Any given program costs more and.
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
PH15720 Laboratory Techniques - An Introduction to MATHCAD.
Do Now: #16 on p.518 Find the length of the curve. Evaluate numerically…
Jeff Howbert Introduction to Machine Learning Winter Machine Learning MATLAB Essentials.
PH15010 Laboratory Techniques - An Introduction to MATHCAD.
SolidWorks Teacher Guide Lesson11 School’s Name Teacher’s Name Date.
Plots of Fluid Flow Data Profile plots- A profile plot indicates how the value of a scalar (or vector can be plotted but only the magnitude) property varies.
CSA2 – ADVANCED FUNCTIONS AND CHARTS (A DAY) & (B DAY) ADVANCED FUNCTIONS - are used in higher-level operations, such as in conditional.
An Introduction to Programming in Matlab Emily Blumenthal
Chapter 7 Advanced Part Modeling Techniques. After completing this chapter, you will be able to perform the following: –Extrude an open profile –Create.
EEE 242 Computer Tools for Electrical Engineering
Creating cast members  Using tool palette window that can be selected from window menu.  The following objects can be created: Push buttons, Radio buttons,
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.
Chapter 1 Computing Tools Variables, Scalars, and Arrays Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
13.4 Product of Two Matrices
Fig. 1 Acoustic space for the method of images: (a) 2D corner; (b) 3D corner; (c) infinite or 2D wedge; (d) semi-infinite or 3D wedge. Half-space is not.
MATLAB DENC 2533 ECADD LAB 9.
Polarization.
MATLAB stands for MATrix LABoratory.
Polarization.
Presentation transcript:

PH36010 Numerical Methods Advanced Plotting and Animation

Advanced Plotting in MathCAD Polar PlotsPolar Plots 3D Plots3D Plots –Surface –Contour –Scatter –Bar Vector Field PlotsVector Field Plots

Polar Plots #1 X-Y Plot wrapped around a circleX-Y Plot wrapped around a circle r=cos 2 (  )

Polar Plots #2 r=e k r=e k 

Uses for Polar Plots Rotating MachinesRotating Machines –Stirling engine –Vibration Arctic & Antarctic systemsArctic & Antarctic systems

3D surface plots Simple #1 Plot of data stored in arrayPlot of data stored in array Indices of array represent x-y planeIndices of array represent x-y plane Value of matrix is z valueValue of matrix is z value –Define size of matrix & indices –Determine values for x & y –Fill matrix –Plot

3D surface plots Simple #2 Define size & indicesDefine size & indices Define Range for x & yDefine Range for x & y 2D-Gaussian2D-Gaussian Fill matrixFill matrix

3D surface plots Simple #3

3D surface plots Simple #4 – Lighting

Contour Plot - from 3d plot data Format plot type -> Contour plotFormat plot type -> Contour plot

Simple 3D plots Limitations X & Y axes scaled in indicesX & Y axes scaled in indices Suited to continuous single valued functionsSuited to continuous single valued functions More advanced 3D plots availableMore advanced 3D plots available

3D Scatter plot Plot of individual pointsPlot of individual points Supply with 3 vectors of equal length (X,Y,Z)Supply with 3 vectors of equal length (X,Y,Z) Points plotted:Points plotted: –X 0,Y 0,Z 0 –X 1,Y 1,Z 1 –…–…–…–…

3D scatter plot Photon Scatter in 3D

3D surface plots Parametric Plot Plot complex surfacesPlot complex surfaces From Resource Centre Guide to 3D plottingFrom Resource Centre Guide to 3D plotting

3D parametric plot Example -  for H X- & Y- Axes scaled in m

Parametric Plots How to… #1 Rubber sheet N x MRubber sheet N x M Wrap sheet around surfaceWrap sheet around surface XX a,b is x-coord of point a,bXX a,b is x-coord of point a,b YY a,b is y-coord of point a,bYY a,b is y-coord of point a,b ZZ a,b is z-coord of point a,bZZ a,b is z-coord of point a,b (XX,YY,ZZ) will plot surface(XX,YY,ZZ) will plot surface

Parametric Plots Example 1 - Gaussian Ranges defined as beforeRanges defined as before Fill XX & YY matricesFill XX & YY matrices Fill ZZ matrixFill ZZ matrix

Parametric Plots Example 1 - Gaussian Note:Note: –Axes scaled

A short diversion Simple Program #1 Often need to create a vector containing a range of valuesOften need to create a vector containing a range of values Create function to do this using MathCAD program stepsCreate function to do this using MathCAD program steps Use in graphics programsUse in graphics programs

The SeriesVector() program  (increment) and i (loop count) are ‘local’ to function. Function builds Result vector Returned on last line of program

Testing the SeriesVector() function

Parametric Plots Polar 3D #1 Create r vector 0-10 radii, 100 tepsCreate r vector 0-10 radii, 100 teps Create  vector deg, 30 stepsCreate  vector deg, 30 steps Fill X & Y vectorsFill X & Y vectors

Paramteric Plots Polar 3D #2 Define  100 function Fill Z matrix with  100 function  100 function NB Only depends on r

3D parametric plot Example -  for H X- & Y- Axes scaled in m

Plot of  for H X & Y matrices as beforeX & Y matrices as before Z now depends on r,qZ now depends on r,q

3D parametric plot Example -  for H

Vector Field Plots #1 Arrows give strength & direction of field at each point of plot.Arrows give strength & direction of field at each point of plot. Constructed from either:Constructed from either: –Matrix of complex numbers –2 identical matrices of real numbers

Vector Field Plots #2 From Resource Centre Example function to plotExample function to plot Gradient function of f(x,y)Gradient function of f(x,y)

Vector Field Plot Surface Plot Vector Field Plot

Pretty Pictures #1 From Resource Centre Chain of Tori Pyramid

Pretty Pictures From Resource Centre Plot multiple Surfaces

Pretty Pictures #3 Planetary Orbit 3 objects3 objects –Planet : (xe,ye,ze) –Star : (xs,ys,zs) –Orbit: (xp,yp,zp)

Animation Principles Make output depend on FRAMEMake output depend on FRAME Tools|Animation|Record… to display dialogTools|Animation|Record… to display dialog –Fill in first & last frames –Drag cursor around area to animate –Select ‘Animate’ to go –View with AVI player –Save to disk Help|Quicksheets|Graphing and VisualizationHelp|Quicksheets|Graphing and Visualization

Animation Hints and Tips Fix scale of graphsFix scale of graphs Watch out for:Watch out for: –Size of AVI files –Long calculation times Can test by using FRAME:=Can test by using FRAME:= –Delete afterwards Put indicator in moviePut indicator in movie

Animation Example #1 Cannon Ball with drag

Animation Example #2 LCR at resonance

Animation Example #3 Heat Flow in Plate

Animation Example #4 Planetary Orbits

3D with lighting & shadows

Ideas for projects Bouncing ballsBouncing balls –Gravity –Snooker Electron clouds around HElectron clouds around H Simulation of Ion ImplantationSimulation of Ion Implantation Heat flow by finite differenceHeat flow by finite difference