On 19/11/2020 15:37, Oscar Benjamin wrote:

I obviously wasn't paying enough attention when I wrote that :)

I know the feeling, because I also managed to garble the differential equation, which should read:

n**2*f(x) - x*Derivative(f(x), x) + (1 - x**2)*Derivative(f(x), (x, 2))

I am pretty sure that should resolve to a simple differential equation after the substitution x=cos(t)

I tried to follow your prescription but I think the confusion may have set in here,

In [233]: xf = Function('x') # make x a function of t
because I guess I don't need xf because the ODE is already represented in terms of an undefined function f(x).

I also had difficulty following what you were doing once I reached the nested lambda expressions!

It would be great if you could find the time to demonstrate your method on my example - a working example is always worth its weight in gold.

When I originally put in this query, I had assumed that there would be a one-line answer buried in SymPy.

I have also explored my own Python solution to the problem, recursively processing down the whole ODE expression and picking off the derivatives as I come across them. It looks feasible, but it isn't finished yet.

I know it is a very busy time for you right now, so if you want to put this in your pending tray for a week, that is fine :)

David


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/443dcf54-23af-d641-f5bf-55a32d3cf4c5%40dbailey.co.uk.

Reply via email to