I am completely new in 'PyDSTool' so excuse me if it seems silly. I want to define two nonlinear differential equations . There is a nonlinear function that takes a variable as input:
This is a python error rather than a PyDSTool error. You have to keep track of what names belong in what namespace. For PyDSTool, you additionally have the "virtual" namespace of variables, parameters, etc., which are not regular python names. However, your use of c1 in this script is as if it was a python name, and it is nowhere defined as such. There are a couple of different ways to declare functions, as described in the docs (symbolic objects and strings) but it will be easier to not use python functions, i.e. your Func. Instead, just substitute the return value from your function into your auxfndic value as one auxiliary function. Then, when you use the function, you can pass the expression involving your params as an argument, all as part of a string. Look again at the example codes provided and spot the difference in syntax. Hope that helps!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am completely new in 'PyDSTool' so excuse me if it seems silly. I want to define two nonlinear differential equations . There is a nonlinear function that takes a variable as input:
So I wrote:
c1 can not be read by the function.
I don't know how to define Func inside the ODE that takes a variable as input. Thanks for any guide.
Link
This is a python error rather than a PyDSTool error. You have to keep track of what names belong in what namespace. For PyDSTool, you additionally have the "virtual" namespace of variables, parameters, etc., which are not regular python names. However, your use of
c1in this script is as if it was a python name, and it is nowhere defined as such. There are a couple of different ways to declare functions, as described in the docs (symbolic objects and strings) but it will be easier to not use python functions, i.e. yourFunc. Instead, just substitute the return value from your function into yourauxfndicvalue as one auxiliary function. Then, when you use the function, you can pass the expression involving your params as an argument, all as part of a string. Look again at the example codes provided and spot the difference in syntax. Hope that helps!Thanks Dr. Clewley
here is my edit: