Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fgittins/tricubicinterpolations.jl
https://github.com/fgittins/tricubicinterpolations.jl
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fgittins/tricubicinterpolations.jl
- Owner: fgittins
- Created: 2023-11-18T19:43:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-05T13:46:37.000Z (about 1 year ago)
- Last Synced: 2024-01-05T14:41:05.350Z (almost 1 year ago)
- Language: Julia
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TricubicInterpolations.jl
Julia implementation of a tricubic interpolator in three dimensions. The scheme is based on [Lekien and Marsden (2005), "Tricubic interpolation in three dimensions," Int. J. Numer. Meth. Eng. 63, 455](https://doi.org/10.1002/nme.1296).## Usage
`TricubicInterpolations.jl` is written using pure `Julia` and has no additional dependencies.Here is a simple example to get you started. We start with
```
using TricubicInterpolations
```
We will consider the following function:
$$f(x, y, z) = - x^3 + x + y^2 - z.$$
The interpolator object `Tricubic` accepts four inputs `(X, Y, Z, F)`, which are the samples of the three independent variables $(x, y, z)$ and the one dependent variable $f$. These can be generated for our function as
```
f(x, y, z) = - x^3 + x + y^2 - zX = Y = Z = LinRange(-1, 1, 21)
F = [f(x, y, z) for x=X, y=Y, z=Z]
```
Then the interpolator is initialised as
```
t = Tricubic(X, Y, Z, F)
```
The interpolator can be called at a point, say $(0.5, -0.1, 0.3)$, for an estimate of the function
```
t(0.5, -0.1, 0.3)
```
and its derivatives
```
partial_derivative_x(t, 0.5, -0.1, 0.3)
partial_derivative_y(t, 0.5, -0.1, 0.3)
partial_derivative_z(t, 0.5, -0.1, 0.3)
```