Example of a More Complex Cost Function

Note:

Functionality featured in the example(s) in this section applies to multiple design types.

As an example of a more sophisticated cost function, consider the figure. It belongs to a connector simulated in HFSS with more than four ports.

Goals tab, optimizer Sequential Nonlinear Programming selected. Cost function entered in tabular format.

The cost function given here concentrates only on a signal sent into port in_1. Suppose the specifications to be met are: reflection, backward cross talk and forward cross talk all smaller than or equal to -20 dB, of which the forward cross talk is the most important.

The first three entries in the cost function enforce those specifications, with the weight for the forward cross talk being a larger number than the other weights. The actual values for the weights are somewhat arbitrary and serve as examples only. For this cost function, as long as specifications are not met, the optimizer puts the most effort in getting the forward cross talk close to its specification. Once the three specifications have been satisfied, their contributions to the cost function become zero, and only the fourth entry remains. Remember that the connector has more than four ports, so satisfying the given specs does not guarantee maximum transmission.

The fourth line tries to maximize the transmission by asking for S(out_1, in_1) to be 0 dB. That will never be reached, but its presence forces the optimizer to improve the connector a bit beyond the specifications.

The cost function norm type specifies how the four lines are combined into one cost function with one value. With L1 and L2, all four contribute simultaneously, rather than only the largest of the four at any one time.