coordinates.coordinate_systems.OblateSpheroidalCoordinateSystem.substitute_expression#

OblateSpheroidalCoordinateSystem.substitute_expression(expression: Symbol | Expr | MutableDenseMatrix | MutableDenseNDimArray | ImmutableDenseMatrix | ImmutableDenseNDimArray) Symbol | Expr | MutableDenseMatrix | MutableDenseNDimArray | ImmutableDenseMatrix | ImmutableDenseNDimArray#

Replace symbolic parameters with numerical values in an expression.

This method takes a symbolic expression that may include parameter symbols and substitutes them with the numerical values assigned at instantiation.

Parameters:

expression (str or sympy expression) – The symbolic expression to substitute parameter values into.

Returns:

The expression with parameters replaced by their numeric values.

Return type:

sympy expression

Notes

  • Only parameters defined in self.__parameters__ are substituted.

  • If an expression does not contain any parameters, it remains unchanged.

  • This method is useful for obtaining instance-specific symbolic representations.

Example

from sympy import Symbol
expr = Symbol('a') * Symbol('x')
coords = MyCoordinateSystem(a=3)
print(coords.substitute_expression(expr))
3*x