GSoC'20 - Week 9

This week, the main work included making the method work and trying different test cases from Linear 2 equations, Order 2, Type 1-11 systems of ODEs

Higher Order to First Order reduction

To reduce higher order ODE to first order ODE, all we had to do was introduce dummy functions. Lets explain this with an example:

In [17]: x, y = symbols('x, y', cls=Function)                                                                                                                                                               

In [18]: eqs = [Eq(x(t).diff(t, 2), x(t).diff(t) + y(t)),  
    ...:        Eq(y(t).diff(t), y(t) + x(t))]                                                                                                                                                               

Now, for the given system, the solution cannot be obtained using any of the introduced linear system of ODEs solvers since they can only solve first order system of ODEs. But, if we can reduce this system into a first order system of ODE, then perhaps we can use our introduced solvers to solve the above system. We can do this by introducing a dummy variable for x(t).diff(t). Lets call it x_1(t). Then we will have our system as:

In [20]: x_1 = Function(Dummy('x_1'))                                                                                                                                                                       

In [21]: first_order_eqs = [eq.subs({x(t).diff(t): x_1(t)}) for eq in eqs] +\ 
    ...:                   [Eq(x(t).diff(t), x_1(t))]                                                                                                                                                       

In [22]: first_order_eqs                                                                                                                                                                                    
Out[22]: 
[Eq(Derivative(x_1(t), t), x_1(t) + y(t)),
 Eq(Derivative(y(t), t), x(t) + y(t)),
 Eq(Derivative(x(t), t), x_1(t))]

Now this system becomes solvable by our linear solvers. After we get the solution for the three dependent variables, we can just choose the solutions for the primary dependent variables and that will be our answer.

So, for a particular dependent variable, if the maximum order(in the whole system) of that dependent variable is n then the number of dummy variables and equations to be introduced will be n-1. Along with that, we will have to form a chain of dependent variables introduced down to our primary dependent variable:

x(t).diff(t) = x_1(t)
x_1(t).diff(t) = x_2(t)
....

Problem with this method

This method isn’t able to deal with Linear, 2 equations, order 2, types 5-11. A general solution for Type 9 has to be introduced. This will be the main highlight of this week’s work

Written on August 3, 2020