Question

ANSWER FOR NEWTON'S METHOD ON MATLAB ONLY PLEASE

Implement Newtons method for finding minima. Compare these for the following task: find all maxima and minima of (-- 1)(x+ 3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is a graph of the function above and its derivative.

05 -0.5

We need to find the minima.. So the roots of the derivative function..

Here is a matlab code to find out the zeros to the derivative function by Newton's method

clc
clear all
a0=input('enter the starting point:');
ep=eps(0);
max_iterate=100;
a=a0; fa=f(a0);
b=a-fa/df(a); fb=f(b);
it_count=0;
if f(a)==0
root=a
else
while abs(f(a))>ep & it_count<max_iterate
a=b;
fa=fb;
b=a-fa/df(a); fb=f(b);
it_count=it_count+1;
end
end
format long
root=b
format short
error_bound=abs(f(a))

function [ output ] = f(x)

output=(g(x+0.00001)-g(x))/0.00001;


end

function [fv] =df(x)

fv=(f(x+0.00001)-f(x))/0.00001;

end

Add a comment
Know the answer?
Add Answer to:
ANSWER FOR NEWTON'S METHOD ON MATLAB ONLY PLEASE Implement Newton's method for finding minima. Compare these...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 1 (Matlab): One of the most fundamental root finding algorithms is Newton's Method. Given a real-valued, di...

    Problem 1 (Matlab): One of the most fundamental root finding algorithms is Newton's Method. Given a real-valued, differentiable function f, Newton's method is given by 1. Initialization: Pick a point xo which is near the root of f Iteratively define points rn+1 for n = 0,1,2,..., by 2. Iteration: f(xn) nt1 In 3. Termination: Stop when some stopping criterion occurs said in the literature). For the purposes of this problem, the stopping criterion will be 100 iterations (This sounds vague,...

  • Please solve it with MATLAB. Many thanks. Use Newton's method to find, within 10-3, the zeros and critical point...

    Please solve it with MATLAB. Many thanks. Use Newton's method to find, within 10-3, the zeros and critical points of the following functions Use this information to sketch the graph of f. 5. a.f(x)x9 12 b. f(x)x-2r -512r-5 Use Newton's method to find, within 10-3, the zeros and critical points of the following functions Use this information to sketch the graph of f. 5. a.f(x)x9 12 b. f(x)x-2r -512r-5

  • find the root(s) of the following functions using both Newton's method and the secant method, using...

    find the root(s) of the following functions using both Newton's method and the secant method, using tol = eps. 3 Find the root s of the following functions using both Newton's ulethod and the anat inethod using tol epa. . You will vood to experiment with the parameters po, pl, ad maxits. . For each root, visualize the iteration history of both methods by plotting the albsolute errors, as a function . Label the two curves (Newton's method and secaut...

  • DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the...

    DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the following calculations. Your script will use the functions you create. Label all graphs appropriately. For this project, do not have your homemade functions fprintf anything, instead have all your fprintf commands within your script. Attach your published script file along with .m files for your functions. Exercise 1. A fundamental iterative method for finding the roots of equations of one-variable is known as Newton's...

  • question 3 please The first 5 questions refer to finding solutions to the equation exp(w) =...

    question 3 please The first 5 questions refer to finding solutions to the equation exp(w) = 3.8 ln(1+x). You will need to write it in the form f(x)-0, and use various root finding methods. 1. (10 pts) Plot the curves y- exp(Vx), and y 3.8 ln(1+x) on the same graph in the range 0 x 6. Read off intervals in which there are roots of the equation exp(k)- 3.8 In(1+x) Now find the roots to 6 decimal places using the...

  • PLEASE PLEASE,ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. Solve the...

    PLEASE PLEASE,ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. Solve the following ODE from x = 4 to x = 4.5 using a step size of h = 0.5 with non-self-starting Heun Method, where y(3.5) = 0.244898 and y(4) = 0.1875. List the values for the Predictor and the Corrector with three iterations only. Make sure you include 4 decimals in your answer. dy dx 3y + = 0 Example answer: 0.2500 X DO) pl...

  • please only answer if sure,note that this question is in newton's method research. A sales company is starting a new venture. A business analyst has formulated a mathematical model to predict the...

    please only answer if sure,note that this question is in newton's method research. A sales company is starting a new venture. A business analyst has formulated a mathematical model to predict the company's revenue, R (in thousands of dollars) at any time t (in years) where R(t 3 200x 100x +5 and the company's expenses E, (in thousands of dollars) at any time t (in years) where E(t) -28x12x +13 Find the break even points and determine when a profit...

  • PLEASE ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. THIS IS...

    PLEASE ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. THIS IS THE FULL QUESTION GIVEN. dyi Consider the following Ordinary Differential Equation (ODE) for function yı (2) on interval [0, 1] dayi dyi +(-9.7) * + 28.64 * dr3 d. 2 dar + (-23.828) * yı (x) = -5.18 0.9-2 with the following initial conditions at point x 0: dyi dy yi = -4.98 = 1.168 26.8052 dar Introducting notations dyi dy2 dayı Y2 =...

  • PLEASE PLEASE,ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. dyi y...

    PLEASE PLEASE,ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. dyi y = 2.5. dy Consider the following Ordinary Differential Equation (ODE) for function yı(a) on interval [0, 1] dyi dayı dyi d3 + (-3.3) * + 2.9 * + (-0.6) * yı(20) = 0.0 dar2 da with the following initial conditions at point x = 0: dayı = 8.86 = 18.248 dar dra Introducting notations dyi dy2 y2 = da da d2 convert the ODE...

  • PLEASE PLEASE,ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. Consider the...

    PLEASE PLEASE,ONLY ANSWER THIS QUESTION IF YOU COULD GIVE ME THE MATLAB CODE.THANK YOU. Consider the following Ordinary Differential Equation (ODE): dy = 3.0*** + 1.08 * 210 – 3* y2 dat with initial condition at point xo = 0.375: Yo = 0.0044 Apply Runge-Kutta method of the second order with h = 0.25 and the set of parameters given below to approximate the solution of the ODE at the three points given in the table below. Fill in the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT