You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we can see from the graph final point there function after many iterations g(x + 1) = g(x) should converge to 0, and our initial guess should be close to it. Let's say our initial guess is x0 = 0.4, it could be anything, but the closer to real solution the better :) So iteration would be as follows:
From graph we could clearly see, that this iteration should diverge, but let's write it down to make sure
@@ -20,20 +23,49 @@ From graph we could clearly see, that this iteration should diverge, but let's w
20
23
3) when x2 = 0.44992 then g(0.44992) = tan(0.44992) = 0.48295
21
24
4) when x2 = 0.48295 then g(0.48295) = tan(0.48295) = 0.52436
22
25
23
-
It only goes further away from initial guess x0 = 0.4, so it really diverges. Conclusion, we need to find (modify) current function g(x) = tan(x) into function which will converge finally
26
+
It only goes further and further away from initial guess x0 = 0.4, so it really diverges. And if we find a derivative of function tan(x), it will be grater when > 1, so this as well is an indication that function diverges. Conclusion, we need to find (modify) current function g(x) = tan(x) into function which will converge finally.
24
27
Our first try:
25
28
1) x = tan(x)
26
29
2) x = arctan(x)
27
30
3) x - n*pi = arctan(x - n*pi)
28
31
4) x - n*pi = arctan(x)
29
32
5) x = arctan(x) + n*pi
30
33
31
-
Let's say n = 0, when we try again and check if function g(x) = arctan(x) converges. Function g(x) graph when initial guess x0 = 1.4, it could be any point :)
This functions 5) derivative is lower when < 1, so this is an indication, that we have chosen ther right equation, and it's a way to go. Let's say n = 0, when we try again and check if function g(x) = arctan(x) converges. Function g(x) graph when initial guess x0 = 1.4, it could be any point, keep in mind that
From graph we could clearly see, that this iteration should converge, but let's write it down to make sure
35
39
1) when x0 = 1.4 then g(1,4) = arctan(1,4) = 0.9505
36
40
2) when x1 = 0.9505 then g(0.9505) = arctan(0.9505) = 0.76
37
41
3) when x2 = 0.76 then g(0.76) = arctan(0.76) = 0.6499
38
42
4) when x2 = 0.6499 then g(0.6499) = arctan(0.6499) = 0.5763
39
-
It clearly slowly converges, and after many iterations we should get to our precise solution. But we should be conscious about precision, because then it slowly converges it is indicator that with the high precision given, we could still be far away from our solution.
43
+
44
+
We stop after it meets condition: |g(xn) - xn| <= ((1-q)/q)*e, where e is precision, q is derivative in defined interval [a, b]. It clearly slowly converges, and after many iterations we should get to our precise solution. But we should be conscious about precision, because then it slowly converges it is indicator that with the high precision given, we could still be far away from our solution.
45
+
46
+
Let's say n=1, when we could clearly see, this this iteration even nicer converges to our precise solution, in graph you can see functions: f(x) = tan(x), f(x) = arctan(x) + pi, f(x) = x
This method is more efficiant when previous method, the convergion to sulution happens much more faster. First step, we need to rewrite function:
57
+
1) x = tan(x)
58
+
2) f(x) = tan(x) - x
59
+
60
+
After that we pick two arbitrary points. Lets say this is: x0 = 2 and x1 = 4, and for example we wanna get solution 4.493 When we draw some graphs to get a visual idea there is this going for
0 commit comments