Hi, you may try something like this, as a stopgap replacement:
In [1]: sol = dsolve(Eq(Derivative(f(x), x), ((1+3 * x**2) / (3 * f(x) + 6
))), f(x), ics={f(0):1})
In [2]: sol
Out[2]:
_____________ _____________
___ / 3 ___ / 3
\/ 6 *\/ C1 + x + x \/ 6 *\/ C1 + x + x
[f(x) = - ---------------------- - 2, f(x) = ---------------------- - 2]
3 3
In [6]: C1 = symbols("C1")
In [7]: solve(sol[0].args[1].subs(x, 0) - 1, C1)
Out[7]: []
In [8]: solve(sol[1].args[1].subs(x, 0) - 1, C1)
Out[8]: [27/2]
In [10]: sol[1].subs(C1, _[0])
Out[10]:
_____________
___ / 3 27
\/ 6 * / x + x + --
\/ 2
f(x) = ----------------------- - 2
3
On Wednesday, 3 June 2015 14:14:58 UTC+2, Denys wrote:
>
> hi, I'm trying to solve this ODE with the SymPy:
>
> dsolve(Eq(Derivative(f(x), x), ((1+3 * x**2) / (3 * f(x) + 6))), f(x),
> ics={f(0):1})
>
>
> and it it prints out
>
>
> _________________ _________________
>
> / 3 / 3
>
> \/ C1 + 6*x + 6*x \/ C1 + 6*x + 6*x
>
> [f(x) = - -------------------- - 2, f(x) = -------------------- - 2]
>
> 3 3
>
> ...it doesn't eliminate the constant C1, it doesn't use the initial
> condition. Is it a bug or wrong usage?
>
--
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 [email protected].
To post to this group, send email to [email protected].
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/1650b632-74c3-4a3f-9cc4-f8430af606e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.