(12C) Solve f(x)=0 with modified Regula Falsi method
|
03-26-2018, 07:43 AM
(This post was last modified: 03-26-2018 10:08 AM by Dieter.)
Post: #3
|
|||
|
|||
RE: (12C) Solve f(x)=0 with modified Regula Falsi method
(03-26-2018 06:26 AM)Gamo Wrote: Solve X^3 = 3^X One answer is 2,47805. But there are two. (03-26-2018 06:26 AM)Gamo Wrote: I try initial guess 1 ENTER 3 R/S > return 3 Sure. X=3 is a solution: 3^3 = 3^3. (03-26-2018 06:26 AM)Gamo Wrote: press R/S again > Error 0 Why do you press R/S again? What do you want to do this way? If you press R/S again you restart the solver with two identical guesses 3 and 3. So the calculated secant is a horizontal line that will never cross the x-axis and a division by zero will occur. That's why the two guesses must be different. However, the program can be changed so that it does accept two identical guesses if these are already a root of f(x). See below. (03-26-2018 06:26 AM)Gamo Wrote: Did I do something wrong? You simply didn't notice that 3 is one of the two solutions. ;-) - If you enter 1 and 3 as initial guesses the program correctly returns X=3. - Of course the program can also calculate the other root: simply start with different guesses, for instance 1 and 2,5 => 2,478052679. BTW, the exact root is 2,4780526802883..., but with 10 digit precision everything between 2,478052678 and ...683 evaluates to f(x)=0. If you start with 1 and 2,8 or 1 and 2,9 you will get these results. Edit: here is a modified version that works even with two identical guesses if these are a root of f(x). f(x) now starts at line 76 and ends with GTO 10. Code: 01 STO 2 store b Additional feature: in the f(x) code, x now can be addressed with "RCL 3". So your example can be coded like this: 3 Y^X 3 RCL 3 Y^X – Dieter |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(12C) Solve f(x)=0 with modified Regula Falsi method - Dieter - 03-25-2018, 05:58 PM
RE: (12C) Solve f(x)=0 with modified Regula Falsi method - Gamo - 03-26-2018, 06:26 AM
RE: (12C) Solve f(x)=0 with modified Regula Falsi method - Dieter - 03-26-2018 07:43 AM
RE: (12C) Solve f(x)=0 with modified Regula Falsi method - Gamo - 03-26-2018, 01:04 PM
RE: (12C) Solve f(x)=0 with modified Regula Falsi method - Dieter - 03-26-2018, 04:37 PM
RE: (12C) Solve f(x)=0 with modified Regula Falsi method - Dieter - 03-27-2018, 06:13 PM
RE: (12C) Solve f(x)=0 with modified Regula Falsi method - Carsen - 03-26-2018, 10:24 PM
|
User(s) browsing this thread: 2 Guest(s)