rl_write_control_parameters function

Function to find and write the best control parameters.