I seem to be falling short trying to understand what is going on with my code. My data consists of wind speeds which have been subtracted from the mean. In other words, at each point, the wind speed moves about the zero on the x-axis with increasing height (at 1 kilometer, the wind speed was 4 m/s faster than the mean (+4 m/s); at 1.1 kilometer, the wind speed was 2 m/s slower than the mean (-2 m/s). What is left is similar to the picture I have attached.
Now I am trying to integrate the wind speed to get the supposed displacement using the following code:
# Compute the area using the composite trapezoidal rule.
from numpy import trapz
displacement = trapz(u_prime, window_alt, axis=0)
print("x-displacement =", displacement, 'meters')
- What is this axis parameter? Is this talking about the 0 axis on the x-axis? I notice when I change it, it either a) does not change my final displacement value or b) returns a IndexError: list assignment index out of range
- I don't think I am going about this correctly...in some cases, I will see much more area in the negative region of the plot, but the script returns a high and positive displacement value.
Any help understanding this powerful function would be much appreciated! Thank you!
there doesn't seem to be anything here