File tree 3 files changed +6
-1
lines changed
3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
## Translation with broadcasting
2
2
3
+ NumPy broadcasting is powerful tool for dealing with different, but compatible
4
+ shape arrays.
5
+
3
6
File [ points_circle.dat] ( points_circle.dat ) contains x, y coordinates along a
4
7
circle. Translate all the coordinates with some vector e.g. (2.1, 1.1). Plot
5
8
both the original and translated points in order to see the effect of
Original file line number Diff line number Diff line change 1
1
## Finite-difference
2
2
3
+ Vectorization is crucial for obtaining good performance with NumPy.
4
+
3
5
Derivatives can be calculated numerically with the finite-difference method
4
6
as:
5
7
Original file line number Diff line number Diff line change @@ -17,6 +17,6 @@ x'_i = (x_i + x_{i-1}) / 2
17
17
18
18
![ img] ( https://quicklatex.com/cache3/09/ql_f124fd5c831e873c6abd41160fae2d09_l3.png )
19
19
20
- Use the same interval as in the first exercise and investigate how much the
20
+ Calculate the integral in the interval [ 0,π/2 ] and investigate how much the
21
21
Riemann sum of ** sin** differs from 1.0. Avoid ` for ` loops. Investigate also
22
22
how the results changes with the choice of Δx.
You can’t perform that action at this time.
0 commit comments