1 | initial version |
Thanks for posting your question here.
Basically, change two lines:
def g(x,v):
to def g(x,v,t):
(make the function also take time as the last input, even if we don't use it). You can even make t have a default value so you don't actually have to specify it when calling: def g(x,v,t=0):
F=[v,g(x,v)]
to F=[v,g]
(don't call the function g when you define F; that sets F to the result of g. Instead, just pass the function itself in.