f3dasm_simulate.abaqus.amplitudesampler.AmplitudeGenerator

class AmplitudeGenerator(num_control=8, num_steps=100, num_amplitude=1, arg_name='amplitude', interpolation_method='quadratic', num_dim=3, seed=None)[source]

Bases: object

amplitude generator

Initialization

List of Public Methods

generate_control_points

generate control points

get_amplitude

get amplitude curves

interpolation

do interpolation

plot_amplitude

plot amplitude

Methods

__init__(num_control=8, num_steps=100, num_amplitude=1, arg_name='amplitude', interpolation_method='quadratic', num_dim=3, seed=None)[source]

Initialization

static generate_control_points(seed, num_control, num_steps, num_dim=3)[source]

generate control points

Parameters:
  • seed (int) – seed

  • num_control (int) – control points number

  • num_steps (int) – number of steps for abaqus simulation

  • num_dim (int, optional) – number of dimension, by default 3

Returns:

x_location of control points, y_location of control points

Return type:

tuple[ np.ndarray[any, np.dtype[np.floating]], np.ndarray[any, np.dtype[np.floating]], ]

get_amplitude()[source]

get amplitude curves

Parameters:
  • num_amplitude (int) – number of amplitude, usually 3 or 6

  • num_control (int) – control points number

  • num_steps (int) – num steps of abaqus simulation

  • arg_name (str, optional) – name of amplitude, by default “amplitude”

  • interpolation_method (str, optional) – interpolation method, by default “quadratic”

  • seed (any, optional) – seed , by default None

Returns:

_description_

Return type:

pd.DataFrame

static interpolation(x_control, y_control, num_steps, interpolation_method='quadratic')[source]

do interpolation

Parameters:
  • x_control (np.ndarray) – x location of control points

  • y_control (np.ndarray) – y location of control points

  • num_steps (int) – number of steps of abaqus simulation

  • interpolation_method (str, optional) – interpolation method, by default “quadratic”

Returns:

amplitude

Return type:

np.ndarray

plot_amplitude(fig_name='amplitude_path.png', save_fig=False, internal=True, **kwargs)[source]

plot amplitude

Parameters:
  • fig_name (str, optional) – figure name, by default “amplitude_path.png”

  • save_fig (bool, optional) – save figure, by default False

  • internal (bool, optional) – approach this function from internal or external, by default True

Return type:

None