# metricGet\_Lentz

## Description

Create a version of the Lentz warp solution in a defined spacetime grid.

<details>

<summary>Lentz Metric</summary>

The Lentz solution takes a soliton approach which solves for a potential that satisfies a linear wave equation in spherical coordinates:

$$\partial\_x^2 \phi + \partial\_y^2 \phi - \frac{2}{v^2\_h} \partial\_z^2 \phi = \rho$$

where the shift vector $$\beta$$ is given in two dimensions where:

$$\beta\_i = \partial\_i \phi$$&#x20;

The specific solution that Lentz uses has the shift vectors in $$x$$ and $$z$$ found in Green's form:

$$\beta\_z = \frac{1}{4v\_h}\int dx^\prime \rho \left( z - \frac{|\Delta x|}{v\_h}, |x^\prime|+|y| \right)$$

$$\beta\_x = \frac{1}{4v\_h^2}\int dx^\prime \text{sign}(\Delta x) \rho \left( z - \frac{|\Delta x|}{v\_h}, |x^\prime|+|y| \right)$$

</details>

For more details on the Lentz metric, please read:

{% embed url="<https://arxiv.org/abs/2006.07125>" %}

## Method

The metric is constructed using a representation of the Lentz metric as described in the first publication. An internal function in the main metric constructor called `getWarpFactorByRegion` is called which returns a map of the shift vector values as used in Figure 2 of <https://arxiv.org/abs/2006.07125>. This function scales the shape from the Lentz solution using the <mark style="color:blue;">`scale`</mark> parameter.

{% hint style="info" %}
The comoving version of this metric called `metricGet_LentzComoving` has the same inputs but requires that the <mark style="color:blue;">`gridSize`</mark> along t = 1 and will return the metric in the Galilean comoving frame.
{% endhint %}

## Syntax

`[`<mark style="color:green;">`metric`</mark>`] = metricGet_Lentz(`<mark style="color:blue;">`gridSize`</mark>`,`<mark style="color:blue;">`worldCenter`</mark>`,`<mark style="color:blue;">`v`</mark>`,`<mark style="color:orange;">`scale`</mark>`,`` `<mark style="color:orange;">`gridScale`</mark>`)`

`[`<mark style="color:green;">`metric`</mark>`] = metricGet_LentzComoving(`<mark style="color:blue;">`gridSize`</mark>`,`<mark style="color:blue;">`worldCenter`</mark>`,`<mark style="color:blue;">`v`</mark>`,`<mark style="color:orange;">`scale`</mark>`,`` `<mark style="color:orange;">`gridScale`</mark>`)`

### Input Arguments

{% hint style="info" %} <mark style="color:blue;">blue</mark> are required inputs.

<mark style="color:orange;">orange</mark> are optional inputs with native default values.
{% endhint %}

<table><thead><tr><th width="174">Inputs</th><th width="107">Format</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>gridSize</code></mark></td><td>1x4 array</td><td>integer</td><td><p>The size of the world specified as:</p><p></p><p><span class="math">[t, x, y, z]</span> </p></td></tr><tr><td><mark style="color:blue;"><code>worldCenter</code></mark></td><td>1x4 array</td><td>double</td><td><p>The center of the world, which defines the center of the Lentz shape template as a 4-vector, specified as:</p><p></p><p><span class="math">[t,x,y,z]</span></p></td></tr><tr><td><mark style="color:blue;"><code>v</code></mark></td><td>1x1 array</td><td>double</td><td>Speed of the warp drive, given as a factor of c.</td></tr><tr><td><mark style="color:orange;"><code>scale</code></mark></td><td>1x1 array</td><td>double</td><td>Scaling parameter for the Lentz solution template. <strong>Default value is largest gridSize/7.</strong></td></tr><tr><td><mark style="color:orange;"><code>gridScale</code></mark></td><td>1x4 double</td><td>double</td><td><p>Unit scaling factor of the grid dimensions defined relative to <mark style="color:blue;"><code>gridSize</code></mark>.  This determines the resolution of the grid along each dimension. Specified as:</p><p></p><p><span class="math">[t_{scale}, x_{scale}, y_{scale}, z_{scale}]</span></p><p></p><p> <strong>The default value is [1, 1, 1, 1].</strong></p></td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="151">Outputs</th><th width="113.33333333333331">Format</th><th width="89">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>metric</code></mark></td><td>struct</td><td>object</td><td>Lentz solution returned as the metric tensor object.</td></tr></tbody></table>
