Here's an example of my problem. I define all the variables, except x
which is automatic in the notebook session. Then I try to substitute an expression of previously defined variable omega_P
.
In [2]: omega, omega_P, omega_C = symbols('omega omega_P omega_C')
R = 1 - omega_P**2/(omega*(omega+omega_C))
pprint(R)
2
ω_P
1 - ───────────
ω⋅(ω + ω_C)
In [3]: x = omega_P**2/omega**2
pprint(x)
2
ω_P
────
2
ω
In [4]: pprint(R.subs(omega_P**2, x*omega**2))
2
ω_P
1 - ───────────
ω⋅(ω + ω_C)
omega_P
was not changed by subs()
.