Comments (5)
Ah, I see. I'm sorry, the non-uniform grid in findiff so far is only very basic. It is actually a cartesian product of one-dimensional non-uniform grids, which was sufficient for my needs so far. AMR is more advanced. That would something for the future to implement.
from findiff.
Hi,
thanks!
The non-linear case accepts the 1D axes instead of the meshed N-dimensional grids. Here is an example, how it works in two dimensions:
import findiff
import numpy as np
import matplotlib.pyplot as plt
x, y = np.logspace(-1, 1, 50), np.logspace(-1, 1, 50)
X, Y = np.meshgrid(x, y, indexing='ij')
f = np.sin(X) * np.sin(Y)
df_dy = np.sin(X) * np.cos(Y)
d_dy = findiff.FinDiff(1, y, acc=6)
df_dy_fd = d_dy(f)
plt.plot(y, df_dy[0, :], '-')
plt.plot(y, df_dy_fd[0, :], 'o')
If you have trouble with that or have more questions, don't hesitate to ask. :-)
from findiff.
Yes, sure. But here is an uniform grid. The issue is when the gridding is non-uniform, there the 1D array is not enough.
from findiff.
What do you mean? The example above is a non-uniform grid (logspace, not linspace). Can you give an example of your issue in code?
from findiff.
Hi, sorry for the late reply. Ok, I see what you mean.
What I was meaning by a non-uniform grid is something like adaptative mesh refinement (AMR) grid.
Something like this illustration:
There you would need to insert the whole grid of coordinates to derive the individual "dx" at each cell.
Either this or perform the derivatives per AMR levels (but this then is specific to AMR like non-uniform grids).
from findiff.
Related Issues (20)
- multi dimensional coordinates HOT 1
- Derivatives for a single point in a vector space HOT 1
- PDEs HOT 1
- Using findiff to solve the stationary Schrödinger equation HOT 2
- Allow the user to specify difference method HOT 2
- Problems with the stencil matrix HOT 4
- Time-dependency HOT 2
- First Order Schemes HOT 1
- Replace math images by latex expressions HOT 2
- Analytic inversion of Vandermonde matrix HOT 5
- Outdated conda-forge builds HOT 2
- Higher accuracy derivatives in 3D HOT 3
- Accuracy HOT 2
- How are the higher order derivatives computed in your code? HOT 1
- integrals in boundary conditions? HOT 2
- DOC: Equations seem broken on documentation site HOT 1
- Input for non-uniform spacing HOT 2
- Single point derivative
- possible typo in theory section
- Numerical derivative?
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 findiff.