Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

A function trisection that finds the root of a polynomial

Status
Not open for further replies.

whitejm

Civil/Environmental
Jul 30, 2011
4
I need to write a function trisection that finds the roots of a polynomial by breaking the interpolation interval {[a,b] into 3 on each iteration. There are four input parameters, a row matrix with the coefficients of the polynomial, a, b, and the desired error. There are two output parameters, root: the root of the equation and n, the number of iterations. Any help is appreciated.
 
Replies continue below

Recommended for you

Well you seem to have a pretty complete spec of the requirement there. I usually write down the steps I intend to take as comments and then put code in between the comments.



Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Sounds like homework

TTFN
faq731-376
7ofakss
 
Homework for sure. The name of the method is a dead give away. (missing)

Why don't you start with the Bisection method. It's efficient, and only takes about 20 lines of code. ...

[peace]
Fe (IronX32)
 
Also good luck viewing that article if you or your institution don't have a subscription...

[peace]
Fe (IronX32)
 
oh yeah, pay per view adult entertainment for sure, but that is what it takes unless you do the math yourself,

I guess the alternative is a truncated newton's or secant method
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor