Replies: 1 comment 2 replies
-
I'm not seeing a way to do this with FiPy. An equation in FiPy is really an operator on the solution vector. Ultimately, what FiPy is doing is applying a cell-centered finite volume discretization to a PDE, to build a matrix and right-hand-side vector, in order to solve for a linear algebra equation for the solution vector. I have no idea, even conceptually, how to represent the minimum of two different equations as a matrix stencil. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am working on solving the following spatial PDE for$h(x): \mathbb{R}^2\rightarrow \mathbb{R}$
$$\min\{c(x) - h(x),\; x_2\frac{\partial}{\partial x_1}h(x) + |\frac{\partial}{\partial x_2}h(x)| + \gamma h(x)\} = 0, \; \forall x\in \mathcal{X}$$ $c(x)$ is a known input function which can be precomputed on the mesh, $\mathcal{X}=[l_{x_1}, u_{x_1}]\times[l_{x_2}, u_{x_2}]$ is the rectangular domain of interest, and $\gamma\geq 0$ is a constant.
where
Here is my current code
It seems I cannot use numpy.min to enforce an elementwise min between two vectors. Additionally, I tried the basic min() but this wouldn't have the desired elementwise behavior and gives an error message prompting me to use .any() or .all().
I am requesting help to solve this system with FiPy.
thank you
Beta Was this translation helpful? Give feedback.
All reactions