Optimization of accelerator parameters using normal form methods