With the help of the block To workspace, you can easily import the data generated by your Xcos simulation, and use Scilab for post-processing and optimization.

Download the Xcos model & the optimization script