Vous êtes sur la page 1sur 7

Stability and accuracy of the Euler Method: The explicit Euler method that we are using uses the

information from the previous step, y k, to calculate the following step, yk+1. Because of this, the stability of the Euler scheme is quite limited. This means that the step time that can be used must be a certain value in order to get a reasonable accuracy. In order to determine stability, the numerical solutions for each time step cannot diverge from each other; in other words, each of the solutions must approach zero in order to have a stable system. It is desirable to have as great a step size as possible since this reduces the computational cost of the scheme. The more stable a system is, the greater the step size can be. To judge the accuracy of the numerical method implemented, the values of the numerical solutions are compared to the values of the analytical solution. The difference in the values is the error in the system and the accuracy will be judged according to the global error of the numerical solution. For our purposes, a global error of 5% is the acceptable limit. When we look at the original graph with a step time, dt=0.01, we can see that the solution indeed approaches zero.

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

In order to see the stability of the scheme, the step times will be increased and compared to see the effects.

dt=0.1

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

It can be seen that the increase in step size has had very little effect on the overall solution of the system. Therefore the step time will be increased again. dt=1

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

Although the solution still goes towards zero, it is very clear that with such a large step size the accuracy of the solution is really bad. Next, the time step is reduced to see when the solution to the system better resembles that of the original graph. dt=0.5

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

dt=0.3

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

dt=0.2

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

At time step, dt=0.2, the curve of the graph is again quite close to the curve of the original solution. But since all of the solutions move towards zero in the same manner as the original solution, it can be said that the stability of the Euler scheme is really good. The global error of a numerical solution is the accumulation of errors through many iterations of a specific scheme. Therefore the global error of a numerical error is the error at the last iteration of the solution. In this case, it is the error at t=10[s]. Using the MATLAB code in appendix C, the error of the last iteration can be found. For the Euler scheme with a time step dt=0.01 the global error is 4.04%, which is inside the accuracy boundary set at the beginning. When the time step is increased to dt=0.1, the global error increases to 35.6%. So although the graph looks like it has a good accuracy, the error is too large to use.

Stability and accuracy of the Runge-Kutta Method: Unlike the Euler method which uses the previous step to calculate the next step, the Runge-Kutta method uses several derivations of the function between yk and yk+1 to simulate the effect of higher order derivatives. Due to this difference in the methods, the stability and accuracy of the two methods are going to differ. First we will once again begin by looking at the graph using a time step of dt=0.01.

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

Once again, the step time will be increased to see the stability of the numerical solution.

dt=0.1

1.4 1.2

1
position [m]

0.8

0.6 0.4

0.2

4 time [s]

10

dt=1

1.5

position [m]

0.5

-0.5

-1

4 time [s]

10

As can be seen, the solution using a time step dt=1 once again is not an accurate representation of the analytical solution but it is stable since the oscillations are gradually converging towards zero. Next the accuracy of the Runge-Kutta scheme is evaluated in the same manner as the Euler scheme. The global error of the numerical solution when the step time is dt=0.01 has been calculated to be 13.39%. Since this method

doesnt use the information from the previous step, the err or in the numerical solution seems to be considerably higher. In order to have an accuracy within the boundaries previously stated, the step time would have to be dt=0.0025 to get a global error of 3.45%. Therefore, the Euler method is better at developing a numerical solution for this system as it has higher accuracy than the Runge-Kutta method at higher step times.

Vous aimerez peut-être aussi