Forums Register Login

Root Finding

+Pie Number of slices to send: Send
I have been set an assignment to develop functions newton and bisection which use these methods to find the roots of functions. I have a function class a testfunction class and a root class, im having trouble bringing everything together.. if someone could take a look over what ive got i'd be grateful.






Function class was given to us and I dont really understand how to use it.
+Pie Number of slices to send: Send
Go through the code in the (badly-named) Function class and see what the different options in the apply() method do. They appear to work out formulae of the x^3 + 3x^2 - 5x - 3 variety. And don't use Math.pow(x, 3) for cube. Use x * x * x.
+Pie Number of slices to send: Send
Thanks, noted and changed.. how do I go about creating a test class with some arbitrary starting values and a function from Function which tests my root finding methods?
+Pie Number of slices to send: Send
Someone please help as this code is driving me crazy.. I have two Classes Function and Roots:





My question is how do I modify Roots to call/use the functions created by my Function class? Thanks
+Pie Number of slices to send: Send
Does that class compile? Please tell us the details of what actually happens.
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1828 times.
Similar Threads
Bisection Method
drawing arrows
Calculating the distance between two points problem
Quadratic perplextion
methods and return type
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:42:51.