Comments (8)
The boundary conditions are not continuous
from neurodiffeq.
You mean the 4 corners?
from neurodiffeq.
The boundary conditions you mention in:
x = 0 ; u = 1
x = 1 ; u = 0
y = 0 ; u = 0
y = 1 ; u = 0
It is not continuous at (0, 0) as it can be 0 or 1.
But the boundary conditions in your snippet of code:
BCs = [
DirichletBVP2D(
x_min=xmin, x_min_val=lambda y: 0,
x_max=xmax, x_max_val=lambda y: 0,
y_min=ymin, y_min_val=lambda x: 0,
y_max=ymax, y_max_val=lambda x: 0,
)
]
should work.
from neurodiffeq.
Thanks for your quick reply. I must have made a typo, the BCs in the snippet enforce u=0
everywhere, which I don't want. I want to enforce u=1
at x=0
, and I understand this makes the corners discontinuous. Is there a way to ignore those two points, like would the following snippet work?
BCs = [
DirichletBVP2D(
x_min=xmin, x_min_val=lambda y: return 0 if y in [0, 1] else 1,
x_max=xmax, x_max_val=lambda y: 0,
y_min=ymin, y_min_val=lambda x: 0,
y_max=ymax, y_max_val=lambda x: 0,
)
]
from neurodiffeq.
I don't think that will work. Why not use some continuous and approximate step function like heaviside - https://en.wikipedia.org/wiki/Heaviside_step_function?
from neurodiffeq.
Ya, that's right, I didn't mean the exact snippet, but conceptually. So, using NumPy's heaviside (in a way that mimics lambda y: return 0 if y in [0, 1] else 1
) would work? Thanks!
from neurodiffeq.
So, using NumPy's heaviside (in a way that mimics lambda y: return 0 if y in [0, 1] else 1) would work?
Directly using heaviside might not work with AD (in pytorch - https://pytorch.org/docs/stable/generated/torch.heaviside.html). But using an approximate continuous form should work.
from neurodiffeq.
Gotcha thanks!
from neurodiffeq.
Related Issues (20)
- Is there a way to access the train/valid loss history for Solver1D, like for solve? HOT 2
- Using Special type activation function HOT 9
- Finding value of weights HOT 2
- Saving subclass of solvers HOT 1
- TqdmKeyError: "Unknown argument(s): {'colour': 'blue'}" HOT 3
- Publish `neurodiffeq` on `conda-forge`?
- Neumann boundary conditions
- Add tests for solver_utils
- BundleSolver setup too restrictive HOT 1
- fitting a variable in a system of ODE as a function of time HOT 4
- Problems :return inspect.signature(optimizer.step).parameters.get('closure').default == inspect._empty AttributeError: 'NoneType' object has no attribute 'default' HOT 2
- Parametric system of ODEs HOT 1
- Bundle Solution for PDEs
- Improve Docs
- Solving system of PDEs/ODEs HOT 1
- Missing eq_param_index when loading BundleSolution HOT 4
- Could we implement the differential equations in symbolic format? HOT 3
- Access to the differential equations of the system.
- Adding the option to use a learning rate schedule during training.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neurodiffeq.