Lecture 9
Lecture 9
ENGG1810/9810
Introduction to Engineering Computing
Week 9: Application I
COMMONWEALTH OF AUSTRALIA
WARNING
The material in this communication may be subject to copyright under the Act.
Any further reproduction or communication of this material by you may be the
subject of copyright protection under the Act.
Week 5: Functions I
Week 6: Functions II Functions
Week 7: Libraries and Modules I
and Packages
Week 9: Application I
Week 5: Functions I
Week 6: Functions II Functions
Week 7: Libraries and Modules I
and Packages
Week 9: Application I
https://colab.research.google.com/drive/1ZcHROLwBYTDC5AUnuCnWTZI2cTgHfA74?usp=sharing
ENGG1810/9810
https://colab.research.google.com/drive/1ZcHROLwBYTDC5AUnuCnWTZI2cTgHfA74?usp=sharing
ENGG1810/9810
https://colab.research.google.com/drive/1ZcHROLwBYTDC5AUnuCnWTZI2cTgHfA74?usp=sharing
s
n y
Fuge
tinge
grid
Yxation
Hation
Point
a
style
ENGG1810/9810
A Monnected
ENGG1810/9810
time
ENGG1810/9810
Python Interpolation
Interpolation is a method for estimating an unknown value between known values.
There are two common interpolation methods:
Python Scipy
SciPy - open-source library of Python modules for mathematics, science and engineering.
import scipy
SciPy Reference
http://scipy.github.io/devdocs/dev/
ENGG1810/9810
https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d
ENGG1810/9810
https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d
ENGG1810/9810
Not-a-Knot boundary
https://timodenk.com/blog/cubic-spline-interpolation/
https://tools.timodenk.com/cubic-spline-interpolation
ENGG1810/9810
https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.CubicSpline.html
ENGG1810/9810
Can I estimate x = 6
using linear interpolation?
ENGG1810/9810
Can I estimate x = 6
using linear interpolation?
out ofrange
ENGG1810/9810
Python Extrapolation
Method of estimating a value outside of the range of known values
Python Extrapolation
Method of estimating a value outside of the range of known values
Yay!
ate
out
y howoften
ENGG1810/9810
Python Extrapolation
Method of estimating a value outside of the range of known values
Yay!
Python 3D plots!
2D Plot VS 3D Plot
here in 3D!
We have been drawing a
lot here in 2D!
Python 3D plots!
3D Axes (of class Axes3D) are created by passing
the projection="3d" keyword argument to Figure.add_subplot:
https://numpy.org/doc/stable/reference/generated/numpy.sin.html?highlight=sin#numpy.sin
https://numpy.org/doc/stable/reference/generated/numpy.cos.html?highlight=cos#numpy.cos
ENGG1810/9810
x
y: vector of zeros doesnt
z: sin(x) show a
yvain
ENGG1810/9810
We need np.meshgrid(x, y)
Generate a mesh listing all possible
combinations of x and y values given
lists/arrays of x and y.
ENGG1810/9810
https://matplotlib.org/stable/tutorials/toolkits/mplot3d.html#surface-plots
https://matplotlib.org/stable/tutorials/colors/colormaps.html
ENGG1810/9810
Python WireframePlot
No coloured facets!
https://matplotlib.org/stable/tutorials/toolkits/mplot3d.html#wireframe-plots
ENGG1810/9810
THANKS FOR
WATCHING
Good luck in studying