On Sep 19, 2012, at 1:46 PM, Allawala, Altan wrote: > 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?
No solution, but a couple of observations: PowerLawConvectionTerm(coeff = x*[[1]], var=numerical) expresses \frac{\partial}{\partial x} \left( x \varphi\right) or x \frac{\partial \varphi}{\partial x} + \varphi not x * \frac{\partial \varphi}{\partial x} Changing the equation declaration to X = mesh.getFaceCenters()[0] eqn = (TransientTerm(coeff=1., var=numerical) == - PowerLawConvectionTerm(coeff = X*[[1]], var=numerical) + ImplicitSourceTerm(coeff = 1. - x*x, var=numerical)) seems to help, but the solution still seems to dissipate to zero with time, irrespective of boundary conditions. Wheeler may know why the constraints are being ignored, noting that... > It seems that neither of the left hand side boundary conditions are being > obeyed. At least part of the issue is that a 1st order PDE only admits one boundary condition. > In addition, I've observed that adding a minus sign in front of every term on > both sides of the equality entirely changes the solution, even though > mathematically it shouldn't. Rather than change solution, changing the sign renders the problem unstable. I don't know why. _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]