# Symbolic computation of the asymptotic expansion for a disk with constant $\varepsilon_{\mathsf{c}}$

The codes below are associated to the article:

- C. Carvalho and Z. Moitier, _Asymptotics for metamaterial cavities and their effect on scattering_ [[arXiv](https://arxiv.org/abs/2010.07583), [HAL](https://hal.archives-ouvertes.fr/hal-02965993)]

## Zoïs Moitier, Camille Carvalho (2021)
            
_Karlsruhe Institute of Technology, Germany_

_University of California Merced, USA_


```python
import sympy as sy
from IPython.display import display

from core import *
```


```python
order = 1
q = order - 1
```


```python
h, η = sy.symbols("h η", real=True, positive=True)
σ = sy.symbols("σ", real=True)
```


```python
Λn = sy.symbols(f"Λ_0:{order}", real=True)
Λ = formal_expan(Λn, h, order)

φn = sy.symbols(f"φ_0:{order}", cls=sy.Function)
φ = formal_expan(apply_var(φn, σ), h, order)

ψn = sy.symbols(f"ψ_0:{order}", cls=sy.Function)
ψ = formal_expan(apply_var(ψn, σ), h, order)
```


```python
def dσ_neg(expr):
    return expr.diff(σ)


def dσ_pos(expr):
    return expr.diff(σ)
```


```python
iε = inv_ε_expan((η,), σ, h, order)
f_neg, 𝓛_neg = op_disk(iε, dσ_neg, σ, h, order)
f_pos, 𝓛_pos = op_disk(1, dσ_pos, σ, h, order)
```

## $\mathcal{L}^- \varphi = \Lambda \varphi$


```python
display(
    sy.Eq(
        𝓛_neg.subs(f_neg(σ), φ).doit().expand().coeff(h, q),
        (Λ * φ).expand().coeff(h, q),
    )
)
```


$\displaystyle - \frac{\operatorname{φ_{0}}{\left(σ \right)}}{η^{2}} + \frac{\frac{d^{2}}{d σ^{2}} \operatorname{φ_{0}}{\left(σ \right)}}{η^{2}} = Λ_{0} \operatorname{φ_{0}}{\left(σ \right)}$


## $\mathcal{L}^+ \varphi = \Lambda \varphi$


```python
display(
    sy.Eq(
        𝓛_pos.subs(f_pos(σ), ψ).doit().expand().coeff(h, q),
        (Λ * ψ).expand().coeff(h, q),
    )
)
```


$\displaystyle \operatorname{ψ_{0}}{\left(σ \right)} - \frac{d^{2}}{d σ^{2}} \operatorname{ψ_{0}}{\left(σ \right)} = Λ_{0} \operatorname{ψ_{0}}{\left(σ \right)}$


## $[u] = 0$


```python
display(sy.Eq(φ.subs(σ, 0).coeff(h, q), ψ.subs(σ, 0).coeff(h, q)))
```


$\displaystyle \operatorname{φ_{0}}{\left(0 \right)} = \operatorname{ψ_{0}}{\left(0 \right)}$


## $ [\varepsilon^{-1} \partial u] = 0 $


```python
display(
    sy.Eq(
        -(η ** (-2)) * dσ_neg(φ).expand().coeff(h, q).subs(σ, 0),
        dσ_pos(ψ).subs(σ, 0).coeff(h, q),
    )
)
```


$\displaystyle - \frac{\left. \frac{d}{d σ} \operatorname{φ_{0}}{\left(σ \right)} \right|_{\substack{ σ=0 }}}{η^{2}} = \left. \frac{d}{d σ} \operatorname{ψ_{0}}{\left(σ \right)} \right|_{\substack{ σ=0 }}$


64a91290416037d465ccd3214f9667b7d13c2015
ipynb
Jupyter Notebook
Symbolic/disk_eps_constant_equation.ipynb
zmoitier/Asymptotic_metacavity
6f2d6cbcf0977ffcd6ad7b3ddf0e5396dc317afd
MIT
Symbolic/disk_eps_constant_equation.ipynb
zmoitier/Asymptotic_metacavity
6f2d6cbcf0977ffcd6ad7b3ddf0e5396dc317afd
MIT
Symbolic/disk_eps_constant_equation.ipynb
zmoitier/Asymptotic_metacavity
6f2d6cbcf0977ffcd6ad7b3ddf0e5396dc317afd
MIT
Qwen/Qwen-72B
1. YES
2. YES