1 / 33

PH36010 Numerical Methods

PH36010 Numerical Methods. Advanced Plotting and Animation. Advanced Plotting in MathCAD. Polar Plots 3D Plots Surface Contour Scatter Bar Vector Field Plots. Polar Plots #1. X-Y Plot wrapped around a circle. r=cos 2 ( q ). Polar Plots #2. r=e k q. Uses for Polar Plots.

lazarus
Download Presentation

PH36010 Numerical Methods

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PH36010 Numerical Methods Advanced Plotting and Animation

  2. Advanced Plotting in MathCAD • Polar Plots • 3D Plots • Surface • Contour • Scatter • Bar • Vector Field Plots

  3. Polar Plots #1 • X-Y Plot wrapped around a circle r=cos2(q)

  4. Polar Plots #2 • r=ekq

  5. Uses for Polar Plots • Rotating Machines • Stirling engine • Vibration • Arctic & Antarctic systems

  6. 3D surface plotsSimple #1 • Plot of data stored in array • Indices of array represent x-y plane • Value of matrix is z value • Define size of matrix & indices • Determine values for x & y • Fill matrix • Plot

  7. 3D surface plotsSimple #2 • Define size & indices • Define Range for x & y • 2D-Gaussian • Fill matrix

  8. 3D surface plotsSimple #3

  9. 3D surface plotsSimple #4 – Lighting

  10. Contour Plot- from 3d plot data • Format plot type -> Contour plot

  11. Simple 3D plotsLimitations • X & Y axes scaled in indices • Suited to continuous single valued functions • More advanced 3D plots available

  12. 3D Scatter plot • Plot of individual points • Supply with 3 vectors of equal length (X,Y,Z) • Points plotted: • X0,Y0,Z0 • X1,Y1,Z1 • …

  13. 3D scatter plotPhoton Scatter in 3D

  14. 3D surface plotsParametric Plot • Plot complex surfaces • From Resource Centre Guide to 3D plotting

  15. 3D parametric plotExample - 1002 for H X- & Y-Axes scaled in m

  16. Parametric PlotsHow to… #1 • Rubber sheet N x M • Wrap sheet around surface • XXa,b is x-coord of point a,b • YYa,b is y-coord of point a,b • ZZa,b is z-coord of point a,b • (XX,YY,ZZ) will plot surface

  17. Parametric PlotsExample 1 - Gaussian • Ranges defined as before • Fill XX & YY matrices • Fill ZZ matrix

  18. Parametric PlotsExample 1 - Gaussian • Note: • Axes scaled

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

  20. Parametric PlotsPolar 3D #1 • Create r vector0-10 radii, 100 teps • Create q vector-180..180 deg, 30 steps • Fill X & Y vectors

  21. Paramteric PlotsPolar 3D #2 Define 100 function Fill Z matrix with 100 function NB Only depends on r

  22. 3D parametric plotExample - 1002 for H X- & Y-Axes scaled in m

  23. Plot of 2102 for H • X & Y matrices as before • Z now depends on r,q

  24. 3D parametric plotExample - 2102 for H

  25. Pretty Pictures From Resource Centre Plot multiple Surfaces

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

  27. Animation Principles • Make output depend on FRAME • Tools|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 Visualization

  28. AnimationHints and Tips • Fix scale of graphs • Watch out for: • Size of AVI files • Long calculation times • Can test by usingFRAME:= • Delete afterwards • Put indicator in movie

  29. Animation Example #1 Cannon Ball with drag

  30. Animation Example #2LCR at resonance

  31. Animation Example #3Heat Flow in Plate

  32. Animation Example #4Planetary Orbits

  33. 3D with lighting & shadows

More Related