# BGA Example bga-5 for the Surface Evolver

[Click for the bga-5.fe datafile in a second window.]

This model does a movable upper pad with an external load on it.

#### Notable features:

• Declaring a parameter to be an "optimizing_parameter" instead of a "parameter" in the datafile makes it subject to optimization during iteration, like vertex coordinates. At runtime, any parameter can be converted back and forth with "fix parametername" and "unfix parametername". To get the top pad to float, we make it an optimizing parameter.
• To implement the external load on the top pad, we define a potential energy for one vertex by defining a named quantity "pad_energy" using the method "vertex_scalar_integral" with the integrand "pad_weight*z". "pad_weight" is a parameter, and changing it at runtime does change the load immediately, since it is used in an integrand formula.
• One could put the quantity "pad_energy" on any vertex of the upper pad, but I chose to create an auxiliary vertex, vertex 13, to put the load on, in anticipation of lateral loads later on. Vertex 13 is given the attribute "bare" so the Evolver doesn't warn about the vertex not being attached to any edges.
• Gradients and hessians with respect to an optimizing parameter are done with central differences, so they can slow things down. The default parameter difference is 1e-4, but that can be changed by adding a "pdelta = value" attribute to the parameter definition in the datafile.
• To do a sort of impedance matching of the optimizing parameter gradient with the gradient of the rest of the energy, there is another attribute one can define for a parameter, "pscale". It multiplies the motion of the parameter. If the parameter is moving too glacially slowly, try increasing the parameter's pscale. On the other hand, if it moves too fast (as for example the top surface of the ball joint), reduce pscale. The rule of thumb to remember is that a large surface depending on one parameter feels a large force, since a change in the parameter is responsible for a large portion of surface moving, and using a small pscale can bring down the effective area of the large surface to match that of the regular surface facets. Experiment with pscale to find the right value for your application. The default pscale value is 1.
• As the datafile is set up, the load decreases the height from 0.12 to about 0.105 when "gogo" is run.
• Negative values of "pad_load" can be used to model a BGA joint on the underside of a board.