You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import sympy as sy
t=sy.symbols('t')
y1=sy.Function('y1')
y2=sy.Function('y2')
eqs=(sy.Eq(y1(t).diff(t),y1(t)+2*y2(t)), sy.Eq(y2(t).diff(t),-2*y1(t)+y2(t)+2*sy.exp(t)))
s=sy.dsolve(eqs) # General solution
y1g=s[0].args[1]
y2g=s[1].args[1]
# Find C1 and C2 so that the initial condition is satisfied
sol=sy.solve([y1g.subs(t,0)-1,y2g.subs(t,0)-1])
y1=y1g.subs(sol)
y2=y2g.subs(sol)
print([y1,y2])
I tried to solve the following initial value problem
with sympy using the code
The solution I get is
which is wrong. The correct solution is
I am running python 3.3.2 with sympy 0.7.3 under fedora 19 x64.
The text was updated successfully, but these errors were encountered: