Solutions to equations Flashcards
Subtraction method
For equation A = B
subtract B from A then see where it intercepts x axis
Criteria of methods
Needs to be continuous and fully defined in the required range
Some methods may converge to an asymptote which is bad
Sign test
check upper and lower bounds of calculated root and if one is positive and one negative then it is correct
When does sign test fail
When 2 roots are very close so sign change undetected
Repeated roots as there is no sign change
Interval bisection
2 values straddling the root to get interval, then split into two equal parts with one side + and one - until converge to the root
fails if an even number of roots in the interval
interval table
7 columns - r, a, sign of fa, b, sign of fb, c (a+b/2), sign of fc
then replace either a or b in the next row based on sign change
the solutions appear when two values on the same row round to the same degree
FPI setup
rearrange f(x) into x = g(x)
draw a line of x = g(x) and a line of y = x
(overlap = root)
how to FPI
choose an x value then draw a line from x,0 to the g(x) then draw horizontally to y = x then draw vertically to g(x) and continue until root reached
Staircase and cobweb
staircase is when gradient of derivative of initial guess is more than 0 - hence values slowly move in one difection
cobweb is when gradient of derivative of initial guess is less than 0 - so values fluctuate up and down
FPI Failure
if magnitude of gradient is more than 1 (i.e steeper than y = x) values will diverge away and fail, so f’(x0) needs to be less steep then 1 or -1
relaxation process
with x = g(x) get a guess of x then do :
1-λ(x) + λ g(x) as a new estimate
Best lambda value for relaxation
as close to the root as possible as the graph of g(x) with lambda subbed in will have a shallower gradient than original f(x) at the root
ensuring accuracy
do a few more iterations than needed and check values with sign tests
Newton-Raphson
Draw a tangent to the curve at x = initial guess, then next guess is where the tangent meets the x axis and continue
Newton raphson formula
x(n+1) = xn - f(x)/ f’(x)
newton raphson failure
and secant fixture
fails if close to stationary point (gradient near 0 so tangent diverges far), fails if first guess too far, fails for discontinuous or partially undefined graphs
Secant fixes by approximating the derivative/gradient
Secant formula
f(x1)x0 - x1f(x0) / f(x1) - f(x0)
secant graph
draw a straight line between x1 and x0 and x intercept is x2
then straight line between x1 and x2 (on the curve) and x intercept is x3 (extrapolate if needed)
repeat as many times as needed
False position
estimate curve gradient with a straight line from A to B
then bisect the line with change of sign to get a better straight line (vertically match bisection)
False position formula
c = af(b) - bf(a) / f(b) - f(a)
basically secant
False position vs secant
FP always works but is slower
FP requires a sign change between iterations