So I'm trying run a simple test of an idea. Basically I have some function that I define that depends on a variable and a parameter constant. And I have an array of parameter values. For the first parameter values, I have a set of start and end points of integration. For the second I have a different set of start and end points of integration. I've got the code working thanks to this link Integrating functions that return an array in Python
And it's basically exactly in that form.
My question is, if I have a definition of a function with a for loop in it, and that function looks something like:
def F(a):
F = []
for i in len(a):
F[i] = scipy.integrate.quad(g,0,1,args = (a[i],))
return F
(where g
is some function I've defined previously in the code), then when I implement this function (or plug in an array for a
) will all the elements in the array run consecutively? or will the integral at each element run at the same time?
Or in other words, in the link I attached at the beginning, when the function that is defined with a for loop is called, do all calculations in the function run consecutively (like a for loop running through indices) or concurrently since all elements are already defined?