What I have tried:
def df(t,x,*system_constants):
a,b,c,d,e,f,g,h,i,j,k,l,m = system_constants #unpack system constants
#algebra with these constants to calculate something
return something
This returns an error when called, saying: "ValueError: not enough values to unpack (expected 13, got 0).
Also (regardless of this error), it might be better to use a short form unpacking with a for loop. What would this for loop look like?
def df(t,x,*system_constants):
for arg in system_constants:
arg = system_constants
#algebra with these constants to calculate something
return something
The only objective here is to pass a tuple to a function without getting the above error, such that I can use the arguments without calling by index (i.e. without converting to a list)
The function is being called as an argument to the scipy.solve_ivp integrator:
sol = solve_ivp(df, [t0,tf], x0, dense_output = True)
The system_constants are stored in the same script just simply as:
system_constants = a,b,c,d,e,f,g,h,i,j,k,l,m