Numerical simulation is an important tool in understanding the electromagnetic field and how it interacts with the environment. Different topics for time-domain finite-difference (FDTD) and finite-element (FETD) methods for Maxwell's equations are treated in this thesis. Subcell models are of vital importance for the efficient modeling of small objects that are not resolved by the grid. A novel model for thin sheets using shell elements is proposed. This approach has the advantage of taking into account discontinuities in the normal component of the electric field, unlike previous models based on impedance boundary conditions (IBCs). Several results are presented to illustrate the capabilities of the shell element approach. Waveguides are of fundamental importance in many microwave applications, for example in antenna feeds. The key issues of excitation and truncation of waveguides are addressed. A complex frequency shifted form of the uniaxial perfectly matched layer (UPML) absorbing boundary condition (ABC) in FETD is developed. Prism elements are used to promote automatic grid generation and enhance the performance. Results are presented where reflection errors below -70dB are obtained for different types of waveguides, including inhomogeneous cases. Excitation and analysis via the scattering parameters are achieved using waveguide modes computed by a general frequency-domain mode solver for the vector Helmholtz equation. Huygens surfaces are used in both FDTD and FETD for excitation in waveguide ports. Inverse problems have received an increased interest due to the availability of powerful computers. An important application is non-destructive evaluation of material. A time-domain, minimization approach is presented where exact gradients are computed using the adjoint problem. The approach is applied to a general form of Maxwell's equations including dispersive media and UPML. Successful reconstruction examples are presented both using synthetic and experimental measurement data. Parameter reduction of complex geometries using simplified models is an interesting topic that leads to an inverse problem. Gradients for subcell parameters are derived and a successful reconstruction example is presented for a combined dielectric sheet and slot geometry