Добавил:
Upload
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Introduction to Python for Science 2013.pdf
X
- •Introduction
- •Introduction to Python and its use in science
- •Launching Python
- •Installing Python on your computer
- •The Canopy window
- •The Interactive Python Pane
- •Interactive Python as a calculator
- •Python Modules
- •Variables
- •Importing Modules
- •Getting help: documentation in IPython
- •Programming is a detail-oriented activity
- •Exercises
- •Strings, Lists, Arrays, and Dictionaries
- •Strings
- •Lists
- •NumPy arrays
- •Dictionaries
- •Random numbers
- •Exercises
- •Input and Output
- •Keyboard input
- •Screen output
- •File input
- •File output
- •Exercises
- •Plotting
- •An interactive session with pyplot
- •Basic plotting
- •Logarithmic plots
- •More advanced graphical output
- •Exercises
- •Conditionals and Loops
- •Conditionals
- •Loops
- •List Comprehensions
- •Exercises
- •Functions
- •Methods and attributes
- •Exercises
- •Curve Fitting
- •Exercises
- •Numerical Routines: SciPy and NumPy
- •Special functions
- •Linear algebra
- •Solving non-linear equations
- •Solving ODEs
- •Discrete (fast) Fourier transforms
- •Exercises
- •Installing Python
- •IPython Notebooks
- •Python Resources
Introduction to Python for Science, Release 0.9.23
9.6 Exercises
1.Use NumPy’s polyval function together with SciPy to plot the following functions:
(a)The first four Chebyshev polynomials of first kind. Plot these over the interval from -1 to +1.
(b)The first four Hermite polynomials multiplied by e x2=2. Plot these on the interval from -5 to +5. These are the first four wave functions of the quantum mechanical simple harmonic oscillator.
178 |
Chapter 9. Numerical Routines: SciPy and NumPy |
Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]