sympy/sympy-live

Problem with solve

ivanistheone opened this issue · 1 comments

I ran into a strange case where solve doesn't return an answer

x_i, y_i = (1.04, 0.0911)
v_xi, v_yi = (4.42, 0.778)
y = -9.8/2*t**2 + v_yi*t + y_i
y
# -4.9*t**2 + 0.778*t + 0.0911

y.diff(t)
# -9.8*t + 0.778

solve( y.diff(t), t)
# expected:  [0.079]   but outputs   [] 

# workaround
solve( y.diff(t).subs({t:z}), z)
[0.0793877551020408]

http://live.sympy.org/?evaluate=x_i%2C%20y_i%20%3D%20(1.04%2C%200.0911)%0A%23--%0Av_xi%2C%20v_yi%20%3D%20(4.42%2C%200.778)%0A%23--%0Ay%20%3D%20-9.8%2F2*t**2%20%2B%20v_yi*t%20%2B%20y_i%0A%23--%0Ay%0A%23--%0Ay.diff(t)%0A%23--%0A%23%20expected%3A%20%20%5B0.079%5D%20%20%20but%20outputs%20%20%20%5B%5D%0Asolve(%20y.diff(t)%2C%20t)%0A%23--%0A%23%20workaround%0Asolve(%20y.diff(t).subs(%7Bt%3Az%7D)%2C%20z)%0A%23--%0A

Not sure what could be behind this. I can confirm it works fine on the command line.

Just tested; cannot reproduce. Must have been a bad session or a transient error.