I am new to Theano, and I try to implement a numerical integrator of a reaction-diffusion system - FitzHugh–Nagumo model of this version:
For now my expressions are:
import theano as th
import theano.tensor as T
u = T.dmatrix('u')
v = T.dmatrix('v')
e = T.dscalar('e')
a0 = T.dscalar('a0')
a1 = T.dscalar('a1')
dudt = u - u**3 -v
dvdt = e*(u - a1*v - a0)
So I haven't implemented the finite-differences laplacian operator yet. My question is whether there is a smart way of doing it in Theano?
Is there any reason for using Theano? There are other ways in Python to solve a system of coupled non-linear ODEs.
The reaction-diffusion system definition from Google seems to suggest that u(x,y,t), v(x,y,t).
I am not a user of Theano, but it looks like casting the problem in the form of an equation like b = Ax is the way to go.
Some resources that I came across on Google for using Theano and generally solving PDEs are below.
Expressing the Laplacian using Theano
Solving a reaction-diffusion problem using numpy
Github project using Theano to solve the shallow water PDE
An interesting example of a similar, but simpler problem, solved using convolutional networks on Google's tensorflow can be found here:
https://www.tensorflow.org/versions/r0.7/tutorials/pdes/index.html
In particular they use the following definition of the diffusion kernel:
laplace_k = make_kernel([[0.5, 1.0, 0.5],
[1.0, -6., 1.0],
[0.5, 1.0, 0.5]])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With