Novel Techniques for Non-Convex Optimization and Time-Domain Simulations of Electromagnetic Systems