I am trying to write a simple SymPy function.
a = Wild('a')
b = Wild('b')
p = Wild('p')
q = Wild('q')
...
if (U).match(b/(a+s)):
return b*exp(-a*t)
Lets say that U = 3/(7+s). I would like my result to be 3*exp(-7*t), but it just returns b*exp(-a*t).
Is there a way to get those values and assign them to a and b?
Sure. First, set up the system:
The
.matchmethod returns a dictionary:which can then be passed as an argument to
.subs: