Question: Matlab loop question! Using the model for the density as a function of temperature, p=A*1/T + B, where A = 202.498 & B= -0.0009 and
Matlab loop question!
Using the model for the density as a function of temperature, p=A*1/T + B, where A = 202.498 & B= -0.0009 and T is in F, implement the Newton-Raphson method to find the temperature at which the density at pressure of 120 psi (this is the pressure A, B constants were calculated at) will be equal to 0.5 lb/ft^3 . Use the tolerance of 10^-5 lb/ft^3 . You can use an initial guess of 200 F. USE the LOOP function to solve.

Newton-Raphson method Nonlinear equations can be solved using the Newton-Raphson method. The method is based on the following algorithm: a. make an initial guess, xo, for the solution of the equation; b, calculate the value of the function and its derivative in xo: f(%), rxo); c. calculate the next value of x, xl, using the following formula: xiXo fxo) f(xo); d. repeat the process by calculating the next value of x, xa-1, using the previous value of x, X and the function and its derivative at the previous value. xir,-Xo-f(x) / f(x); e. perform iterations until the value of the function at the new point is within some prespecified tolerance from 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
