Numerical analysis for temporal and spectral responses of electromagnetic waves in spatially homogeneous time varying medium

This paper presents simple numerical solutions for electromagnetic plane waves in spatially homogenous time varying medium. The solution is based on converting the resulting second order differential equation into two combined ordinary differential equations which are solved numerically by using the built-in ode113 function in Matlab. By using this method, the time domain responses of the electric and magnetic fields at fixed point in space are obtained. The proposed method is applied on two cases: linearly time varying medium and sinusoidally time varying medium. The corresponding frequency domain response is obtained by using inverse Fourier transformation of the obtained time domain response. The proposed method is compared with FDTD solution. It is found that the proposed method has the same accuracy of FDTD with much less computational time.

FDTD requires significant computational resources and may become computationally expensive for large-scale problems.
The present paper introduces a simple and fast approach for solving the differential form of Maxwell's equations in a time-varying medium.This method is used here to study the effects of different modulation schemes of different time varying media on the response of propagating waves inside these media.The proposed method is based on using the Matlab built-in function of ordinary differential equation (ode113).The novelty of our work lies in the unique combination of the wave equations, the time-varying medium, and the specific numerical solver employed.Our paper aims to provide a practical and accessible solution for researchers and engineers working with electromagnetic waves in time-varying media.The ode113 function is based on Adams Method for solving nonstiff ordinary differential equations.For the present problem, Maxwell's equations are defined as a system of second-order differential equations.These second-order differential equations can be decomposed into a coupled system of first order differential equations.These first order differential equations are solved numerically by using ode113 function to obtain the time domain response of electromagnetic waves inside the time varying medium.This function adjusts the time step size dynamically, providing high accuracy, efficient use of computational resources and ensures that the solution captures important features of the time-domain response accurately.
To validate the effectiveness of the proposed method, it is applied on two specific cases: linearly time-varying media and sinusoidally time-varying media.Specifically, the effects of simultaneously varying both the permittivity and permeability, as well as the effects of varying the permittivity alone are investigated.An example of a time-dependent material with permittivity and permeability varying linearly with time is Vanadium Dioxide (VO 2 ) thin film.Vanadium dioxide is an attractive material that exhibits a metal-insulator transition (MIT) at a critical temperature (around 68 °C).However, this transition can also be triggered by an external stimulus (light irradiation).At room temperature, VO 2 behaves as a semiconductor with relatively low permittivity and permeability (ε 1 and μ 1 ).When exposed to a strong light pulse, VO 2 undergoes a rapid transition to a metallic state.During this transition phase, the permittivity and permeability can be approximated as linearly increasing with time (t) as the material properties change.The slope of the linear variation ( dε/dt and dµ/dt ) represents the rate at which the permittivity and permeability increase with time.This rate depends on the intensity and duration of the light pulse.Once the light pulse ceases, VO 2 might gradually cool down and return to its initial semiconducting state with ε 1 and µ 1 .The return transition could also be modeled linearly, but with a negative slope.During the rapid transition phase triggered by the light pulse, a linear approximation can be a reasonable first-order model to capture the essence of the changing material properties.Understanding the interaction of electromagnetic waves with VO 2 during its light-induced transition can be relevant for developing optical switches or modulators.By controlling the light pulse characteristics, we can potentially design materials that exhibit a desired rate of change in permittivity and permeability, leading to specific wave manipulation functionalities 26 .On the other hand, an example of a time-dependent material with permittivity and permeability varying sinusoidally with time is a tunable metamaterial with electrically reconfigurable properties.The key aspect is that the metamaterial's properties can be dynamically controlled using external stimuli like an electric field.Both permittivity and permeability are chosen to have a base value ( ε ro and µ ro , respectively) representing the material's intrinsic properties.These base values are then modulated by a sinusoidal function of time (t) with a specific amplitude ( �ε and �µ ) and frequency ( ω ).The amplitude ( �ε and �µ ) of the sinusoidal variations can be controlled by applying an external electric field.By changing the strength of the electric field, we can adjust the degree to which the permittivity and permeability deviate from their base values.This allows for dynamic tuning of the metamaterial's response to electromagnetic waves.Such a metamaterial could be used to create tunable filters that can selectively block or transmit specific frequencies based on the applied electric field 27 .It could also be used for dynamically adjusting the phase and amplitude of electromagnetic waves, potentially leading to applications in beam steering or cloaking devices 28,29 .By analyzing the time-domain responses, it would be possible to gain insights into the behavior of electromagnetic waves in these media and their temporal variations.This time domain response is then converted to frequency domain via Fourier transform to obtain also the corresponding spectral response.
The organization of the remaining parts in the present paper are as follows: Section "Formulation of the problem" presents the formulation of the problem of electromagnetic wave propagation in time varying medium.Section "Numerical solution of second order differential equation" presents an example for solving second order differential equation by using Matlab function ode113 and comparing the numerical solution with the corresponding analytical solution to show the accuracy of the proposed method.Section "Numerical solution of electromagnetic waves in time varying medium" presents numerical solutions for wave propagation in time varying media for different cases.Finally, Section "Conclusion" presents concluding remarks.The wave equation of electric field in this case is given by: A similar wave equation can be obtained for the magnetic field.Assuming that the electric field has only y component and it is propagating in z direction, the above equation can be simplified as follows:

Formulation of the problem
The solution of this wave equation can be represented by separation of variables as follows: where �(z) can be represented in terms of forward and backward propagating waves as follows: Thus the spatial dependence of �(z) can be represented in a differential form as follows: Thus, the second-order derivative of the electric field component, E y , in terms of its spatial variation along the z-axis is related to the propagation constant β is given by: Thus, the corresponding temporal wave equation is given by:: where For time-varying medium, µ r (t) and ε r (t) are functions of time as follows: (2) where f is the operating frequency of electromagnetic wave.By using similar steps, the magnetic field can be written in space and time as: and The two wave Eqs. ( 7) and ( 10) describe electromagnetic waves in homogeneous isotropic time varying media for both electric and magnetic fields.However, it is difficult to find exact analytical solutions for these two equations.Assuming that the rates of changing ε and µ with time are much smaller than the frequency of electromagnetic waves, these wave equations correspond to slowly varying second-order differential equations (SV-SODE) 30 .Thus, to find electric and magnetic fields inside a time modulated medium, it is required to solve these two SV-SODEs.In the following section, an efficient technique to solve SODE by using a built-in Matlab function is demonstrated for a known SODE and verified by comparing with its analytical solution.After that, the built-in Matlab function is used to obtain the solutions of the developed wave equations of time modulated media.

Numerical solution of second order differential equation
The wave equations in ( 7) and ( 10) can be presented in a general form of a second order differential equation as follows: where, y is an unknown function of time, is a constant, Q(t) is a time-varying coefficient.By introducing an intermediate variable y 2 = ∂y/∂t , (11) can be reformulated as a first order deferential equation as follows: This system of coupled first order differential equation can be solved by using the ode113 Matlab function.The inputs of ode113 function are the set of differential equations to be solved, their initial conditions, and the time interval.The outputs of ode113 function are vectors of time points and the corresponding values of the state variables; y and y 2 .
As an example for a second order differential equation which can be presented by ( 11) is: The analytical solution of this equation is given by 26 : where: Assuming that the initial conditions of y(0) = 0 and ∂y ∂t t=0 = 0.5 with a = 2 , thus, (13a-13c) can be rewritten as: and the corresponding analytical solution is given by: Figure 2 shows a comparison between the numerical solution of (14a) by using ode113 and the exact analytical solution.It can be noted the excellent agreement between the obtained numerical solution and the analytical solution.This result can be considered as a good indication that ode113 is efficient function to solve SV-SODE.

Numerical solution of electromagnetic waves in time varying medium
The proposed numerical method mentioned in Section "Numerical solution of second order differential equation" is applied in this Section to investigate the time-domain response of electromagnetic plane waves in time varying media.Two specific cases are discussed, linearly time-varying media and sinusoidally time-varying media.
The first case can be suitable for linearly scanning antenna applications.On the other hand, the second case can be suitable for frequency mixing and harmonic generation applications.The effects of varying the permittivity and permeability simultaneously, as well as the effects of varying the permittivity only are investigated.These effects are investigated on the amplitude of electric and magnetic fields and the instantaneous frequency at an arbitrary observation point in space.Furthermore, the obtained electric and magnetic fields obtained by the proposed numerical method are compared to the results of FDTD for comparison.The update equations of electric and magnetic fields for the 1D-FDTD in this case are given by 31 : where t is the time step and x is the cell size (15b).

Linearly-time varying medium
Assume that both permittivity and permeability of the medium are varying linearly with time as follows: where, the initial relative permittivity and permeability at t = 0 are ε r0 = 1 and µ r0 = 1 , respectively.a and b are constants that determine the rate of change of the permittivity and permeability with time.By applying (16a, 16b) the second-order partial differential equation of wave equations in ( 7) and ( 10) can be simplified as: This linearly varying medium is studied for two special cases.The first case where (a = b).and the second case where (b = 0).
For the first special case, the rate of changing the permittivity and permeability with time is equal.By applying (a = b) , Eqs. (17a, 17b) can be simplified to: where the time domain responses of the electric E y and magnetic ( H x ) fields at a fixed point in space are obtained as: Assuming that operating frequency f 0 = 10GHz and the slowly varying parameters a = b = 0.1f 0 .The time domain response of the slowly varying ε and µ is shown in Fig. 3a.The time domain response of W E and W H related to the electric and magnetic fields are obtained by solving (18a, 18b) by using ode113 function as shown in Fig. 3b.The corresponding electric and magnetic fields are shown Fig. 3c.From this figure, it can be noted that increasing both the permittivity and permeability simultaneously increase W E and W H and decrease the amplitude of electric and magnetic fields at the observation point in the space.
In the second case, the rate of changing the permittivity with time is only considered and the permeability of the medium is invariant with time (b = 0) .Thus, (17a, 17b) can be simplified as follows: The time domain response of W E and W H related to the electric and magnetic fields are shown in Fig. 4a,b, respectively.The corresponding electric and magnetic field are shown Fig. 4c,d, respectively.From these figures, it can be noted that increasing the permittivity only would decrease the magnitude of the electric field with a higher rate compared to the decrease of the magnetic field.
It can be noted that increasing both the permittivity and permeability simultaneously decreases the instantaneous frequency at the observation point in the space and decreases the amplitude of electric and magnetic fields.On the other hand, increasing the permittivity only would decrease the magnitude of the electric field with a higher rate compared to the decrease of the magnetic field.This can be explained as follows: when both permittivity and permeability increase with the same rate the refractive index increases while the characteristic impedance is maintained constant.This constant characteristic impedance causes that the normalized response of the electric and magnetic fields would be the same.On the other hand, increasing the refractive index would decrease the instantaneous frequency and the instantaneous power density.Decreasing the instantaneous power density in this case would cause decreasing both electric and magnetic fields with the same rate.For the second case where the permittivity increases while the permeability is maintained constant, the instantaneous refractive index increases but the instantaneous characteristic impedance decreases.Thus the instantaneous frequency decreases but the magnitude of the instantaneous electric field decays more rapidly than the corresponding magnetic field due to the instantaneous decrease of the characteristic impedance.

Sinusoidally-time varying medium
Another case for time varying medium, if both permittivity and permeability of the medium varied sinusoidally with time according to the following equations: where, ε r0 and µ r0 are initial relative permittivity and permeability at t = 0 , p and q are the amplitudes of the sinusoidal variations of permittivity and permeability functions and ω m is the angular frequency of the sinusoidal variation, and t represents time.By following the same procedures applied in case 1, two second-order partial differential equations are obtained for wave propagating in sinusoidally time-varying medium as given by: Assuming that the permittivity and permeability of the medium are changed sinusoidally with the same rate such that p = q = 0.5 with a modulation frequency f m = 1GHz and operating frequency f = 10GHz .The time varying ε and µ are shown in Fig. 5a, where ε r0 = µ r0 = 2 .The corresponding time domain response of W E is shown in Fig. 5b.The corresponding electric field is shown Fig. 5c in comparison with the FDTD result.The FDTD results are obtained for an electrically thin slab of thickness 3 mm with spatial length of the cell x = 1.5mm and t = 50ns .Good agreement between the result by the proposed numerical solution and the FDTD result.However, the computational time of the FDTD solution was nearly 50 times (40.05 s) the computational time for the same problem by using the proposed technique which is 0.801 s.The spectral response of this electric field is obtained by applying Fourier transformation as shown Fig. 5d.It is found that the temporal and spectral responses for both the electric and magnetic field are identical for this case.
For another case where the permittivity is with time is sinusoidally varying with time and constant permeability, p = 0.5 and q = 0 .The time domain response of W E related to the electric field, is shown in Fig. 6a.The corresponding normalized electric and magnetic fields are shown in Fig. 6b,c.The spectral responses are also presented at Fig. 6d.It can be observed that these spectral responses of electric and magnetic fields are not the same.
The time and spectral responses of sinusoidally time varying medium can also be explained in a similar way to the response of increasing the permittivity and permeability.When both permittivity and permeability vary with the same response simultaneously, the time and spectral response of the normalized electric and magnetic fields would be identical.On the other hand, when only the permittivity is sinusoidally time varying, the instantaneous magnitude of the normalized electric field at the peak of the permittivity is more decreased than the corresponding magnetic field component.In addition, at the peak of the permittivity the instantaneous is decreased.This explains why the spectrum of low frequency components in Fig. 6c has greater magnetic field than electric field while at the high frequency components has nearly equal magnitudes for both electric and magnetic fields.

Conclusion
In this paper a simple numerical technique is presented to solve the wave equations of electromagnetic plane waves in homogenous time varying medium.The solution is based on converting the second order differential equation of the corresponding wave equation into two coupled ordinary differential equations and solving these ordinary differential equations by using the built-in ode113 function in Matlab.This method is applied to obtain the time domain response of electromagnetic plane wave in linearly and sinusoidally time varying media.For both cases, we studied the effect of varying both the permittivity and permeability simultaneously.Also, the effect of varying the permittivity only is investigated.It is noted that increasing both the permittivity and permeability simultaneously decreases the instantaneous frequency at the observation point in the space and decreases the amplitude of electric and magnetic fields.On the other hand, increasing the permittivity only would decrease the magnitude of the electric field with a higher rate compared to the decrease of the magnetic field.The spectral response is also presented for the case of sinusoidally time varying media.It is found that the spectral responses for both the electric and magnetic field are identical for the case varying both the permittivity and permeability with the same rate.However, these spectral responses are different for case of varying the permittivity only.More extra results can be obtained by using this method for other different cases.These results can introduce significant insights for responses of electromagnetic waves in time varying media.These insights can be useful for developing applications for electromagnetic waves in time varying medium.

Figure 2 .
Figure 2. Comparison between numerical and analytical solutions of the 2nd order D.E.

Figure 3 .
Figure 3.Time domain responses of (a) ε r ,µ r (b) W E , W H and (c) Normalized electric and magnetic fields at fixed point in space for linearly time varying medium.

Figure 4 .Figure 5 .Figure 6 .
Figure 4. Time domain responses of (a) W E , (b) W H , (c) Normalized E y , and (d) Normalized H x at fixed point in space for linearly time varying medium at f 0 = 10 GHz and a = 0.1f 0 .