# Harmonic Balance computations¶

## Treatments¶

Several specific treatments for Harmonic Balance computations are available such as:

## Specific function¶

Initialize the HbComputations for a TSM computation with two rows.

Parameters:
• nharm – the number of harmonics of the computation

• list_omega – rotation speed of both rows expressed in radians per second

Returns:

the two HbComputations

## HbComputation object¶

Defines an Almost-Periodic Computation.

The HbComputation object can ease setting up the Harmonic Balance computations.

### Parameters¶

• frequencies: numpy.ndarray

List of frequencies considered. For TSM, put also the harmonics, not only the fundamental frequency.

• timelevels: numpy.ndarray

List of timelevels. Default is evenly spaced timelevels on the smallest frequency.

• phaselag: numpy.ndarray

List of phaselags associated to each frequency.

### Main functions¶

class antares.HbComputation

Define an Almost-Periodic Computation.

The IDFT and DFT Almost-Periodic Matrix can be computed. All the definitions are based on the following article

ap_dft_matrix(frequencies=None, timelevels=None)

Compute the Almost-Periodic DFT matrix

ap_idft_matrix(frequencies=None, timelevels=None)

Compute the Almost-Periodic IDFT matrix

ap_source_term(frequencies=None, timelevels=None)

Compute the Almost-Periodic source term which is to $$D_t[\cdot] = i A^{-1} P A$$, where $$A$$ denotes the DFT matrix, $$A^{-1}$$ the IDFT matrix and $$P = diag(-\omega_N,\cdots,\omega_0,\cdots,\omega_N )$$

conditionning()

Returns the condition number of the almost periodic IDFT matrix

get_evenly_spaced(base_frequency=None)

Set the timelevels vector as evenly spaced over the base frequency period.

optimize_timelevels(target=0.0)