**5. Finite-Di**ff**erence Time-Domain Solution of the Gain Factor Optimization Problem in Optical Parametric Amplification**

Equations (5a,b) and (7a,b) can be discretized using the finite-difference time-domain (FDTD) method as stated in Equations (18a,b) and (18c,d), for every iteration k of our optimization problem. Our initial goal is to discretize Equation (5a,b) in order to get *E*2,*k*(*i*, *j* + 1) i.e., the value of *E*2,*<sup>k</sup>* at a certain spatial coordinate at the next time step. Since *E*2,*<sup>k</sup>* and *P*2,*<sup>k</sup>* are coupled to each other, initially we attempt to solve for *P*2,*k*(*i*, *j* + 1) and then substitute its value into the wave equation for *E*2,*k*(*i*, *j* + 1). These two equations are solved recursively for every time step and for all spatial points in a given one-dimensional solution domain. In order to increase the accuracy of our obtained solution, we should select Δ*t* and Δ*x* as small as we can [12,13]. Then we may proceed on the discretization of Equation (7a,b) and substitute the previously obtained value of *P*2,*k*(*i*, *j*) from Equation (5a,b), for the solution of *E*1,*k*(*i*, *j* + 1) in Equation (7a,b). Finally, we update the values of the optimization parameters based on the BFGS algorithm, and we repeat the entire procedure for every iteration of the optimization process until the desired gain factor is achieved (see Figure 4).

**Figure 4.** Flowchart diagram of Broyden–Fletcher–Goldfarb–Shanno (BFGS)-based non-linear programming integrated in finite-difference time-domain (FDTD) analysis.
