Added cost function for stable limit cycle.