Filter löschen
Filter löschen

Help with a Newton Raphson problem

3 Ansichten (letzte 30 Tage)
Aaron Zorzi
Aaron Zorzi am 1 Mär. 2016
So I've already written a code for the actual method, but now I'm trying to solve a real world problem with it, and I've gotten stuck on what to do. This is the question:
Each widget sells for $4.00. The cost ($) to produce x widgets is:
Cost = 1000 + 2 * x + 3*x^(2/3)
Use the Newton Raphson algorithm to find out how many widgets should be produced to break even. In other words, find x such that f(x) = Cost – Sales = 0. Write a MATLAB script to solve for the number of widgets needed to break even then run your script. How many widgets are needed to break even? Check your answer by calculating Cost and Sales.
These are the parts I completed myself:
Complete equation for f(x) = f(x) = -2x+1000+3x^(2/3)
Complete equation for the Newton Raphson Update: xn+1 = xn – (-2x+1000+3x^(2/3))/(-2+(2/x^(1/3)))
The Newton code I wrote is able to calculate the 5th root of a given number by using an initial guess, and looping until it's within a certain accuracy. How can I do this problem? Thank you.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by