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
![image](https://private-user-images.githubusercontent.com/98556113/329873740-33c2b3c8-334c-40fe-8966-e44be2b9e30b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjg2MjMsIm5iZiI6MTczOTI2ODMyMywicGF0aCI6Ii85ODU1NjExMy8zMjk4NzM3NDAtMzNjMmIzYzgtMzM0Yy00MGZlLTg5NjYtZTQ0YmUyYjllMzBiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDEwMDUyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQyYTJmM2I5ZDg3ZjA4NmFlYTcxZmQzZDBkYTIxNzM0NGYzOTY1OGZhNTVjZjk5Mzg2MGYxM2UzZWU5ZWZlMGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.tyXGit3clBKFSDZqh_EasHB6j7b89d7mdGaoYBkr3F8)
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