For a project dealing with differential equations, I would like to replace all the variables "y"
of my differential equation with another expression, like the sympy.subs()
method actually does.
However, I want to get totally rid of Sympy and only use Mathics.
Is this possible? I started to look into Rule
and Pattern
classes, but I didn't really understand.
Here's an example of what I expect :
session = MathicsSession()
x = Symbol("x")
y = Symbol("y")
eq1str = "Derivative[y, {x, 2}] + 100 * y"
eq1 = session.evaluate(eq1str).to_python()
eq2str = "cos(x) + x**2"
eq2 = session.evaluate(eq2str).to_python()
#Here: in "eq1" replace "y" by "eq2