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

1 / 8
About This Presentation
Title:

12'010 Computational Methods of Scientific Programming

Description:

Generating animated sequence with Matlab. Basic mode of use: ... Grace -- Similar to KaleidaGraph available free for Unix systems. ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 9
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 Energy calculation for Question 3.
  • Final Project and homework solution 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_Lec24_Mathematica.nb gives
    examples for some problems that developed
  • Question 2 OK
  • Question 3 NDSolve was the way to solve this
    problem along with FindRoot.
  • Energy calculation Most integrated (including my
    solution) but energy could have been added to
    differential equation. (Example in notebook
    above)
  • Nearly everyone neglected that drag and rider
    force depends on total velocity not just the
    horizontal velocity.

4
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

5
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

6
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

7
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

8
Summary
  • Looked at Mathematica homework solution
  • Example of 3-D Numerical integration Project
  • Graphics packages
  • Projects
  • Presentations Thursday Dec 7. Each presentation
    and demonstration should 15 minutes.
  • Presentation should include brief description of
    project including role of each participant and a
    demonstration of project.
  • Final write-ups and code, due electronically Tues
    Dec 12.
  • We will also do class evaluations
Write a Comment
User Comments (0)
About PowerShow.com