Hi,
I usually use symbols first, and only substitute into the final
result, that way I can see what's going on under the hood:
In [8]: var("a b c d")
Out[8]: (a, b, c, d)
In [9]: Eq4=a*A(t)-b*A(t).diff(t)-c*A(t).diff(t,2)+d
In [10]: Eq4
Out[10]:
2
d d
a⋅A(t) - b⋅──(A(t)) - c⋅───(A(t)) + d
dt 2
dt
In [11]: soln = dsolve(Eq4)
In [12]: soln
Out[12]:
⎛ ____________⎞ ⎛ ____________⎞
⎜ ╱ 2 ⎟ ⎜ ╱ 2 ⎟
t⋅⎝-b - ╲╱ 4⋅a⋅c + b ⎠ t⋅⎝-b + ╲╱ 4⋅a⋅c + b ⎠
──────────────────────── ────────────────────────
2⋅c 2⋅c d
A(t) = C₁⋅ℯ + C₂⋅ℯ - ─
a
In [13]: soln.rhs
Out[13]:
⎛ ____________⎞ ⎛ ____________⎞
⎜ ╱ 2 ⎟ ⎜ ╱ 2 ⎟
t⋅⎝-b - ╲╱ 4⋅a⋅c + b ⎠ t⋅⎝-b + ╲╱ 4⋅a⋅c + b ⎠
──────────────────────── ────────────────────────
2⋅c 2⋅c d
C₁⋅ℯ + C₂⋅ℯ - ─
a
In [14]: soln.rhs.subs({a: -123456.78, b: -9876.54, c: -0.00032, d:
1357908.64})Out[14]:
12.4999979732365⋅t -30864199.999998⋅t
C₁⋅ℯ + C₂⋅ℯ + 10.999060885923
Is the [14] what you wanted to get?
Ondrej
> --
> 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/88a9432e-a322-460b-9556-ddd85cdad519%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.