12'010 Computational Methods of Scientific Programming - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

12'010 Computational Methods of Scientific Programming

Description:

Generating animated sequence with ... Graphics Programs. Basic data plotting programs: ... Grace -- Similar to KaleidaGraph available free for Unix systems. ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 10
Provided by: ThomasA85
Learn more at: http://www-gpsg.mit.edu
Category:

less

Transcript and Presenter's Notes

Title: 12'010 Computational Methods of Scientific Programming


1
12.010 Computational Methods of Scientific
Programming
  • Lecturers
  • Thomas A Herring, Room 54-618, tah_at_mit.edu
  • Chris Hill, Room 54-1511, cnh_at_gulf.mit.edu
  • Web page http//www-gpsg.mit.edu/tah/12.010

2
Overview Today
  • Review some aspects of Homework 4 (Mathematica).
  • Look at formatting of question 1
  • Look at FindRoot and NDSolve for Question 3.
  • Final Project Examine Matlab N-body project to
    show
  • methods Animation
  • Solution using odeXX differential equation solver
    in Matlab
  • End by looking at some graphics packages

3
Mathematica Homework
  • Question 1 Formatting output was trickyThe
    notebook 12.010_Lec20_Mathematica.nb gives
    examples for some solutions
  • Question 2 OK, features from 5.2 Mathematica
    used
  • Question 3 NDSolve was the way to solve this
    problem along with FindRoot

4
Final Project
  • Example case for N-body problem
  • N-body planetary problem that use Runge-Kutta
    numerical integration with variable step size.
  • Demonstrate basic use of this program (tar file
    on web site)
  • Graphics usage in gui-form Basic methods can be
    used in your projects.

5
Graphics real-time output in Matlab
  • In Matlab we can consider real time out put
    the results
  • When a plot is made you can set an EraseMode
  • Options are
  • none leaves all points on the screen
  • background paints old points with background
    color. Erases old points but also erases any
    other information such as grid lines and text
  • xor Exclusive or. Erases just the previously
    plotted points, leaves the background intact

6
Generating animated sequence with Matlab
  • Basic mode of use
  • Plot first point keeping the graphics handle
  • p plot3(x,y,z,., EraseMode,xor)
  • Set the axis limits (Need to think of values to
    use here.
  • axis(-100 100 -100 100 -100 100)
  • hold on
  • Now generate the sequence of points
  • Loop over time steps, compute new x y z
  • set(p,Xdata,x,Ydata,y,Zdata,z)
  • Drawnow
  • These ideas were demonstrated in Matlab M-file

7
ODE Solvers
  • Use of ODE Solvers in Matlab (demonstrated in
    class)
  • Vector y is 2-d position and velocity (14).
  • y0 0.0 0.0 vx vz
  • t,y,te,ye,ie ode23(_at_bacc,01tmax,y0,options
    )
  • The bacc routine computes accelerations. dy/dt is
    returned so that dy1d(pos)/dty3
    dy2y4 and dy3 and dy4 are new
    accelerations
  • function dy bacc(t, y)
  • acc Computes accelerations
  • Options sets ability to detect event such as
    hitting ground
  • options odeset('AbsTol',terr 1 1
    1,'Events','hit')
  • function value,isterminal,direction hit(t,y)
  • Value returns the height.
  • Look through Matlab help and use demo program

8
Graphics Programs
  • Basic data plotting programs
  • There a number of programs which fall into this
    basic category
  • KaleidaGraph commercial program runs on PC and
    Mac (150) (web http//www.synergy.com)
  • Tecplot Available on Athena (Unix and PC)
    (1300) (web http//www.amtec.com/)
  • Grace -- Similar to KaleidaGraph available free
    for Unix systems. The old version is called
    xmgr. (http//plasma-gate.weizmann.ac.il/Grace/
  • Demo of basic features of these types of programs

9
Summary
  • Looked at Mathematica homework solution
  • Example of 3-D Numerical integration Project
  • Graphics packages
  • Matlab homework due Thursday Dec 1.
Write a Comment
User Comments (0)
About PowerShow.com