Implementing non homogeneous euler equation

37 views
Skip to first unread message

Kundan Kumar

unread,
Mar 13, 2014, 5:26:48 PM3/13/14
to sy...@googlegroups.com
Hi,
I am implementing nth order euler non homogeneous equation (homogeneous has already been implemented). But I am unable to understand what is key of "match" used in each function. From already implemented homogeneous euler equation, I got to know that match.keys also contain the order of each differential term (like shown in code below) along with the matching terms of type of ODEs.

for i in r.keys():
        if not isinstance(i, str) and i >= 0:
            chareq += (r[i]*diff(x**symbol, x, i)*x**-symbol).expand()
(this is for converting a differential eq to polynomial and then simplifying it by replacing f(x) by x**symbol, where symbol = Dummy('x'))

homogeneous eq:       a*x^2*f(x).diff(x,2) + b*x*f(x).diff(x) + c*f(x) = 0
non homogeneous eq: a*x^2*f(x).diff(x,2) + b*x*f(x).diff(x) + c*f(x) = g(x)

this is the code under "ode_nth_linear_euler_eq_homogeneous" under L3178
I am using the same code for non homogeneous but there I have extra g(x) term and I am unable to decide what r.keys() has in itself for g(x) as g(x) has x**(power) term.

Aaron Meurer

unread,
Mar 16, 2014, 3:15:38 PM3/16/14
to sy...@googlegroups.com
Did you figure this out?

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/652037c1-ee37-4c8c-a222-c49241a40c21%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Kundan Kumar

unread,
Mar 16, 2014, 9:15:51 PM3/16/14
to sy...@googlegroups.com
Yeah, I got it. Thanks
Reply all
Reply to author
Forward
0 new messages