I am trying to use scipy's odeint
to solve some ordinary differential equations. The only problem is that I only want to define one argument, and it seems that to make a tuple, you need at least two values.
My code looks like this:
def system(state, t, inputs)
x = state[0]
u = inputs
a = -4
b = 2
dxdt = [a * x + b * u]
return dxdt
inputs = 5
x_next = odeint(system, x, t, args=(inputs))
This will return an error because args
must be a tuple, and (inputs) is a int/float and not a tuple. One way to overcome this is to put a, b as part of the args. But that is just a bandaid on a wound.
I was wondering if there is any ways to define the args as just one value.