Streamplot : total integration time

Hi there,

I am wondering if there is any way to extract the total integration time from streamplot(). In the source code use is made of the variable ‘ds’, but I have the feeling this represents a distance rather than a time. The equation that one solves when considering streamlines is dx/dt = u. Given u (which is the input) one should be able to get the time right?

The code in in streamplot is not meant to be a publicly accessible computation tool.

The flow lines have varying integration lengths to make sure we get a nice looking visualization (if two lines get too close together, we truncate one of them to keep the density down and if a region does not have enough lines we start some new integration points) so I am not sure that the “integration time” makes sense across the whole field.

That question on SO seems relevant to what I am inferring you are actually trying to do (and note that it suggests and then discards extracting this information from streamplot).

From your referral to SO I stumbled across scipy.interpolate.RectBivariateSpline. I get the impression that this does the same as interpgrid() in streamplot(). The nice thing is that this allows me to define a function which interpolates the value of a vector given the coordinates. This function itself works pretty nice with scipy.integrate.odeint. In the picture below, the yellow and red lines follow from RectBivariateSpline and the blue lines form streamplot(). The results are virtually the same.

The good thing is that now I am able to explicitly define a time which allows me to do the required manipulations for my research.

EDIT:

Note, the orange line represents a propeller with radius 0.15m.

I will also check how scipy.integrate.RK23 will hold up since the odeint function is form the old API