More details about this problem. I want to create a function to
simulate the solution:
PDE:
\frac{d\phi}{d t} = a(x) \frac{d\phi}{d x}+\frac{b^2}
{2}\frac{d^2\phi}{d x^2}+c\phi
IC:
\phi(0,x) = h(x)
The solution is
\phi(t,x)=E^x[h(X_t)exp{int_0^t c(X_s) ds}
where E means the expectation.
StringFunction is used to pass the variables: a ,b and c which can be
constants or functions of x. And now I use the following way to
solve the problem:
>>> e = numpy.ones(Expnum,float) # create ones array
>>> c = StringFunction(c)
>>> ...
>>> I = e*c(Xt)*dt
Thanks all,