xlsindy.base_catalog package

Module contents

class xlsindy.catalog_base.Classical(symbolic_catalog: ndarray, binary_matrix: ndarray)

Bases: CatalogCategory

Classical newtonnian catalog.

Parameters:
  • symbolic_catalog (np.ndarray) – the catalog listing every symbolic function of the catalog (k,)

  • binary_matrix (np.ndarray) – the matrix of repartition of the symbolic function (k,num_coordinate)

create_solution_vector(coeff_matrix: ndarray)

This method output the solution vector from any solution related data.

Returns:

an array of shape (catalog_length,1) containing the coefficient that replicate the solution system.

Return type:

np.ndarray

Parameters:

coeff_matrix (np.ndarray) – a matrix of size (symbolic_catalog_length,num_coordinate) which coefficient represent the ideal solution coefficient

expand_catalog()

This method expand the catalog in a (catalog_length,num_coordinate) matrix.

Returns:

an array of shape (catalog_length,num_coordinate) containing all the function

Return type:

np.ndarray

label()

Return the label of the expanded catalog.

separate_by_mask(mask)

Separate the catalog by a mask. The mask is a boolean array of shape (catalog_length,).

Parameters:

mask (np.ndarray) – a boolean array of shape (catalog_length,) to separate the catalog.

Returns:

a new CatalogCategory with the masked data. CatalogCategory: a new CatalogCategory with the remaining data.

Return type:

CatalogCategory

class xlsindy.catalog_base.ExternalForces(interlink_list: List[List[int]], symbol_matrix: ndarray)

Bases: CatalogCategory

External forces catalog.

Parameters:
  • interlink_list (List[List[int]]) – Presence of the forces on each of the coordinate, 1-indexed can be negative for retroactive forces.

  • symbol_matrix (np.ndarray) – Symbolic variable matrix for the system.

create_solution_vector()

This method output the solution vector from any solution related data.

Returns:

an array of shape (catalog_length,1) containing the coefficient that replicate the solution system.

Return type:

np.ndarray

expand_catalog()

This method expand the catalog in a (catalog_length,num_coordinate) matrix.

Returns:

an array of shape (catalog_length,num_coordinate) containing all the function

Return type:

np.ndarray

label()

Return the label of the expanded catalog.

separate_by_mask(mask)

Separate the catalog by a mask. The mask is a boolean array of shape (catalog_length,).

Parameters:

mask (np.ndarray) – a boolean array of shape (catalog_length,) to separate the catalog.

Returns:

a new CatalogCategory with the masked data. CatalogCategory: a new CatalogCategory with the remaining data.

Return type:

CatalogCategory

class xlsindy.catalog_base.Lagrange(catalog, symbol_matrix: ndarray, time_symbol: Symbol)

Bases: CatalogCategory

Lagrange based catalog.

Parameters:
  • catalog (List[sympy.Expr]) – The catalog of functions to be used in the Lagrangian equations.

  • symbol_matrix (np.ndarray) – The matrix of symbolic variables (external forces, positions, velocities, and accelerations).

  • time_symbol (sympy.Symbol) – The symbolic variable representing time.

create_solution_vector(expression: Expr)

This method output the solution vector from any solution related data.

Returns:

an array of shape (catalog_length,1) containing the coefficient that replicate the solution system.

Return type:

np.ndarray

expand_catalog()

This method expand the catalog in a (catalog_length,num_coordinate) matrix.

Returns:

an array of shape (catalog_length,num_coordinate) containing all the function

Return type:

np.ndarray

label()

Return the label of the expanded catalog.

separate_by_mask(mask)

Separate the catalog by a mask. The mask is a boolean array of shape (catalog_length,).

Parameters:

mask (np.ndarray) – a boolean array of shape (catalog_length,) to separate the catalog.

Returns:

a new CatalogCategory with the masked data. CatalogCategory: a new CatalogCategory with the remaining data.

Return type:

CatalogCategory