Category: Numerical Analysis
Blog Entry (c) Saturday August 31, 2024, by James Pate Williams, Jr. An Elementary School Problem Found Online
Solve for a real root of the equation
f(x)=log6l(5+x)+log6l(x)=0
First we test our log6l(x) function
log6l(12) = 1.386853
log6l(36) = 2.000000
x = 0.1925824036
f = 0.0000000000
Blog Entry (c) Friday August 30, 2024, by James Pate Williams, Jr. Another Simple Math Problem
We use an evolutionary hill-climber and the solution of the quadratic equation to solve the easy problem below:
Solution of f(a,x)=sin(sqrt(ax-x^2))=0
Subject to the constraint x+y=100
Where x and y are the two roots of
g(a,x)=ax-x^2-n*n*pi*pi=0
and n=15
a = 100.347888933988
x = 32.947113268776
y = 67.400775665213
g = 0.000000000000
s = 100.347888933988
runtime in seconds = 43.730000
Blog Entry (c) Wednesday August 28, 2024, by James Pate Williams, Jr.
Blog Entry (c) Tuesday, August 27, 2024, Two More Online Mathematics Problems by James Pate Williams, Jr.
Solution of f(t) = cos(2t) + cos(3t)
t = 0.628318530718
f(t) = 1.11022302e-16
Solution of f(x) = sqrt(1 + sqrt(1 + x)) - x^1/3
x = 8.000000000000
f(x) = 0.00000000e+00
Solution of f(x) = 9^x + 12^x - 16^x
x = -16.387968065352
f(x) = 2.32137533e-16
Solution of f(x) = 8^x-2^x - 2(6^x-3^x)
x = 1.000000000000
f(x) = 0.00000000e+00
Blog Entry August 9, 2024, (c) James Pate Williams, Jr. Another Online Math Problem
The problem is to find the real root of the equation: f(x)=x^(x^8)-8=0. I use the Newton-Raphson method, a root finding algorithm. A first guess is x = 2. The solution is: x = 1.2968395547, f(x) = -2.6645353e-15. I compute the necessary derivative using central-finite differences with a step size of h = 2/10000.
Blog Entry August 1, 2024, (c) James Pate Williams, Jr. Online Math Problem
Blog Entry Thursday, July 25, 2024, (c) James Pate Williams, Jr. Newton’s Method for Finding the Real Roots of a Real Polynomial
degree (0 to quit) = 5
a[5] = 1
a[4] = -15.5
a[3] = 77.5
a[2] = -155
a[1] = 124
a[0] = -32
x[0] = 0.45
x[1] = 0.9
x[2] = 1.8
x[3] = 3.6
x[4] = 7.2
iterations = 31
root[0] = 5.0000000000e-01
root[1] = 1.0000000000e+00
root[2] = 2.0000000000e+00
root[3] = 4.0000000000e+00
root[4] = 8.0000000000e+00
func[0] = 0.0000000000e+00
func[1] = 0.0000000000e+00
func[2] = 0.0000000000e+00
func[3] = 0.0000000000e+00
func[4] = 0.0000000000e+00
degree (0 to quit) =
Blog Entry (c) Tuesday, July 23, 2024, by James Pate Williams, Jr. Mueller’s Method for Finding the Complex and/or Real Roots of a Complex and/or Real Polynomial
I originally implemented this algorithm in FORTRAN IV in the Summer Quarter of 1982 at the Georgia Institute of Technology. I was taking a course named “Scientific Computing I” taught by Professor Gunter Meyer. I made a B in the class. Later in 2015 I re-implemented the recipe in C# using Visual Studio 2008 Professional. VS 2015 did not have support for complex numbers nor large integers. In December of 2015 I upgraded to Visual Studio 2015 Professional which has support for big integers and complex numbers. I used Visual Studio 2019 Community version for this project. Root below should be function.
Degree (0 to quit) = 2
coefficient[2].real = 1
coefficient[2].imag = 0
coefficient[1].real = 1
coefficient[1].imag = 0
coefficient[0].real = 1
coefficient[0].imag = 0
zero[0].real = -5.0000000000e-01 zero[0].imag = 8.6602540378e-01
zero[1].real = -5.0000000000e-01 zero[1].imag = -8.6602540378e-01
root[0].real = 0.0000000000e+00 root[0].imag = -2.2204460493e-16
root[1].real = 3.3306690739e-16 root[1].imag = -7.7715611724e-16
Degree (0 to quit) = 3
coefficient[3].real = 1
coefficient[3].imag = 0
coefficient[2].real = 0
coefficient[2].imag = 0
coefficient[1].real = -18.1
coefficient[1].imag = 0
coefficient[0].real = -34.8
coefficient[0].imag = 0
zero[0].real = -2.5026325486e+00 zero[0].imag = -8.3036679880e-01
zero[1].real = -2.5026325486e+00 zero[1].imag = 8.3036679880e-01
zero[2].real = 5.0052650973e+00 zero[2].imag = 2.7417672687e-15
root[0].real = 0.0000000000e+00 root[0].imag = 1.7763568394e-15
root[1].real = 3.5527136788e-14 root[1].imag = -1.7763568394e-14
root[2].real = 2.8421709430e-14 root[2].imag = 1.5643985575e-13
Degree (0 to quit) = 5
coefficient[5].real = 1
coefficient[5].imag = 0
coefficient[4].real = 2
coefficient[4].imag = 0
coefficient[3].real = 3
coefficient[3].imag = 0
coefficient[2].real = 4
coefficient[2].imag = 0
coefficient[1].real = 5
coefficient[1].imag = 0
coefficient[0].real = 6
coefficient[0].imag = 0
zero[0].real = -8.0578646939e-01 zero[0].imag = 1.2229047134e+00
zero[1].real = -8.0578646939e-01 zero[1].imag = -1.2229047134e+00
zero[2].real = 5.5168546346e-01 zero[2].imag = 1.2533488603e+00
zero[3].real = 5.5168546346e-01 zero[3].imag = -1.2533488603e+00
zero[4].real = -1.4917979881e+00 zero[4].imag = 1.8329656063e-15
root[0].real = 8.8817841970e-16 root[0].imag = 4.4408920985e-16
root[1].real = -2.6645352591e-15 root[1].imag = -4.4408920985e-16
root[2].real = 8.8817841970e-16 root[2].imag = 1.7763568394e-15
root[3].real = 3.4638958368e-14 root[3].imag = -1.4210854715e-14
root[4].real = 8.8817841970e-16 root[4].imag = 2.0710031449e-14
Blog Entry Sunday, July 21, 2024 (c) James Pate Williams, Jr. Another Easy Internet Mathematics Problem
x = 1.2679491924e+00 y = 4.7320508076e+00
f = 0.0000000000e+00 g = 0.0000000000e+00
iterations = 100
legend: f = x + y – 6, g = x * y – 6
The solution was found via my Win32 C application whose source code is presented below (the method is the Newton iteration for systems of linear and/or non-linear equations):