Writing procedures with False Position and Newton-Raphson

Im looking for help with a question, i need to produce a procedure using both False Position and Newton-Raphson methods' here is the queston;

Write a Maple procedure to find the root (answer) of a function (fun) to a specified accuracy (acc_nr) using a combination of the methods of false position and Newton-Raphson. Your procedure should start with an interval ([left,right])in which the root lies and first carry out sufficient iterations of the false position method to find an estimate of the root (to an accuracy of acc_fp, a much larger number than acc_nr). This estimate should then be used as the starting value for the Newton-Raphson method which should then find the root to the final specified accuracy (acc_nr).

Your procedure might have the form findroots:=proc(fun,left,right,acc_fp,max_fp,acc_nr,max_nr,answer::evaln), where most of the parameters have been defined above. The parameters max_fp and max_nr are the maximum number of iterations for each method respectively.
(i) Test your procedure by finding the root of
> exp(x)-sin(x) = 0; in [-4,0] with acc_fp = 0.1 and acc_nr =
> 10^(-10);.
(ii) Print out every iteration within your procedure, making it clear which method produced that estimate, so that your calculations can be checked.
(iii) Choose appropriate data to show what your procedure does when it fails to find a root.
(iv) Put in any safeguards and tests you can think of and choose appropriate data to show what your procedure does when such tests are failed.
(v) Include a full copy of your procedure in the worksheet (or separately), i.e. the version with all the comments.

Ive tried to write procedure but keep getting stuck, is their anyone who can help or write the procedure?

What have you tried?

Please post your best code so that I can try to see what
is not working.

Axel Vogt's picture

you need to post 4 times :-)

you need to post 4 times, of course ... so one is still missing ...

one answer may be: post it to the section entitled "get your homework solved"

the more serious answer to all homework questions: you at least
should post what you have already done & tried and that should
cover applying the lecture about the topics (that you certainly
have listened

Since when did this forum become a homework solution generator?

You are asking us to give you the solution for an assignment you got from your school (or university or whatever). Surely that could not be your intention... Normally you give us the code you have written so far, and then we may be able to assist you in correcting your procedure.

Regards,

Franky.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}