Device Simulation and Optimization