Trouble in assertion

16 views
Skip to first unread message

Manoj Kumar

unread,
Mar 11, 2013, 3:49:30 AM3/11/13
to sy...@googlegroups.com
Hello,

Ive been trying to add this new hint called 'separable_reduced' in ode.py

According to this,

My equation is  eq = x* df  + f(x)* (1 / (x**2*f(x) - 1)

sol = dsolve(eq, hint = 'separable_reduced) gives sol = log(x**2*f(x))/3 + log(x**2*f(x) - 3/2)/6 == C1 + log(x)

 checkodesol(eq, sol, order=1, solve_for_func=False) also gives True.

However when I do assert sol.lhs == log(x**2*f(x))/3 + log(x**2*f(x) - 3/2)/6 ,
It gives me an assertion error because the lhs becomes log(x**2*f(x))/3 + log(x**2*f(x) - 1)/6 as 3/2 = 1

I've faced this problem before. How do I overcome this?






Chris Smith

unread,
Mar 11, 2013, 4:25:01 AM3/11/13
to sy...@googlegroups.com
write S(3)/2

Ankit Agrawal

unread,
Mar 11, 2013, 2:11:05 PM3/11/13
to sy...@googlegroups.com
Even I encountered this problem once. Rational(3, 2) should solve it.

Manoj Kumar

unread,
Mar 11, 2013, 2:12:34 PM3/11/13
to sy...@googlegroups.com
S(3) does it well too? :)


--
You received this message because you are subscribed to a topic in the Google Groups "sympy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sympy/FWAgm1JNbaI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Regards,
Manoj Kumar,
Mech Undergrad.
BPGC
Blog

Ankit Agrawal

unread,
Mar 11, 2013, 2:46:39 PM3/11/13
to sy...@googlegroups.com
Yeah. It does. :)

Regards,
Ankit.

Reply all
Reply to author
Forward
0 new messages