**FDTD Equations:**

$$\begin{array}{c} \frac{E\_{2,k}(i+1,j) - 2E\_{2,k}(i,j) + E\_{2,k}(i-1,j)}{\Delta x^2} - \mu\_0 \varepsilon\_{\infty} \left(i,j\right) \frac{E\_{2,k}(i,j+1) - 2E\_{2,k}(i,j) + E\_{2,k}(i,j-1)}{\Delta t^2} =\\ \mu\_0 \sigma \left(i,j\right) \frac{E\_{2,k}(i,j) - E\_{2,k}(i,j-1)}{\Delta t} + \mu\_0 \frac{P\_{2,k}(i,j+1) - 2P\_{2,k}(i,j) + P\_{2,k}(i,j-1)}{\Delta t^2} \end{array} \tag{18a}$$

$$\begin{split} \frac{\mathsf{P}\_{2,k}(i,j+1) - 2\mathsf{P}\_{2,k}(i,j) + \mathsf{P}\_{2,k}(i,j-1)}{\Delta t^2} &+ \mathsf{Y} \frac{\mathsf{P}\_{2,k}(i,j) - \mathsf{P}\_{2,k}(i,j-1)}{\Delta t} + 4\pi^2 f\_0^2 \Big( \mathsf{P}\_{2,k}(i,j) \Big) - \\ \frac{4\pi^2 f\_0^2}{\mathrm{N}\!\!\mathrm{d}^2} \Big( \mathsf{P}\_{2,k}(i,j) \Big)^2 - \frac{4\pi^2 f\_0^2}{\mathrm{N}^2 \!\!\mathrm{d}^2} \Big( \mathsf{P}\_{2,k}(i,j) \Big)^3 &= \frac{\mathrm{N} \mathrm{d}^2}{\mathrm{m}} \Big( \mathsf{E}\_{2,k}(i,j) \Big). \end{split} \tag{18b}$$

$$\frac{\frac{\mathbb{E}\_{1,k}(i+1,j) - 2\mathbb{E}\_{1,k}(i,j) + \mathbb{E}\_{1,k}(i-1,j)}{\Delta t^2} - \mu\_0 \varepsilon\_{\cos} \left(i,j\right) \frac{\mathbb{E}\_{1,k}(i,j+1) - 2\mathbb{E}\_{1,k}(i,j) + \mathbb{E}\_{1,k}(i,j-1)}{\Delta t^2}}{\mu\_0 \sigma(i,j) \frac{\mathbb{E}\_{1,k}(i,j) - \mathbb{E}\_{1,k}(i,j-1)}{\Delta t} + \mu\_0 \frac{\mathbb{P}\_{1,k}(i,j+1) - 2\mathbb{P}\_{1,k}(i,j) + \mathbb{P}\_{1,k}(i,j-1)}{\Delta t^2}} \tag{18c}$$

$$\begin{array}{ll} \frac{P\_{1,k}(i,j+1) - 2P\_{1,k}(i,j) + P\_{1,k}(i,j-1)}{\Delta t^2} + \gamma \frac{P\_{1,k}(i,j) - P\_{1,k}(i,j-1)}{\Delta t} + 4\pi^2 f\_0^2 \Big( P\_{1,k}(i,j) \Big) \\ - \frac{4\pi^2 f\_0^2}{\text{Nad}} \Big\{ \Big( P\_{1,k}(i,j) \Big)^2 + 2P\_{1,k}(i,j)P\_{2,k}(i,j) \Big\} - \frac{4\pi^2 f\_0^2}{\text{N}^2 \kappa^2 d^2} \Big\{ \Big( P\_{1,k}(i,j) \Big)^3 \\ + 3 \Big( P\_{1,k}(i,j) \Big)^2 P\_{2,k}(i,j) + 3P\_{1,k}(i,j) \Big( P\_{2,k}(i,j) \Big)^2 \Big\} = \frac{\text{N}c^2}{\text{m}} \Big( E\_{1,k}(i,j) \Big). \end{array} \tag{18d}$$

*x*: spatial coordinate, *t*: time, *k*: iteration number, *Ek*(*x*, *t*) = *Ek*(*i*Δ*x*, *j*Δ*t*) → *Ek*(*i*, *j*) *E*2,*<sup>k</sup>* : *High intensity pump wave at iteration k*, *E*1,*<sup>k</sup>* : *Stimulus wave at iteration k*

**Constraints**

$$b\_1(\nu) = a\_1 \mathbb{g}\_1(\nu) \le c\_1$$

$$b\_2(\nu) = a\_2 \text{ g}\_2(\nu) \le c\_2$$

$$b\_N(\nu) = a\_N \text{g}\_N(\nu) \le c\_N$$

**Cost function**: *E*1(ν)  **Augmented cost function**: (penalty function method)

$$f = \left| E\_1(\nu) \right| + L\_1 \left\{ \sum\_{i=1}^N \delta\_i (g\_i(\nu) - c\_i)^2 \right\} + L\_2 \left\{ \sum\_{j=1}^M \zeta\_j (b\_j(\nu) - a\_j)^2 \right\},$$

$$\delta\_i = \left\{ \begin{array}{ll} 0 & \begin{array}{l} if & g\_i(\nu) \le c\_i \\ > 0 & \begin{array}{l} if & g\_i(\nu) > c\_i \end{array} \end{array} \right\}$$

**Iterations**:

$$\nu\_{k+1} = \nu\_k + \alpha\_k p\_k$$

$$p\_k = -H\_k \nabla f\_k$$

$$\mathbf{s}\_k = \mathbf{x}\_{k+1} - \mathbf{x}\_k$$

$$\mathbf{y}\_k = \nabla f\_{k+1} - \nabla f\_k$$

$$H\_{k+1} = \left(I - \rho\_k \mathbf{s}\_k \mathbf{y}\_k^T\right) H\_k \left(I - \rho\_k \mathbf{y}\_k \mathbf{s}\_k^T\right) + \rho\_k \mathbf{s}\_k \mathbf{s}\_k^T \left(\text{BFGS}\right)$$

$$\rho\_k = \frac{1}{\mathbf{y}\_k^T \mathbf{s}\_k}$$

Wolfe conditions for α*k*: *f*(*xk*+ α*<sup>k</sup> pk*) ≤ *f*(*xk*)+ *c*<sup>1</sup> α*k*∇*fk Tpk*

$$\left| \nabla f(\mathbf{x}\_k + \alpha\_k \boldsymbol{p}\_k)^T \boldsymbol{p}\_k \right| \le c\_2 \left| \nabla f\_k \boldsymbol{p}\_k \right| \ 0 < c\_1 < c\_2 < 1$$
