Evaluation of MATLAB Methods used to Solve Second Order Linear ODE

Most second-order Ordinary Differential Equations (ODES) arising in realistic applications such as applied mathematics, physics, metrology and engineering. All of these disciplines are concerned with the properties of differential equations of various types. ODES cannot be solved exactly. For these problems one does a qualitative analysis to get a rough idea of the behavior of the solution. Then a numerical method is employed to get an accurate solution. In this way, one can verify the answer obtained from the numerical method by comparing it to the answer obtained from qualitative analysis. In a few fortunate cases a second-order ode can be solved exactly. Because of the big efforts needed to solve second order linear ODES, some MATLAB methods were investigated, the result of these methods were studied and some judgment were done regarding the results accuracy and implementation time.


INTRODUCTION
Many physical phenomena and processes are modeled by second order ODE's such as Mechanical Systems/Vibrations (springs, pendulums, etc.), Electrical Circuits and One Dimensional Motion (Bryant et al., 2008a, b;Fels and Olver, 1997).
Most second-order ODES arising in realistic applications cannot be solved exactly.For these problems one does a qualitative analysis to get a rough idea of the behavior of the solution (Kruglikov, 2008).Then a numerical method is employed to get an accurate solution.In this way, one can verify the answer obtained from the numerical method by comparing it to the answer obtained from qualitative analysis.In a few fortunate cases a second-order ode can be solved exactly.So it is important to minimize the efforts needed to get the exact solution of second order ODE and to minimize the time needed to solve such equations.
The equation with constant coefficients-on which we will devote considerable effort-assumes that p (ˮ) and J (ˮ) are constants, independent of time.The second-order linear ode is said to be homogeneous if ˧ (ˮ) = 0 (Kruglikov and Lychagin, 2006a;Nurowski and Sparling, 2003;Yumaguzhin, 2008).
Second order ODE is considered to linear homogeneous (Hsu and Kamran, 1989;Ibragimov and Magri, 2004;Kruglikov, 2008) if the right hand side equal zero and inhomogeneous if not.
In practical life we can deal with different types (Kruglikov andLychagin, 2006b, 2008) of second order linear equations depending on the roots of the characteristic equation which represent the differential equation and these roots may be: Table 1 shows some examples of these types and these equations will be analyzed and implemented later in the experimental part of this study.

METHODS AND TOOLS
The methods which were used in this study are different MATLAB functions used to solve second order linear ODES and SIMULINK models.
All the methods used in the previous code show the same results as shown in Fig. 2, which means that the solutions were accurate and meat the real analytical and numerical solution.But which method to use better?All of them give accurate results as shown in Fig. 2, but which is the fastest method?
Table 2 show the time needed to solve Eq. ( 2) by each of the above mentioned methods.
The following experiments were performed: Experiment 1: The following inhomogeneous ODE was solved: And below are the implementation results.Figure 3 shows the matching between the 2 results.And below are the implementation results.
Figure 4 shows the matching between the 2 results.
Time for dsolve = Elapsed time is 0.031000 sec Time for laplace = Elapsed time is 0.016000 sec Experiment 3: The previous code was implemented using various ODES such as mentioned in Table 1, 20 examples of each type of ODE were taken and implemented, 20 SIMULINK models were built for each type of ODE and Table 3 summarizes the results of this experiment focusing on the executions time.

RESULTS AND DISCUSSION
The above mentioned methods are very accurate in solving second order linear ODES as was shown in Fig. 2 to 4.
From the results in Table 3 we can say that the best method (with minimum implementation time) is SIMULINK modeling, but it needs more efforts in building the desired model (in experiment 3 it took 900 min to build and run 180 models).

CONCLUSION
From the results obtained previously we can conclude the following: • The best performance can be achieved using SIMULINK models, but extra efforts are needed to build the model.• Among the programming methods the best performance can be achieved using Laplace transforms and the worst performance can be achieved by dsolve method.• Comparing with dsolve method Laplace method has a speedup of 2 times, ODE 113 has a speedup of 1.525 times and ODE 45 has a speedup of 1.15 times.

Table 1 :
Examples of second order linear ODE Equation No.