After long ours of works the program can optimize the beam using constant section and meeting the minimum resistance requirements.
In red you can see the initial state of the beam before the optimization. In blue is a approximate representation of the final optimized beam.
This graphic shows the values of the variable defining the geometry of the beam over the multiple iterations of the optimizer. From top to bottom: h, b, a and c.