Mixed equation-simulation circuit optimization