September 27th, 2016, 03:33 AM  #11 
Senior Member Joined: Apr 2014 From: Glasgow Posts: 2,156 Thanks: 731 Math Focus: Physics, mathematical modelling, numerical and computational solutions 
There's so many pictures and quotes there that it's really confusing to read it all and get a sense for exactly what you're trying to ask! However, we can break things down into simple terms and then just build on from that: So... let's make it super simple and explain the main ideas behind numerical methods. Let's say we have a specific community of people where the number of children, y, always seems to be the square of the number of adults, x. We write down that relationship as a function: $\displaystyle y = f(x) = x^2$ The f(x) notation is just to say 'y is a function of x', or 'y varies with x'. We are basically saying here that the number of children is equal to the number of adults squared. Functions allow us to basically predict things. We can just substitute the xvalue that we think is going to happen and it tells us what the yvalue is going to be. So if someone comes along and says "How many children are there in that community if there are 4 adults?" We can substitute x=4 into the function and get y = 16. Now, someone comes along and spots that there is another, separate, relationship between y and x in a different community. They spot that the number of children always seems to be 2 more than the number of adults. We have another function: $\displaystyle y = g(x) = x+2$ We can ask all sorts of questions to get information on the two communities. One basic question might be "how many adults do there need to be in each community so that the number of children in those communities is also the same?" Basically, we want an xvalue such that $\displaystyle f(x) = g(x)$ This is an equation. To find the answer, we solve the equation. There are two ways of solving equations 1. Analytically  we use the knowledge of the relationships to find an exact solution 2. Numerically  we use a generic technique that can work for any function to find an approximate solution That's the key difference between analytical methods and numerical methods. Analytical methods always give exact solutions. Numerical methods always give approximate solutions. We can solve the equation analytically by substituting the functions into the equation and solving the quadratic for x: $\displaystyle f(x) = g(x)$ $\displaystyle x^2 = x+2$ $\displaystyle x^2  x  2 = 0$ $\displaystyle (x2)(x+1) = 0$ We get two solutions: x = 2 and x=1 We know that the community cannot have negative adults, so we discard the x = 1 solution and settle on the solution being 2 adults. We can also solve this numerically using one of the numerical methods. For example, let's use an iteration method. This method means that we have to rearrange the equation and apply some indices so it looks like $\displaystyle x_{n+1} = f(x_n)$, we then make an initial guess, put that initial guess into the righthand side of the equation to get a new estimate of the solution. We can then keep applying the same formula over and over again with our better estimates to make the estimate better and better. It doesn't always work (sometimes the guesses get worse and worse), but if we're careful, we can make it work by choosing a good rearrangement. In our case, a good rearrangement is found by making the following steps: Apply some indices (these are like 'tags' for labelling the different x values in the iteration): $\displaystyle x_{n+1}^2 = x_n + 2$ And rearrange for $\displaystyle x_{n+1}$ $\displaystyle x_{n+1} = \sqrt{x_n + 2}$ Let's have an initial guess of $\displaystyle x_0 = 6$. We have: $\displaystyle x_0 = 6$ $\displaystyle x_1 = \sqrt{x_0 + 2} = \sqrt{6 + 2} = \sqrt{8} = 2.82842$ $\displaystyle x_2 = \sqrt{x_1 + 2} = \sqrt{2.82842 + 2} = \sqrt{4.82842} = 2.19737$ $\displaystyle x_3 = \sqrt{x_2 + 2} = \sqrt{2.19737 + 2} = \sqrt{4.19737} = 2.048748$ $\displaystyle x_4 = \sqrt{x_3 + 2} = \sqrt{2.048748 + 2} = \sqrt{4.048748} = 2.012150$ and so on... As you can see... as we keep applying the numerical method over and over again and the answer seems to be getting closer and closer to 2... we will never get the result to be exactly 2, but we can just keep applying those iteration steps over and over again until we are happy with the accuracy. With the limited number of iterations we have done, we can say something like: $\displaystyle x = 2.0$ to 1 decimal place because we know that the variations in the number are now smaller than 0.05 with each new iteration. In general the analytical solution is the best one because the solution is always exact. However, in some cases you cannot solve something analytically... you must use numerical methods. Here is an example: $\displaystyle \sin x = x$ It simply doesn't have an analytical solution. Therefore, if you actually want to find the answer to this (and it does have one!) you must use a numerical method. All of the numerical methods you have given are different and some of them are better than others. Last edited by Benit13; September 27th, 2016 at 03:36 AM. 
September 27th, 2016, 07:45 AM  #12  
Member Joined: Aug 2016 From: afghanistan Posts: 55 Thanks: 1 
thanks a lot for the really long reply ... i think i was mostly trying to compare these two ... in these questions .. question 1 : Quote:
find the function that gives you this rate of change in 'y' with respect to change in 'x' ... and the answer is a function that has the property of ,this instantaneous rate of change in 'y' with respect to change in 'x' ... ... doesn't that mean something has produced such a rate of change in y with respect to a change in x ?? question 2 : Quote:
find the function that gives you this rate of change in 'y' with respect to change in 'x' ... but here we do not have a function ...? just rate of change in 'y' with respect to change in 'x' ???  
September 27th, 2016, 07:59 AM  #13 
Senior Member Joined: Apr 2014 From: Glasgow Posts: 2,156 Thanks: 731 Math Focus: Physics, mathematical modelling, numerical and computational solutions 
I think that for both situations they are looking for $\displaystyle y = y(x)$ ('y as a function of x'), which is the solution, not $\displaystyle \frac{dy}{dx}$ ('rate of change of y as a function of x'), which is already specified for the first question and can be obtained fairly easily in the second question. In question 1, the differential equation being solved is $\displaystyle \frac{dy}{dx} = x^2  3$ In question 2, the differential equation being solved (see the top of the console output) is $\displaystyle \frac{dy}{dx} = y  x $ The solution to both of these differential equations is a function where y varies with x ($\displaystyle y=y(x)$), but it depends on some starting point, which is K. When working with differential equations, you often need additional constraints (a.k.a. boundary conditions) to obtain specific solutions. Note that both of those differential equations can be solved analytically as well as numerically, so you can compare the numerical method output with the analytical result. To do that, just use the analytical formula to get some yvalues for a sample of xvalues and compare those results with the numerical ones. Last edited by Benit13; September 27th, 2016 at 08:04 AM. 
September 27th, 2016, 09:19 AM  #14 
Member Joined: Aug 2016 From: afghanistan Posts: 55 Thanks: 1 
thanks a lot for the detailed explanations ...


Tags 
method, numerical, questions 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
numerical method to solve equation  coenter  Differential Equations  4  January 27th, 2015 10:24 PM 
Steffensen's method in Numerical Analysis  bounces  Calculus  0  November 14th, 2014 05:48 AM 
About Numerical method  mathisdifficult  Applied Math  1  October 24th, 2012 07:51 AM 
Newton raphson methodnumerical function  meriens  Applied Math  2  May 25th, 2012 02:43 AM 
Numerical Linear Algebra, Conjugate Gradient Method  hgd7833  Linear Algebra  0  May 4th, 2012 03:50 AM 