User:Ramiamro
Contents
Project Report for User:Ramiamro[edit]
For Introduction to Numerical Analysis, Fall 2010.
Introduction[edit]
the project intended to clarify the concept of the stability of w:ordinary differential equations' Methods, and especially RungeKutta methods of order four RK4,it is also discussing the shape of the absulute stability regions for each method, many examples, quizes , and exercises have been established on wikiversity and wikipediaw:stiff equation, this establishment focused on users who have little experience with stability, such that thay can grasb the concept of absolute stability[1] as well as A/L stablility, more over the project studies particular examples of finding the characteristic polynomial for the multistep methods.
To operate numerical methods on stiff equations and get good approximation for the exact solution; methods with special stability are required, like Astable or Lstable methods, if the method is applied with h>0 to the test equation then for Astable method, it will produce approximation function to the exact solution which will be proportional to , the approximation function will be bounded by 1 in the left half of the complex plane, which gave us the stability region, and so we can chose the step size which suitable for a certain kind of equation using that method.
Initial Experience[edit]
 During the course and in courses before I introduced to many types of stabilities, but each time I have those we talked about similar diffenetions of stability in different topics, like stability for ODE's and stability of nonlinear systems, as well the stability for physical systems.
 To study stability it is important to define the area you study in, the stability diffinitions are similar but at the same time time they are significantly different in details; in numerical analysis we talk about the stability of the method when we apply it to a certain type of equations. i.e. the test equation, our cocentration during this course was on the stiff equation, which is a differential equation that shows wide variance in the results as a result of small changes in the argument (the independent variable), some of the numerical methods shows very good stability when treating such kind of equations, specially the implicit methods, we will see during the project how the explicit methods Rk4 , and others how they behave when they employed to simulate the exact solutions of those equations.these modifications manifisted in posting some diffinitions and an example on the wikipedia page w:stiff equation, and some in quizes and excercices on my wikiversity user page, these changes took place because I found they are not clearly discussed on the wikipedia page, although my changes my be in the hand or the minds of others, but I beleive I made a better way of understandig the concept of stability for the Numerical methods more clearer, and easily comprehended especially by using the conceptual quiz I posted on wikiversity down.
Main Project[edit]
Motivation[edit]
During the couse, we covered so many topics, and I barely remeber that any class passed without asking or discussing the error propagations in the numerical method which is implicitly implies whether the numerical method is stable or not, on the other hand during the second half of the course these cries increased and I felt that the stability topic is not clear for some of the students, due to the time limitations of the class and the poorley expressed ideas on wikipedia I made my point to clarify this topic more and make it easier to comprehend, so I established my project with a hard base to study the stability of the numerical method such that I introduced the reader to basic diffinitions in this topic, so he can cope up with the flow of the material later on, and made sure the reader will not losely use the concept later on, then moved to show some examples "mine and others on wikipedia" so that he/she get experience with the difinitions
Proposed Changes[edit]
my proposed changes were considering,changes to the following subtopics:
 Stability regions for RK methods.
 Stability regions for multistep method.
 The characteristic functions and how to find it.
 Solving a system of differential equations using Rk4 method.
 plotting the stability regions.
 Quizes related to the topic: stability of ODEs' methods.
 Excercises related to the same topic.
Actual Changes[edit]
I almost covered my plan, but I did too much in RK methods than the implicit multistep analysis, one thing that I didn't cover is the application of RK4 to a system of differential equations, the idea is fancy to be discussed on wikipedia, since very little details written about it, and it is worthy to show some hidden details, most books they just give the general formula to apply that method to a system of differential equations.
I starrted my project with a number of definitions such as consistency, convergense, and absolute stability,then followed by a theorem which uses those concepts, the theorem shows some results concerning stability and convergence of the numerical methods both single and multistep methods, this is an excution for what I proposed about the multistep method, in addition to excercises that covers finding the characteristic polynomial for RK2 method, and a nother method.
The rest of my proposed changes has been covered and an example to show how to find the stability polynomial for five types of RK4, including the classical case, A matlab code was shown and tested to generate the stability region for the five cases,In fact I generated the stability regions for the five cases and compared the with other resources, An image of the generated stability region was published on w:stiff equation , all the changes have been published to the wikipedia. concerning the quizes part I managed to write 13 conceptual quizes, since finding numerical quiz in this topic is really long way, so I just posted the 13 questions on wikiversity below, any user can also access them from user:Mjmohio, under Numerical ordinary differential equations[2]
Excercises have been developed, I published basically tow questions, divided them to five guiding excercises, and arranged them in chronological order in terms of solving for the stability region, and testing wether the the numerical method is stable or not.During the exercises I clarified the Lstability concept by solving and discussing an Lstable method,
Definitions[edit]
let is the local truncation error, and k is the number of time steps, then:
 The numerical method is consistent with a differential equation if
 over .
 A numerical method is said be convergent with respect to differential equation if
 over ;
 A numerical method is stable if small change in the initial conditions or data, produce a correspondingly small change in the subsequent approximations.
Theorem: For an initial value problem
 with
and certain initial conditions, , let us consider a numerical method of the form
 and .
If there exists a value such that it is continuous on the iterative domain, and if there exists an such that
 for all ,
the method fulfills the w:Lipschitz condition, and it is stable and convergent if and only if it is consistent. That is,
 for all .
For a similar argument, one can deduce the following for multi step methods:
 The method is stable if and only if all roots, , of the characteristic polynomial satisfy
 ,
 one more result is that if the method is consistent with the differential equation, the method is stable if and only if it it is convergent.
see [3]
stability polynomials of RungeKutta methods[edit]
The w:Runge–Kutta methods are very usefull in solving systems of differential equations, it has wide applications for the scientists and the engineers, as well as for the economical models, the recognized with their practical accuracy where we can use and get very good results and approximations when solving an ODE problem, RK has the general form :,
Example:finding the stability polynomial for RK4's methods[edit]
for RK4" case", which characterizes by which has the form: the stability region is found by applying the method to the linear test equation
 the stability region is found by applying the method to the linear test equation
using the linearized equation , we get
substitue these back in , yields
 and so the characteristic polynomial
for the absolute stability region for this method, set R(z)<1, and so we get the region in figue1. case
the table below shows the final forms for the stability function for different forms of RK4, these RK4's are different in the values of , and they are fullfilling the consistencty requirement for the method i.e :
case#  stability function 
caseI  
caseII_a  
caseII_b  
caseIII  
caseIV  
classical Rk 

see [4] to find the table
Plotting the stability region[edit]
In order to plot the stability region, we can set the stability function to be bounded by 1 and solve for the values of z, then draw z in the complex plane. Since R(z) is the unit circle in the complex plane, each point on the boundary can be represented as and so by changing over the interval, we can draw the boundaries of that region. The following w:OCTAVE/Matlab code does this by plotting contour curves until reaching the boudaries:
[x,y] = meshgrid(6:0.01:6,6:0.01:6);
z = x+i*y;
R = 1+z+0.5*z^2+(1/6)*z^3+(1/24)*z^4;
zlevel = abs(z);
contour(x,y,zlevel,[1 1]);
The figure at right shows the absolute stability regions for RK4 cases which is tabulated above[5]
Quizes[edit]
Exercises[edit]
Ex:1[edit]
find the stability function for RK2 which is given by:
Solution:
applying this method to the test equation
 we get
the stability polynomial
Ex:2[edit]
find the absolute stability region for RK2.
Solution:
by setting
 the abs.stability region is given by
Ex:3[edit]
find the characteristic polynomial for RK2.
Solution:
it is divide both sides of the equation by you get
Ex:4[edit]
is RK2 stable, if it is what type of stability.
Solution:
you get by setting z=0,
 so the method is strongly stable since r=1, is the only root, and has a value of 1.
Ex:5[edit]
Determine the stability of Back ward Euler method.
Solution:
 by applying this method to the test equation
 then
 and so
 call and so:
 as
 and so this is LStable method when applied to stiff equation.
Conclusions[edit]
During this project, I searched about five resources and other internet websites to weave my ideas and make them as clear as possible, I used examples to clarify the definitions and the theory, I found that Rk methods of order one and the higher orders are cositent with stiff problems [6], and so they are convergent, see the proof on [7], and so when we use RK methods we will not be worried if the method is consistent or not. Using any method to simulate the exact solution for any kind of ODE's is dependent on the absolute stability region, and so the choice of the time step will depend on the roots of the characteristic polynomial, if the complex number should satisfy the condition that the absolut value of the stability polynomial should be strictly less than one, otherwise the method will not be stable, and the results will be far from the accuracy.
On the other hand, theory should be clarified by examples, it wasn't easy to find the stability polynomial for Rk methods, one should be very carefull when use the parantheses, see the example above, missing of one parantheses will leed to a different stability polynomial and so leads to a different stability region, which in role means different method.
Conceptual quiz was very neat to clarify the concepts, and so I included so many of them, they expressing the definition of the absolute stability, Astability, strong and weak stability, and Lstability; see exercises above, they inclded more about stability properties of RK methods, and recruiting the attention of the reader to some general rules and corollaries that is not of first look to catch and comprehend. I finished my main modifications on wikipedia by showing a sample matlab code how to plot the stability regions,the code is working efficiently, and gives accurate results, see [8].
Note: it is worthy to mention, that during my writings I noticed that some resources define the stability region to be [9]. But on [w:stiff equation] the definition doesn't include 1
References[edit]
 Eberly, David (2008), stability analysis for systems of defferential equation.[10]
 Ababneh, Osama; Ahmad, Rokiah; Ismail, Eddie (2009), "on cases of fourthorder RungeKutta methods", European journal of scientific Research.[11]
 Mathews, John; Fink, Kurtis (1992), numerical methods using matlab.
 Stability of RungeKutta Methods [12]