pyrc.tools.science#
- build_jacobian(terms: list, variables: list, involved_symbols: list, num_cores: int = None) MutableSparseMatrix#
creates the jacobian matrix using all terms and their involved symbols.
- Parameters:
terms (list) – All terms in a list.
variables (list) – All variables of all terms in a list.
involved_symbols (list) – Lists with the symbols the derivative must be created for each term in a list. So for term[0] there are only the variables involved_symbols[0] relevant. It is used to make the calculation faster and set 0 to all other places in the jacobian matrix where the symbols are not involved.
num_cores (int, optional) – The number of cores that should be used to calculate the jacobian matrix. If None, the maximum number of cores except one is used. If 1 or smaller, no parallel computing is used.
- Returns:
The jacobian matrix with symbols.
- Return type:
Any
- celsius_to_kelvin(celsius)#
- cm_to_inch(value)#
- compute_jacobian_batch(_batch, _terms, _dependent_variables, _all_variables)#
- get_free_ram()#
- get_free_ram_gb()#
- is_numeric(value)#
Checks if value is a numeric value.
- Parameters:
value (Any) – Value to check.
- Returns:
True if value is numeric, False otherwise
- Return type:
bool
- kelvin_to_celsius(kelvin)#
- round_valid(number: float | int, valid_digits: int, return_str: bool = False)#