# symbolic-math

## Anyway to get rid of `math.floor` for positive odd integers with `sympy.simplify`?

Anyway to get rid of `math.floor` for positive odd integers with `sympy.simplify`? Question: I’m trying to simplify some expressions of positive odd integers with sympy. But sympy refuses to expand floor, making the simplification hard to proceed. To be specific, x is a positive odd integer (actually in my particular use case, the constraint is …

## Sympy is not doing the substitution of a symbol with a value when it has a specified assumption

Sympy is not doing the substitution of a symbol with a value when it has a specified assumption Question: I’m using the subs method to replace certain parameters in an expression with values prior to solving the equation. The following simple example works fine: from sympy import Symbol Q = Symbol("Q") exp1 = Q + …

## how to change int to Binary value

how to change int to Binary value Question: I have a problem changing my data into binary. It’s not so complicated just using basic math; like if a = 60, then the result is "good", and when a >= 60, then it is "very good", but this is implemented in the data below: This is …

## Python's sympy struggling to solve simple equality

Python's sympy struggling to solve simple equality Question: I’m solving a problem and have a simple equality which I can solve on my calculator. Sympy, for some reason, struggles. These are the problematic lines of code: import sympy V = sympy.symbols(‘V’) eq = sympy.Eq(1.0 – 1.0*sympy.exp(-0.00489945895346184*V), 0.98) sol = sympy.solve(eq,V) I get no errors or …

## How to fix the error name 'phi' is not defined?

How to fix the error name 'phi' is not defined? Question: I’m trying to solve the following laplace transform: f(t) = sen(ωt + φ) I wrote the following code to solve the problem import sympy as sym from sympy.abc import s,t,x,y,z from sympy.integrals import laplace_transform from sympy.integrals import inverse_laplace_transform omega = sympy.Symbol(‘omega’, real=True) sin = …