Write a matlab function called newtons method

Assignment Help MATLAB Programming
Reference no: EM131026501

Problem:

Newton's method is a simple algorithm for approximating the roots of an equation. This algorithm works by taking the derivative (slope) of a function at a point along that function, finding where that slope intersects the x-axis, and then repeating for this new point. Repeating this process gets us closer to the root of the actual function. We can describe Newton's method in general form by the equation:

xn+1 = xn - (f(xn)/f'(xn))

Write a MATLAB function called newtons Method that accepts two inputs and returns one output. The inputs should be a vector representation of a polynomial and an initial guess for the root. The output should be the root returned by Newton's Method. Your function should find the root within at least 6 decimal places of accuracy. Your function should also gracefully handle when f'(x) is zero (don't divide by zero) and the case when there isn't a root (don't loop forever).

Check your answer with the polynomial y = 3x2+2x-6 to generate output. Your script should perform this calculation in both of the following ways. (1) Call your newtons Method function twice with these two guesses: 1 and -1. (2) Use the roots() function on your polynomial. Print all solutions to 6 decimal places.

Additional information

This problem belongs to MATLAB software and discusses about application of MATLAB in mathematics to find area of a tea spill using numerical integration.

Answer is in MATLAB format

Reference no: EM131026501

Questions Cloud

Method-of-moments estimator : Find the method-of-moments estimator of p based on this single observation Y.
How do you make decisions : How Do You Make Decisions? In this course, you will read about theories regarding how people make decisions and how they should make decisions.
Method-of-moments estimator : An urn contains θ black balls and N - θ white balls. A sample of n balls is to be selected without replacement. Let Y denote the number of black balls in the sample. Show that (N/n)Y is the method-of-moments estimator of θ.
Probability density function : Suppose that a statistic U has a probability density function that is positive over the interval a ≤ u ≤ b and suppose that the density depends on a parameter θ that can range over the interval α1 ≤ θ ≤ α2.
Write a matlab function called newtons method : Write a MATLAB function called newtons Method that accepts two inputs and returns one output. The inputs should be a vector representation of a polynomial and an initial guess for the root.
How the row operations correspond to operations : The three elementary row operations come from a very natural place - they are thematrix equivalent of the same three operations allowed when reducing and solving a system of equations.
Observed number of breakdowns : The number of breakdowns Y per day for a certain machine is a Poisson random variable with mean λ. The daily cost of repairing these breakdowns is given by C = 3Y 2. If Y1, Y2, . . . , Yn denote the observed number of breakdowns for n independentl..
Determine the electron de broglie wavelength and momentum : A free electron has wave function Ψ(x, t) = sin(kx - θt) 1, Determine the electron's de Broglie wavelength, momentum, kinetic energy and speed when k = 50 nm-1 .
Estimate the area of the tea spill : The surface area of a tea spill is estimated by measuring the width (in cm) of the spill at equally spaced intervals of 1.5 cm (width data is found in TeaSpill.txt). Use numerical integration to estimate the area of the tea spill.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd