Solve a differencial equation with constraints

74 views
Skip to first unread message

Geoffrey Mégardon

unread,
May 22, 2014, 5:47:03 AM5/22/14
to sy...@googlegroups.com
Hi!

I' m trying Sympy this morning and I tried to do this:

equations = [
Eq(a(t).diff(t), (I(t) - gamma*a(t))/theta ),
Eq(a(0), 0),
Eq(I(t), 30) ]

dsolve(equations, a(t))

I was thinking it would try to resolve the first equation with the constraints given by the 2 others equations.
But apparently that doesn't work as I thought.

I also tried with the function:
solve()

But it said it can't resolve the third equation.

Is there a simple way to resolve a set of equations like that?

Aaron Meurer

unread,
May 22, 2014, 7:51:26 PM5/22/14
to sy...@googlegroups.com
To add initial conditions to dsolve, you need to use the ics
parameter, like dsolve(eq, f(x), ics={f(0):1}). dsolve doesn't
currently integrate with solve to remove the I(t). You'll need to do
that separately, either before or after you run dsolve.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/aabdb8e2-34db-4061-b65c-808ba4c4a33c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages