core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 099e053 was
099e053,
checked in by HMP1 <helen.park@…>, 10 years ago
|
further organizing
|
-
Property mode set to
100644
|
File size:
157 bytes
|
Line | |
---|
1 | import numpy as np |
---|
2 | |
---|
3 | |
---|
4 | x = np.array([0, 1, 2, 3]) |
---|
5 | y = 2*x + 1 |
---|
6 | |
---|
7 | print y |
---|
8 | sum = 0 |
---|
9 | |
---|
10 | for i in xrange(x.size-1): |
---|
11 | sum += (x[i+1]-x[i])*(y[i]+y[i+1])/2 |
---|
12 | |
---|
13 | print sum |
---|
Note: See
TracBrowser
for help on using the repository browser.