On Wed, Sep 19, 2012 at 1:46 PM, Allawala, Altan
<[email protected]> wrote:
> Hello,
>
> I'm trying to find the steady state solution to the following linear PDE:
>
> \frac{\partial \varphi}{\partial t} = - x * \frac{\partial \varphi}{\partial
> x} - x^2 \varphi
>
> Below is my code to solve this. However, the numerical solution is not
> matching the analytical one. Any idea where the problem is?

As Jon pointed out the code doesn't match the equation. Make the
following changes and you get the desired answer.

$ diff old.py new.py
30,32c30,32
< eqn = (TransientTerm(coeff=1, var=numerical) ==
<        - PowerLawConvectionTerm(coeff = x*[[1]], var=numerical)
<        - ImplicitSourceTerm(coeff = x*x, var=numerical))
---
> eqn = (TransientTerm(coeff=1 / x, var=numerical) ==
>        - PowerLawConvectionTerm(coeff = [[1]], var=numerical)
>        - ImplicitSourceTerm(coeff = x, var=numerical))

Cheers

-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to