neurophysik / jitcdde

Just-in-time compilation for delay differential equations
Other
56 stars 14 forks source link

Attribute error #12

Closed debbisrs closed 6 years ago

debbisrs commented 6 years ago

Dear Ansmann, While I integrate time delayed equation with "tanh()" function it shows the following error: (imported numpy as np)

Traceback (most recent call last): File "ddex.py", line 12, in f = [ -ay(0)+b(-ny(0,t-tau)+m(np.tanh(l*y(0,t-tau))))] AttributeError: 'Mul' object has no attribute 'tanh'

I used "sp.tanh" (sympy as sp) but the state diverges, which is not the case. Please help.

Debabrata Biswas (debbisrs@gmail.com)

Wrzlprmft commented 6 years ago

You must use sympy.tanh (or better: symengine.tanh), not numpy.tanh – the latter cannot handle symbols (Further reading).

I used "sp.tanh" (sympy as sp) but the state diverges, which is not the case.

That’s clearly better (see above). As to why the solution diverges, that’s hard to say without further information. Can you give me a full example and some reference regarding the expected result?

debbisrs commented 6 years ago

Thank you for your kind reply. I am sending the python file along with the paper reported the system. Also the plot of the diverged case. But the parameters considered the state should not diverge.

Thanking you.

https://mailtrack.io/ Sent with Mailtrack https://mailtrack.io/install?source=signature&lang=en&referral=debbisrs@gmail.com&idSignature=22

On Sun, Jul 15, 2018 at 11:56 AM, Gerrit Ansmann notifications@github.com wrote:

You must use sympy.tanh (or better: symengine.tanh), not numpy.tanh – the latter cannot handle symbols (Further reading https://jitcde-common.readthedocs.io/en/stable/#common-mistakes-and-questions .

I used "sp.tanh" (sympy as sp) but the state diverges, which is not the case.

That’s clearly better (see above). As to why the solution diverges, that’s hard to say without further information. Can you give me a full example and some reference regarding the expected result?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neurophysik/jitcdde/issues/12#issuecomment-405070463, or mute the thread https://github.com/notifications/unsubscribe-auth/AH7th03Sh5SCz4v6fn0HyIC_aRtQfDMTks5uGuCpgaJpZM4VQIXY .

-- Dr. Debabrata Biswas Ph.D (Physics) Assistant Professor Rampurhat College The University of Burdwan West Bengal India

Email: debbisrs@gmail.com, debbisrs@yahoo.com https://www.researchgate.net/profile/Debabrata_Biswas6 Homepage: https://sites.google.com/site/debabratabu/

Wrzlprmft commented 6 years ago

I cannot see any code or paper. Please note that you are right now posting on a GitHub issue (if you are reading this in an e-mail, follow the link at the very bottom of the e-mail).