fall_drag
euler_step
This question has come up 3-5x, so here goes: How can I use the fall_drag parameters in the euler_step function e.g.
for i in range(N-1): num_sol_drag[i+1] = eulerstep(num_sol_drag[i],fall_drag(state,C_d=0.47,m=0.0577,R = 0.0661/2), dt)
The text was updated successfully, but these errors were encountered:
This is a great application of the lambda function:
lambda
for i in range(N-1): num_sol_drag[i+1] = eulerstep(num_sol_drag[i],\ lambda state: fall_drag(state,C_d=0.47,m=0.0577,R = 0.0661/2), dt)
The euler_step is expecting a function of the form dstate = f(state), so you can create an anonymous function that is the form:
dstate = f(state)
lambda state: f(state,parameter_1, parameter_2,...,parameterN)
Sorry, something went wrong.
No branches or pull requests
This question has come up 3-5x, so here goes:
How can I use the
fall_drag
parameters in theeuler_step
functione.g.
The text was updated successfully, but these errors were encountered: