Models

class balancepy.model_sim.peterka18.Peterka18(mass_kg=None, height_m=None, data_exp=None, ModelName=None, config=None)

Bases: BaseModel

default_config = {'ModelName': 'Peterka 2018', 'data_exp': None, 'height_m': None, 'mass_kg': None}
property dynamics

Dynamics of the Peterka 2018 model. The function returns a transfer function of the model. The function is given by

\[H_{vis} = \frac{W \cdot NC \cdot TD \cdot B}{ 1 - TF \cdot NC \cdot TD + NC \cdot TD \cdot B }\]

where \(s = i\omega\), \(NC = K_p + s K_d\), \(NC = \exp{-s\tau}\), \(B = \frac{1}{J\cdot s^2 - mgh}\), and \(TF = \frac{K_t}{s}\), .

For more details see Peterka et al. (2018).

Parameters:

params_free – Parameters to be optimized.

Returns:

Objective function value.

Return type:

err

static frf_smoothing(frf, freq)
objective(params_free=None)

Objective function for optimization. Applies a smoothing of the frf across frequencies. The error is given by

\[\mathrm{err} = \sum_{i} \frac{ \left| H_{\mathrm{sim},i} - H_{\mathrm{exp},i} \right| }{ \left| H_{\mathrm{sim},i} \right| }\]

where \(H_{\mathrm{sim},i}\) is the smoothed simulated FRF at frequency index \(i\), and \(H_{\mathrm{exp},i}\) is the smoothed experimental/reference FRF.

Parameters:

params_free – Parameters to be optimized.

Returns:

Objective function value.

Return type:

err

class balancepy.model_sim.asslaender23.Asslaender23(mass_kg=None, height_m=None, data_exp=None, ModelName=None, config=None)

Bases: BaseModel

default_config = {'ModelName': 'Asslaender 2023', 'data_exp': None, 'height_m': None, 'mass_kg': None}
property dynamics

Dynamics of the Peterka 2023 model. The function returns a transfer function of the model. The function is given by

\[TF = \frac{W \cdot NC \cdot TD \cdot B}{ 1 - TF \cdot NC \cdot TD + NC \cdot TD \cdot B }\]

where \(s = i\omega\), \(NC = K_p + s K_d\), \(NC = \exp{-s\tau}\), \(B = \frac{1}{J\cdot s^2 - mgh}\), and \(T = \frac{K_t}{F_{lp}s + 1}\), .

For more details see Asslaender et al. (2023).

Parameters:

params_free – Parameters to be optimized.

Returns:

Objective function value.

Return type:

err

static frf_smoothing(frf, freq)
objective(params_free=None, freq=None, reference_frf=None)

Objective function for optimization. Applies a smoothing of the frf across frequencies. The error is given by

\[\mathrm{err} = \sum_{k=0}^{N-1} \log\left(2\beta \left| H_m(\theta, k) \right|\right) + \sum_{k=0}^{N-1} \frac{ \left| H_e(k) - H_m(\theta, k) \right| }{ \beta \left| H_m(\theta, k) \right| }\]

where \(H_m(\theta, k)\) is the simulated FRF at frequency index \(k\) and parameter set \(\theta\), \(H_e(k)\) is the experimental/reference FRF, and \(\beta\) is the scale of the laplace distribution.

Parameter

params_free: Parameters to be optimized.

returns:

err: Objective function value.