Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • wderiv wderiv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wtools
  • wderivwderiv
  • Wiki
  • Complex derivatives

Complex derivatives · Changes

Page history
Update Complex derivatives authored May 30, 2021 by Bartosz Ruszczak's avatar Bartosz Ruszczak
Hide whitespace changes
Inline Side-by-side
Complex-derivatives.md
View page @ 9fd52e4e
# 3D derivatives:
## Basic 3D derivative function:
# Complex derivatives
# 3D derivatives
### Basic 3D derivative function:
```c
int wderiv_derivative_3d_r(int direction, int n, double complex *f, double complex *deriv)
int wderiv_derivative_3d_c(int direction, int n, double complex *f, double complex *deriv)
```
Function computes n-th derivative with respect to `direction` of 3D complex function $`f(x,y,z)`$: $`\frac{\partial^n f}{\partial t^n}`$.
* `direction` - predefined integer corresponding to direction of derivative: `WDERIV_DX` or `WDERIV_DY` or `WDERIV_DZ`
......@@ -10,9 +11,9 @@ Function computes n-th derivative with respect to `direction` of 3D complex func
* `return` - error code
`deriv` can be the same pointer as `f`, then result overwrites input.
## First 3D derivative functions:
### First 3D derivative functions:
```c
int wderiv_dfdx_3d_r(double complex *f, double complex *dfdx)
int wderiv_dfdx_3d_c(double complex *f, double complex *dfdx)
```
Function computes first derivative with respect to $`x`$ of 3D complex function $`f(x,y,z)`$: $`\frac{\partial f}{\partial x}`$.
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
......@@ -22,7 +23,7 @@ Function computes first derivative with respect to $`x`$ of 3D complex function
`dfdx` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_dfdy_3d_r(double complex *f, double complex *dfdy)
int wderiv_dfdy_3d_c(double complex *f, double complex *dfdy)
```
Function computes first derivative with respect to $`y`$ of 3D complex function $`f(x,y,z)`$: $`\frac{\partial f}{\partial y}`$.
* `f` - pointer to input function which is array of size [nx*ny*nz]
......@@ -32,7 +33,7 @@ Function computes first derivative with respect to $`y`$ of 3D complex function
`dfdy` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_dfdz_3d_r(double complex *f, double complex *dfdz)
int wderiv_dfdz_3d_c(double complex *f, double complex *dfdz)
```
Function computes first derivative with respect to $`z`$ of 3D complex function $`f(x,y,z)`$: $`\frac{\partial f}{\partial x}`$.
* `f` - pointer to input function which is array of size [nx*ny*nz]
......@@ -40,9 +41,9 @@ Function computes first derivative with respect to $`z`$ of 3D complex function
* `return` - error code
`dfdz` can be the same pointer as `f`, then result overwrites input.
## Second 3D derivative functions:
### Second 3D derivative functions:
```c
int wderiv_d2fdx2_3d_r(double complex *f, double complex *d2fdx2)
int wderiv_d2fdx2_3d_c(double complex *f, double complex *d2fdx2)
```
Function computes second derivative with respect to $`x`$ of 3D complex function $`f(x,y,z)`$: $`\frac{\partial^2 f}{\partial x^2}`$.
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
......@@ -52,7 +53,7 @@ Function computes second derivative with respect to $`x`$ of 3D complex function
`d2fdx2` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_d2fdy2_3d_r(double complex *f, double complex *d2fdy2)
int wderiv_d2fdy2_3d_c(double complex *f, double complex *d2fdy2)
```
Function computes second derivative with respect to $`y`$ of 3D complex function $`f(x,y,z)`$: $`\frac{\partial^2 f}{\partial y^2}`$.
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
......@@ -62,7 +63,7 @@ Function computes second derivative with respect to $`y`$ of 3D complex function
`d2fdy2` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_d2fdz2_3d_r(double complex *f, double complex *d2fdz2)
int wderiv_d2fdz2_3d_c(double complex *f, double complex *d2fdz2)
```
Function computes second derivative with respect to $`z`$ of 3D complex function $`f(x,y,z)`$: $`(\frac{d^2f}{dz^2})`$.
* `f` - pointer to input function which is array of size [nx*ny*nz]
......@@ -70,9 +71,9 @@ Function computes second derivative with respect to $`z`$ of 3D complex function
* `return` - error code
`d2fdz2` can be the same pointer as `f`, then result overwrites input.
## n-th 3D derivative functions:
### n-th 3D derivative functions:
```c
int wderiv_dnfdxn_3d_r(int n, double complex *f, double complex *dnfdxn)
int wderiv_dnfdxn_3d_c(int n, double complex *f, double complex *dnfdxn)
```
Function computes n-th derivative with respect to $`x`$ of 3D complex function $`f(x,y,z)`$: $`(\frac{d^nf}{dx^n})`$.
* `f` - pointer to input function which is array of size [nx*ny*nz]
......@@ -82,7 +83,7 @@ Function computes n-th derivative with respect to $`x`$ of 3D complex function $
`dnfdxn` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_dnfdyn_3d_r(int n, double complex *f, double complex *dnfdyn)
int wderiv_dnfdyn_3d_c(int n, double complex *f, double complex *dnfdyn)
```
Function computes n-th derivative with respect to $`y`$ of 3D complex function $`f(x,y,z)`$: $`(\frac{d^nf}{dy^n})`$.
* `f` - pointer to input function which is array of size [nx*ny*nz]
......@@ -92,7 +93,7 @@ Function computes n-th derivative with respect to $`y`$ of 3D complex function $
`dnfdyn` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_dnfdzn_3d_r(int n, double complex *f, double complex *dnfdzn)
int wderiv_dnfdzn_3d_c(int n, double complex *f, double complex *dnfdzn)
```
Function computes n-th derivative with respect to $`z`$ of 3D complex function $`f(x,y,z)`$: $`(\frac{d^nf}{dz^n})`$.
* `f` - pointer to input function which is array of size [nx*ny*nz]
......@@ -100,9 +101,9 @@ Function computes n-th derivative with respect to $`z`$ of 3D complex function $
* `return` - error code
`dnfdzn` can be the same pointer as `f`, then result overwrites input.
## 3D gradient:
### 3D gradient:
```c
int wderiv_gradient_3d_r(double complex *f, double complex *dfdx, double complex *dfdy, double complex *dfdz);
int wderiv_gradient_3d_c(double complex *f, double complex *dfdx, double complex *dfdy, double complex *dfdz);
```
Function computes gradient of 3D complex function $`f(x,y,z)`$: $`\nabla f = (\frac{df}{dx},\frac{df}{dy},\frac{df}{dz})`$.
* `f` - pointer to input function which is array of size [nx*ny*nz]
......@@ -110,9 +111,9 @@ Function computes gradient of 3D complex function $`f(x,y,z)`$: $`\nabla f = (\f
* `dfdy` - pointer to output derivative function which is array of size [nx*ny*nz]
* `dfdz` - pointer to output derivative function which is array of size [nx*ny*nz]
* `return` - error code
## 3D gradient squared:
### 3D gradient squared:
```c
int wderiv_gradient2_3d_r(double complex *f, double complex *gradient_square)
int wderiv_gradient2_3d_c(double complex *f, double complex *gradient_square)
```
Function computes squared gradient of 3D complex function $`f(x,y,z)`$: $`|\nabla f|^2 = |\frac{df}{dx}|^2 +|\frac{df}{dy}|^2 +|\frac{df}{dz}|^2 `$.
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
......@@ -120,9 +121,9 @@ Function computes squared gradient of 3D complex function $`f(x,y,z)`$: $`|\nabl
* `return` - error code
`gradient_square` can be the same pointer as `f`, then result overwrites input.
## 3D laplacian:
### 3D laplacian:
```c
int wderiv_laplace_3d_r(double complex *f, double complex *laplace)
int wderiv_laplace_3d_c(double complex *f, double complex *laplace)
```
Function computes laplacian of 3D complex function $`f(x,y,z)`$: $`|\Delta f|^2 = \frac{d^2f}{dx^2} +\frac{d^2f}{dy^2} +\frac{d^2f}{dz^2} `$.
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
......@@ -130,9 +131,9 @@ Function computes laplacian of 3D complex function $`f(x,y,z)`$: $`|\Delta f|^2
* `return` - error code
`laplace` can be the same pointer as `f`, then result overwrites input.
## 3D divergence:
### 3D divergence:
```c
int wderiv_divergence_3d_r(double complex *f, double complex *divergence)
int wderiv_divergence_3d_c(double complex *f, double complex *divergence)
```
Function divergence of 3D complex function $`f(x,y,z)`$: $`\nabla \cdot f = \frac{df}{dx} +\frac{df}{dy} +\frac{df}{dz} `$.
* `f` - pointer to input function which is array of size [nx\*ny\*nz]
......@@ -140,9 +141,9 @@ Function divergence of 3D complex function $`f(x,y,z)`$: $`\nabla \cdot f = \fra
* `return` - error code
`divergence` can be the same pointer as `f`, then result overwrites input.
## 3D curl:
### 3D curl:
```c
int wderiv_curl_3d_r(double complex *fx, double complex *fy, double complex *fz, double complex *curl_x, double complex *curl_y, double complex *curl_z);
int wderiv_curl_3d_c(double complex *fx, double complex *fy, double complex *fz, double complex *curl_x, double complex *curl_y, double complex *curl_z);
```
Function computes curl of 3D complex vector $`(f_x, f_y, f_z)`$: $`\nabla \times \vec{f} = (\frac{df_y}{dz} - \frac{df_z}{dy}, \frac{df_z}{dx} - \frac{df_x}{dz}, \frac{df_x}{dy} - \frac{df_y}{dx})`$.
* `fx` - pointer to input function which is array of size [nx\*ny\*nz]
......@@ -153,10 +154,10 @@ Function computes curl of 3D complex vector $`(f_x, f_y, f_z)`$: $`\nabla \times
* `curl_z` - pointer to output $`z`$-component function which is array of size [nx\*ny\*nz]
* `return` - error code
# 2D derivatives:
## Basic 2D derivative function:
## 2D derivatives:
### Basic 2D derivative function:
```c
int wderiv_derivative_2d_r(int direction, int n, double complex *f, double complex *deriv)
int wderiv_derivative_2d_c(int direction, int n, double complex *f, double complex *deriv)
```
Function computes n-th derivative with respect to `direction` of 2D complex function $`f(x,y)`$: $`\frac{\partial^n f}{\partial t^n}`$.
* `direction` - predefined integer corresponding to direction of derivative: `WDERIV_DX` or `WDERIV_DY`
......@@ -165,9 +166,9 @@ Function computes n-th derivative with respect to `direction` of 2D complex func
* `return` - error code
`deriv` can be the same pointer as `f`, then result overwrites input.
## First 2D derivative functions:
### First 2D derivative functions:
```c
int wderiv_dfdx_2d_r(double complex *f, double complex *dfdx)
int wderiv_dfdx_2d_c(double complex *f, double complex *dfdx)
```
Function computes first derivative with respect to $`x`$ of 2D complex function $`f(x,y)`$: $`\frac{\partial f}{\partial x}`$.
* `f` - pointer to input function which is array of size [nx\*ny]
......@@ -177,7 +178,7 @@ Function computes first derivative with respect to $`x`$ of 2D complex function
`dfdx` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_dfdy_2d_r(double complex *f, double complex *dfdy)
int wderiv_dfdy_2d_c(double complex *f, double complex *dfdy)
```
Function computes first derivative with respect to $`y`$ of 2D complex function $`f(x,y)`$: $`\frac{\partial f}{\partial y}`$.
* `f` - pointer to input function which is array of size [nx*ny]
......@@ -186,9 +187,9 @@ Function computes first derivative with respect to $`y`$ of 2D complex function
`dfdy` can be the same pointer as `f`, then result overwrites input.
## Second 2D derivative functions:
### Second 2D derivative functions:
```c
int wderiv_d2fdx2_2d_r(double complex *f, double complex *d2fdx2)
int wderiv_d2fdx2_2d_c(double complex *f, double complex *d2fdx2)
```
Function computes second derivative with respect to $`x`$ of 2D complex function $`f(x,y)`$: $`\frac{\partial^2 f}{\partial x^2}`$.
* `f` - pointer to input function which is array of size [nx\*ny]
......@@ -198,7 +199,7 @@ Function computes second derivative with respect to $`x`$ of 2D complex function
`d2fdx2` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_d2fdy2_2d_r(double complex *f, double complex *d2fdy2)
int wderiv_d2fdy2_2d_c(double complex *f, double complex *d2fdy2)
```
Function computes second derivative with respect to $`y`$ of 2D complex function $`f(x,y)`$: $`\frac{\partial^2 f}{\partial y^2}`$.
* `f` - pointer to input function which is array of size [nx\*ny]
......@@ -207,9 +208,9 @@ Function computes second derivative with respect to $`y`$ of 2D complex function
`d2fdy2` can be the same pointer as `f`, then result overwrites input.
## n-th 2D derivative functions:
### n-th 2D derivative functions:
```c
int wderiv_dnfdxn_2d_r(int n, double complex *f, double complex *dnfdxn)
int wderiv_dnfdxn_2d_c(int n, double complex *f, double complex *dnfdxn)
```
Function computes n-th derivative with respect to $`x`$ of 2D complex function $`f(x,y)`$: $`(\frac{d^nf}{dx^n})`$.
* `f` - pointer to input function which is array of size [nx*ny]
......@@ -219,7 +220,7 @@ Function computes n-th derivative with respect to $`x`$ of 2D complex function $
`dnfdxn` can be the same pointer as `f`, then result overwrites input.
```c
int wderiv_dnfdyn_2d_r(int n, double complex *f, double complex *dnfdyn)
int wderiv_dnfdyn_2d_c(int n, double complex *f, double complex *dnfdyn)
```
Function computes n-th derivative with respect to $`y`$ of 2D complex function $`f(x,y)`$: $`(\frac{d^nf}{dy^n})`$.
* `f` - pointer to input function which is array of size [nx*ny]
......@@ -228,9 +229,9 @@ Function computes n-th derivative with respect to $`y`$ of 2D complex function $
`dnfdyn` can be the same pointer as `f`, then result overwrites input.
## 2D gradient:
### 2D gradient:
```c
int wderiv_gradient_2d_r(double complex *f, double complex *dfdx, double complex *dfdy);
int wderiv_gradient_2d_c(double complex *f, double complex *dfdx, double complex *dfdy);
```
Function computes gradient of 2D complex function $`f(x,y)`$: $`\nabla f = (\frac{df}{dx},\frac{df}{dy})`$.
* `f` - pointer to input function which is array of size [nx*ny]
......@@ -238,9 +239,9 @@ Function computes gradient of 2D complex function $`f(x,y)`$: $`\nabla f = (\fra
* `dfdy` - pointer to output derivative function which is array of size [nx*ny]
* `return` - error code
## 2D gradient squared:
### 2D gradient squared:
```c
int wderiv_gradient2_2d_r(double complex *f, double complex *gradient_square)
int wderiv_gradient2_2d_c(double complex *f, double complex *gradient_square)
```
Function computes squared gradient of 2D complex function $`f(x,y)`$: $`|\nabla f|^2 = |\frac{df}{dx}|^2 +|\frac{df}{dy}|^2`$.
* `f` - pointer to input function which is array of size [nx\*ny]
......@@ -248,9 +249,9 @@ Function computes squared gradient of 2D complex function $`f(x,y)`$: $`|\nabla
* `return` - error code
`gradient_square` can be the same pointer as `f`, then result overwrites input.
## 2D laplacian:
### 2D laplacian:
```c
int wderiv_laplace_2d_r(double complex *f, double complex *laplace)
int wderiv_laplace_2d_c(double complex *f, double complex *laplace)
```
Function computes laplacian of 2D complex function $`f(x,y)`$: $`|\Delta f|^2 = \frac{d^2f}{dx^2} +\frac{d^2f}{dy^2}`$.
* `f` - pointer to input function which is array of size [nx\*ny]
......@@ -259,9 +260,9 @@ Function computes laplacian of 2D complex function $`f(x,y)`$: $`|\Delta f|^2 =
`laplace` can be the same pointer as `f`, then result overwrites input.
## 2D divergence:
### 2D divergence:
```c
int wderiv_divergence_2d_r(double complex *f, double complex *divergence)
int wderiv_divergence_2d_c(double complex *f, double complex *divergence)
```
Function divergence of 2D complex function $`f(x,y)`$: $`\nabla \cdot f = \frac{df}{dx} +\frac{df}{dy}`$.
* `f` - pointer to input function which is array of size [nx\*ny]
......@@ -270,10 +271,10 @@ Function divergence of 2D complex function $`f(x,y)`$: $`\nabla \cdot f = \frac{
`divergence` can be the same pointer as `f`, then result overwrites input.
# 1D derivatives:
## Basic 1D derivative function:
## 1D derivatives:
### Basic 1D derivative function:
```c
int wderiv_derivative_1d_r(int direction, int n, double complex *f, double complex *deriv)
int wderiv_derivative_1d_c(int direction, int n, double complex *f, double complex *deriv)
```
Function computes n-th derivative with respect to `direction` of 1D complex function $`f(x)`$: $`\frac{\partial^n f}{\partial t^n}`$.
* `direction` - predefined integer corresponding to direction of derivative: `WDERIV_DX`
......@@ -282,9 +283,9 @@ Function computes n-th derivative with respect to `direction` of 1D complex func
* `return` - error code
`deriv` can be the same pointer as `f`, then result overwrites input.
## First 1D derivative functions:
### First 1D derivative functions:
```c
int wderiv_dfdx_1d_r(double complex *f, double complex *dfdx)
int wderiv_dfdx_1d_c(double complex *f, double complex *dfdx)
```
Function computes first derivative with respect to $`x`$ of 1D complex function $`f(x)`$: $`\frac{\partial f}{\partial x}`$.
* `f` - pointer to input function which is array of size [nx]
......@@ -293,9 +294,9 @@ Function computes first derivative with respect to $`x`$ of 1D complex function
`dfdx` can be the same pointer as `f`, then result overwrites input.
## Second 1D derivative functions:
### Second 1D derivative functions:
```c
int wderiv_d2fdx2_1d_r(double complex *f, double complex *d2fdx2)
int wderiv_d2fdx2_1d_c(double complex *f, double complex *d2fdx2)
```
Function computes second derivative with respect to $`x`$ of 1D complex function $`f(x)`$: $`\frac{\partial^2 f}{\partial x^2}`$.
* `f` - pointer to input function which is array of size [nx]
......@@ -304,9 +305,9 @@ Function computes second derivative with respect to $`x`$ of 1D complex function
`d2fdx2` can be the same pointer as `f`, then result overwrites input.
## n-th 1D derivative functions:
### n-th 1D derivative functions:
```c
int wderiv_dnfdxn_1d_r(int n, double complex *f, double complex *dnfdxn)
int wderiv_dnfdxn_1d_c(int n, double complex *f, double complex *dnfdxn)
```
Function computes n-th derivative with respect to $`x`$ of 1D complex function $`f(x)`$: $`(\frac{d^nf}{dx^n})`$.
* `f` - pointer to input function which is array of size [nx]
......@@ -315,18 +316,18 @@ Function computes n-th derivative with respect to $`x`$ of 1D complex function $
`dnfdxn` can be the same pointer as `f`, then result overwrites input.
## 1D gradient:
### 1D gradient:
```c
int wderiv_gradient_1d_r(double complex *f, double complex *dfdx);
int wderiv_gradient_1d_c(double complex *f, double complex *dfdx);
```
Function computes gradient of 1D complex function $`f(x)`$: $`\nabla f = (\frac{df}{dx})`$.
* `f` - pointer to input function which is array of size [nx]
* `dfdx` - pointer to output derivative function which is array of size [nx]
* `return` - error code
## 1D gradient squared:
### 1D gradient squared:
```c
int wderiv_gradient2_1d_r(double complex *f, double complex *gradient_square)
int wderiv_gradient2_1d_c(double complex *f, double complex *gradient_square)
```
Function computes squared gradient of 1D complex function $`f(x)`$: $`|\nabla f|^2 = |\frac{df}{dx}|^2`$.
* `f` - pointer to input function which is array of size [nx]
......@@ -334,9 +335,9 @@ Function computes squared gradient of 1D complex function $`f(x)`$: $`|\nabla f|
* `return` - error code
`gradient_square` can be the same pointer as `f`, then result overwrites input.
## 1D laplacian:
### 1D laplacian:
```c
int wderiv_laplace_1d_r(double complex *f, double complex *laplace)
int wderiv_laplace_1d_c(double complex *f, double complex *laplace)
```
Function computes laplacian of 1D complex function $`f(x)`$: $`|\Delta f|^2 = \frac{d^2f}{dx^2}`$.
* `f` - pointer to input function which is array of size [nx]
......@@ -345,9 +346,9 @@ Function computes laplacian of 1D complex function $`f(x)`$: $`|\Delta f|^2 = \f
`laplace` can be the same pointer as `f`, then result overwrites input.
## 1D divergence:
### 1D divergence:
```c
int wderiv_divergence_1d_r(double complex *f, double complex *divergence)
int wderiv_divergence_1d_c(double complex *f, double complex *divergence)
```
Function divergence of 1D complex function $`f(x)`$: $`\nabla \cdot f = \frac{df}{dx}`$.
* `f` - pointer to input function which is array of size [nx]
......
Clone repository
  • Complex derivatives
  • Gradient square
  • Initialization
  • Real derivatives
  • Home