Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Find_root_abs Calculator

Find_root_abs

-- Option variable: find_root_abs -- Option variable: find_root_rel Finds a root of the expression <expr> or the function <f> over the closed interval [<a>, <b>]. The expression <expr> may be an equation, in which case find_root seeks a root of lhs(<expr>) - rhs(<expr>).

Given that Maxima can evaluate <expr> or <f> over [<a>, <b>] and that <expr> or <f> is continuous, find_root is guaranteed to find the root, or one of the roots if there is more than one.

find_root initially applies binary search. If the function in question appears to be smooth enough, find_root applies linear interpolation instead.

The accuracy of find_root is governed by find_root_abs and find_root_rel. find_root stops when the function in question evaluates to something less than or equal to find_root_abs, or if successive approximants <x_0>, <x_1> differ by no more than find_root_rel * max(abs(x_0), abs(x_1)). The default values of find_root_abs and find_root_rel are both zero.

find_root expects the function in question to have a different sign at the endpoints of the search interval. When the function evaluates to a number at both endpoints and these numbers have the same sign, the behavior of find_root is governed by find_root_error. When find_root_error is true, find_root prints an error message. Otherwise find_root returns the value of find_root_error. The default value of find_root_error is true.

If <f> evaluates to something other than a number at any step in the search algorithm, find_root returns a partially-evaluated find_root expression.

The order of <a> and <b> is ignored; the region in which a root is sought is [min(<a>, <b>), max(<a>, <b>)].

Examples:

          (%i1) f(x) := sin(x) - x/2;
                                                  x
          (%o1)                  f(x) := sin(x) - -
                                                  2
          (%i2) find_root (sin(x) - x/2, x, 0.1, %pi);
          (%o2)                   1.895494267033981
          (%i3) find_root (sin(x) = x/2, x, 0.1, %pi);
          (%o3)                   1.895494267033981
          (%i4) find_root (f(x), x, 0.1, %pi);
          (%o4)                   1.895494267033981
          (%i5) find_root (f, 0.1, %pi);
          (%o5)                   1.895494267033981
          (%i6) find_root (exp(x) = y, x, 0, 100);
                                      x
          (%o6)           find_root(%e  = y, x, 0.0, 100.0)
          (%i7) find_root (exp(x) = y, x, 0, 100), y = 10;
          (%o7)                   2.302585092994046
          (%i8) log (10.0);
          (%o8)                   2.302585092994046

(%o1)                                true
(%i2) 

Find_root_abs Example

Related Examples

abs-diff-log-plot2d
plot2d([0,log((x+1)/(x+3))], [x,-1,5],[y,-9,10]);

f(x):=log(abs(x+1)/(x...

g(x):= if x>-1 the...

diff(log((x+1)/(x+3))...

Calculate

abs-contour_plot
contour_plot(x^2+2*(y-0.8*abs(x)^0.4)^2-1,[x, -1, 1], [y, -1, 2]);

contour_plot(x^2+2*(y...

Calculate

abs-define-diff-find_root-float-pi-plot2d
plot2d(hp(x), [x,-5,5], [y,-5,5]);

define(h(x), abs(2*x^...

define(hp(x),diff(h(x...

float(h(-5/4));

Calculate

abs-define-plot2d-realroots
plot2d([f(x),p(x)],[x,0.5,1.5]);

define(f(x),3*x^4+9*x...

f(2);

r:realroots(f(x)=0);

Calculate

abs-define-plot2d-realroots
plot2d(h(x), [x, -5, 5]);

abs(-5);

define (h(x), abs(2*x...

h(3);

Calculate

abs-cos-plot2d-sin
plot2d([f(x),P(x),roots],[x,0,2*%pi],[style,lines,lines,points],[legend,"f(x)","P(x)",""]);

f(x):=cos(3*x)+sin(x)...

roots:[discrete,[[0.1...

P(x):=4.0597627876181...

Calculate

abs-cos-define-ev-integrate-pi-sin-sum

f(x):=x;

a(n):=(1/%pi)*integra...

b(n):=(1/%pi)*integra...

Calculate

abs-define

define(h(x), abs (2*x...

define(f(x), abs((x^2...

Calculate

abs-plot2d
plot2d(f(x),[x,-12,12]);

f(x):=2*abs(x+2)+2*x-3;

plot2d(f(x),[x,-12,12]);

Calculate

abs-contour_plot
contour_plot(x^2+2*(y-0.8*abs(x)^0.4)^2-1,[x, -1, 1], [y, -1, 1]);

contour_plot(x^2+2*(y...

Calculate