<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100</link>
    <title>MATLAB Central Newsreader - Does anyone know how to do any of these programs?</title>
    <description>Feed for thread: Does anyone know how to do any of these programs?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 29 Nov 2008 03:02:28 -0500</pubDate>
      <title>Does anyone know how to do any of these programs?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100#613810</link>
      <author>a999</author>
      <description>Does anyone know how to do any of these programs? help will be much appreciated. &lt;br&gt;
&lt;br&gt;
4.3.1 Convergence of the bisection method&lt;br&gt;
Implement the bisection method in a computer code, and compute the roots of the quadratic equation&lt;br&gt;
x2 &#8722; 2 x + 0.9 = 0. Prepare and discuss a graph of the error against the iteration count, k.&lt;br&gt;
&lt;br&gt;
4.5.2 Newton&#8217;s method&lt;br&gt;
(a) Compute all zeros of the function f(x) = ln |x|+3&#8722;3.1 x2, accurate to the eighth decimal place.&lt;br&gt;
Explain your choice of initial guess.&lt;br&gt;
&lt;br&gt;
4.5.3 More on Newton&#8217;s method&lt;br&gt;
(a) The function f(x) = x ln x has a root at x = 0. What is the rate of convergence of Newton&#8217;s&lt;br&gt;
method toward this root?&lt;br&gt;
&lt;br&gt;
4.5.4 Redlich-Kwong equation of state&lt;br&gt;
Write a program that produces and prints a table showing the molecular volume of hydrogen for&lt;br&gt;
fifteen combinations corresponding to pressure p = 1, 2, 3, 4, and 5 atm and temperature T = 200,&lt;br&gt;
300, and 400 &#9702;K, based on the Redlich-Kwong equation of state (4.1.10). For the initial guess, use the&lt;br&gt;
predictions of the ideal gas law. Discuss the physical significance of your results. Perry&#8217;s Chemical&lt;br&gt;
Engineer&#8217;s Handbook (McGraw-Hill, fifth edition, pp. 3&#8211;41, 3&#8211;104) gives the following information&lt;br&gt;
for hydrogen: Chemical formula: H2; Boiling Point at 1 atm: &#8722;252.7&#9702;C; critical conditions: Tc =&lt;br&gt;
&#8722;239.9&#9702;C; Pc = 12.8 atm.&lt;br&gt;
&lt;br&gt;
4.5.5 Viscous flow in a corner&lt;br&gt;
The nonlinear equation&lt;br&gt;
sin[2(x &#8722; 1)*] = (1 &#8722; x) sin(2*), (1)&lt;br&gt;
describes viscous flow in a corner bounded by two intersecting walls with aperture angle 2*; the&lt;br&gt;
variable x is a measure of the strength of the flow. A trivial solution for any * is x = 1. Find and&lt;br&gt;
plot another solution branch, X(*), in the range 0 &amp;lt; * &amp;lt; *.&lt;br&gt;
&lt;br&gt;
4.6.4 A system of two equations&lt;br&gt;
Compute one solution of the system&lt;br&gt;
(x &#8722; 2)2 + (y &#8722; 3)3 + (x &#8722; 2.1)(y &#8722; 3.1) = 2.81, 10 e&#8722;x + 5 e1&#8722;y = 0.7468, (1)&lt;br&gt;
using (a) Newton&#8217;s method, and (b) Newton&#8217;s method with the Jacobian evaluated only at the&lt;br&gt;
beginning and then held constant. Compare the respective rates of convergence.</description>
    </item>
    <item>
      <pubDate>Sat, 29 Nov 2008 03:46:36 -0500</pubDate>
      <title>Re: Does anyone know how to do any of these programs?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100#613815</link>
      <author>Roger Stafford</author>
      <description>a999 &amp;lt;alikohbodi@yahoo.com&amp;gt; wrote in message &amp;lt;8659463.1227927779634.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; Does anyone know how to do any of these programs? help will be much appreciated. &lt;br&gt;
&amp;gt; ..........&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;If you have any particular feature of one of these problems that involves some Matlab coding techniques, you might be able to persuade someone in this group to help you with it, but surely not unless you have already made significant progress on it yourself.  We are not in the business of doing general homework assignments, but only that of answering certain specific questions concerned with the use of Matlab.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Sat, 29 Nov 2008 05:44:02 -0500</pubDate>
      <title>Re: Does anyone know how to do any of these programs?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100#613825</link>
      <author>Husam Aldahiyat</author>
      <description>Those questions seem fun and informative. I'm sure when you solve and learn the intricate details of your methods you will grow satisfied at the end.</description>
    </item>
    <item>
      <pubDate>Sat, 29 Nov 2008 19:56:01 -0500</pubDate>
      <title>Re: Does anyone know how to do any of these programs?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100#613893</link>
      <author>John</author>
      <description>&quot;Roger Stafford&quot; &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in message &amp;lt;ggqdus$bu7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; a999 &amp;lt;alikohbodi@yahoo.com&amp;gt; wrote in message &amp;lt;8659463.1227927779634.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Does anyone know how to do any of these programs? help will be much appreciated. &lt;br&gt;
&amp;gt; &amp;gt; ..........&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   If you have any particular feature of one of these problems that involves some Matlab coding techniques, you might be able to persuade someone in this group to help you with it, but surely not unless you have already made significant progress on it yourself.  We are not in the business of doing general homework assignments, but only that of answering certain specific questions concerned with the use of Matlab.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&lt;br&gt;
Ok, thank you for informing me, that is no problem. I am new to matlab and a lot of the simple things that i want to do get me stuck, and i get frustrated since then it doesnt even matter if i know what to do, I cant do it cause i am not familiar with the process and the language. &lt;br&gt;
For the first problem: Implement the bisection method in a computer code, and compute the roots of the quadratic equation&lt;br&gt;
x2 &amp;#8722; 2 x + 0.9 = 0. Prepare and discuss a graph of the error against the iteration count, k.&lt;br&gt;
&lt;br&gt;
I have written the following the code:&lt;br&gt;
clc; clear all; close all;&lt;br&gt;
y(x)=(x^2)-(2*x)+(0.9);&lt;br&gt;
X1=2;&lt;br&gt;
X2=-2;&lt;br&gt;
Xm=(0.5)*(y(X1)+y(X2));&lt;br&gt;
d=X2-X1;&lt;br&gt;
Xnewm=Xm+(0.5*d);&lt;br&gt;
disp(Xnewm);&lt;br&gt;
&lt;br&gt;
result:&lt;br&gt;
??? Undefined function or variable 'x'.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; hw5p1 at 2&lt;br&gt;
y(x)=(x^2)-(2*x)+(0.9);&lt;br&gt;
&lt;br&gt;
this is probably a stupid question but how do i plug in X1 and X2 into the y(x) equation, what format do i have to use for that? &lt;br&gt;
thanks you</description>
    </item>
    <item>
      <pubDate>Sun, 30 Nov 2008 01:07:01 -0500</pubDate>
      <title>Re: Does anyone know how to do any of these programs?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100#613924</link>
      <author>Roger Stafford</author>
      <description>&quot;john &quot; &amp;lt;john@yahoo.com&amp;gt; wrote in message &amp;lt;ggs6oh$hrq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; .........&lt;br&gt;
&amp;gt; Ok, thank you for informing me, that is no problem. I am new to matlab and a lot of the simple things that i want to do get me stuck, and i get frustrated since then it doesnt even matter if i know what to do, I cant do it cause i am not familiar with the process and the language. &lt;br&gt;
&amp;gt; For the first problem: Implement the bisection method in a computer code, and compute the roots of the quadratic equation&lt;br&gt;
&amp;gt; x2 &amp;#8722; 2 x + 0.9 = 0. Prepare and discuss a graph of the error against the iteration count, k.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have written the following the code:&lt;br&gt;
&amp;gt; clc; clear all; close all;&lt;br&gt;
&amp;gt; y(x)=(x^2)-(2*x)+(0.9);&lt;br&gt;
&amp;gt; X1=2;&lt;br&gt;
&amp;gt; X2=-2;&lt;br&gt;
&amp;gt; Xm=(0.5)*(y(X1)+y(X2));&lt;br&gt;
&amp;gt; d=X2-X1;&lt;br&gt;
&amp;gt; Xnewm=Xm+(0.5*d);&lt;br&gt;
&amp;gt; disp(Xnewm);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; result:&lt;br&gt;
&amp;gt; ??? Undefined function or variable 'x'.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Error in ==&amp;gt; hw5p1 at 2&lt;br&gt;
&amp;gt; y(x)=(x^2)-(2*x)+(0.9);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; this is probably a stupid question but how do i plug in X1 and X2 into the y(x) equation, what format do i have to use for that? &lt;br&gt;
&amp;gt; thanks you&lt;br&gt;
-----------&lt;br&gt;
&amp;nbsp;&amp;nbsp;Since you have attempted some work on it, I will help you to the following extent on problem 4.3.1.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;In the bisection method you want to make sure you start out with two values of x that produce opposite signs for the corresponding values of y.  Your x1 = 2 and x2 = -2 constitute an unfortunate choice for that since they both give positive values for y.  Make a better selection.  In fact notice that there are two solutions to the equation, so some pairs of x1, x2 should surround one of these and other pairs should be grouped around the other root.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;You first want to start with a pair of x1 and x2 for which you have computed the corresponding values of y as y1 and y2 and these must be of opposite sign.  Then enter into a 'while' loop inside of which you would do something like the following:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;xm = (x1+x2)/2; % Find the midpoint between x1 and x2&lt;br&gt;
&amp;nbsp;ym = xm^2-2*xm+.9; % Compute the corresponding y value&lt;br&gt;
&amp;nbsp;if sign(ym) ~= sign(y1) % Ask if ym and y1 are of opposite signs&lt;br&gt;
&amp;nbsp;&amp;nbsp;x2 = xm; % If so, alter x2 and y2 to the new values, xm and ym&lt;br&gt;
&amp;nbsp;&amp;nbsp;y2 = ym;&lt;br&gt;
&amp;nbsp;else % Otherwise ym and y2 must be of opposite signs&lt;br&gt;
&amp;nbsp;&amp;nbsp;x1 = xm; % So alter x1 and y1 to the new values&lt;br&gt;
&amp;nbsp;&amp;nbsp;y1 = ym;&lt;br&gt;
&amp;nbsp;end&lt;br&gt;
% No matter which alternative was selected, the new y1 and y2 &lt;br&gt;
% will still be of opposite sign&lt;br&gt;
&amp;nbsp;err = abs(y2-y1); % Check the new difference in y values&lt;br&gt;
&lt;br&gt;
At this point you now have the desired root pinned between the new values of x1 and x2 which are half as far apart as in the last trip through the 'while' loop.  Make the 'while' loop quit whenever the error (err) becomes acceptably small.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;You will have to augment this stuff by gathering the iteration count and error in some array for later graphing to satisfy the requirements of the problem.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;If this conditional looping process still puzzles you, make a point of carefully studying how the 'while' command works.  It is absolutely fundamental to the operation of many, many Matlab programs.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Sun, 30 Nov 2008 02:24:01 -0500</pubDate>
      <title>Re: Does anyone know how to do any of these programs?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100#613931</link>
      <author>John</author>
      <description>&quot;Roger Stafford&quot; &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in message &amp;lt;ggsovl$svb$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;john &quot; &amp;lt;john@yahoo.com&amp;gt; wrote in message &amp;lt;ggs6oh$hrq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; .........&lt;br&gt;
&amp;gt; &amp;gt; Ok, thank you for informing me, that is no problem. I am new to matlab and a lot of the simple things that i want to do get me stuck, and i get frustrated since then it doesnt even matter if i know what to do, I cant do it cause i am not familiar with the process and the language. &lt;br&gt;
&amp;gt; &amp;gt; For the first problem: Implement the bisection method in a computer code, and compute the roots of the quadratic equation&lt;br&gt;
&amp;gt; &amp;gt; x2 &amp;#8722; 2 x + 0.9 = 0. Prepare and discuss a graph of the error against the iteration count, k.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I have written the following the code:&lt;br&gt;
&amp;gt; &amp;gt; clc; clear all; close all;&lt;br&gt;
&amp;gt; &amp;gt; y(x)=(x^2)-(2*x)+(0.9);&lt;br&gt;
&amp;gt; &amp;gt; X1=2;&lt;br&gt;
&amp;gt; &amp;gt; X2=-2;&lt;br&gt;
&amp;gt; &amp;gt; Xm=(0.5)*(y(X1)+y(X2));&lt;br&gt;
&amp;gt; &amp;gt; d=X2-X1;&lt;br&gt;
&amp;gt; &amp;gt; Xnewm=Xm+(0.5*d);&lt;br&gt;
&amp;gt; &amp;gt; disp(Xnewm);&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; result:&lt;br&gt;
&amp;gt; &amp;gt; ??? Undefined function or variable 'x'.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Error in ==&amp;gt; hw5p1 at 2&lt;br&gt;
&amp;gt; &amp;gt; y(x)=(x^2)-(2*x)+(0.9);&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; this is probably a stupid question but how do i plug in X1 and X2 into the y(x) equation, what format do i have to use for that? &lt;br&gt;
&amp;gt; &amp;gt; thanks you&lt;br&gt;
&amp;gt; -----------&lt;br&gt;
&amp;gt;   Since you have attempted some work on it, I will help you to the following extent on problem 4.3.1.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   In the bisection method you want to make sure you start out with two values of x that produce opposite signs for the corresponding values of y.  Your x1 = 2 and x2 = -2 constitute an unfortunate choice for that since they both give positive values for y.  Make a better selection.  In fact notice that there are two solutions to the equation, so some pairs of x1, x2 should surround one of these and other pairs should be grouped around the other root.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   You first want to start with a pair of x1 and x2 for which you have computed the corresponding values of y as y1 and y2 and these must be of opposite sign.  Then enter into a 'while' loop inside of which you would do something like the following:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  xm = (x1+x2)/2; % Find the midpoint between x1 and x2&lt;br&gt;
&amp;gt;  ym = xm^2-2*xm+.9; % Compute the corresponding y value&lt;br&gt;
&amp;gt;  if sign(ym) ~= sign(y1) % Ask if ym and y1 are of opposite signs&lt;br&gt;
&amp;gt;   x2 = xm; % If so, alter x2 and y2 to the new values, xm and ym&lt;br&gt;
&amp;gt;   y2 = ym;&lt;br&gt;
&amp;gt;  else % Otherwise ym and y2 must be of opposite signs&lt;br&gt;
&amp;gt;   x1 = xm; % So alter x1 and y1 to the new values&lt;br&gt;
&amp;gt;   y1 = ym;&lt;br&gt;
&amp;gt;  end&lt;br&gt;
&amp;gt; % No matter which alternative was selected, the new y1 and y2 &lt;br&gt;
&amp;gt; % will still be of opposite sign&lt;br&gt;
&amp;gt;  err = abs(y2-y1); % Check the new difference in y values&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; At this point you now have the desired root pinned between the new values of x1 and x2 which are half as far apart as in the last trip through the 'while' loop.  Make the 'while' loop quit whenever the error (err) becomes acceptably small.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   You will have to augment this stuff by gathering the iteration count and error in some array for later graphing to satisfy the requirements of the problem.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   If this conditional looping process still puzzles you, make a point of carefully studying how the 'while' command works.  It is absolutely fundamental to the operation of many, many Matlab programs.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
Thanks a lot for your response and help. I wrote the program before and then changed it based on your advice but somehow i can not get an answer from it.&lt;br&gt;
Original version:&lt;br&gt;
clc; clear all; close all;&lt;br&gt;
y=inline('(x^2)-(2*x)+(0.9)');&lt;br&gt;
&lt;br&gt;
X1=1;&lt;br&gt;
X2=-2;&lt;br&gt;
Xm=(0.5)*(X1+X2);&lt;br&gt;
d=X2-X1;&lt;br&gt;
Xnewm=X1+(0.5*d);&lt;br&gt;
&lt;br&gt;
if y(X1)+y(Xm)&amp;lt;y(X1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X2=Xm;&lt;br&gt;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if y(X2)+y(Xm)&amp;lt;y(X2)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X1=Xm;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elseif y(Xm)==0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp(Xm);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
Changed version:&lt;br&gt;
clc; clear all; close all;&lt;br&gt;
y=inline('(x^2)-(2*x)+(0.9)');&lt;br&gt;
&lt;br&gt;
X1=1;&lt;br&gt;
X2=-2;&lt;br&gt;
Xm=(0.5)*(X1+X2);&lt;br&gt;
d=X2-X1;&lt;br&gt;
Xnewm=X1+(0.5*d);&lt;br&gt;
if sign(y(X1)) ~= sign((Xm))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X2=Xm;&lt;br&gt;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if sign(y(X2)) ~= sign((Xm))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X1=Xm;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elseif y(Xm)==0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp(Xm);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
when i run it, it does not display Xm at the end. </description>
    </item>
    <item>
      <pubDate>Sun, 30 Nov 2008 03:44:02 -0500</pubDate>
      <title>Re: Does anyone know how to do any of these programs?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240100#613941</link>
      <author>Roger Stafford</author>
      <description>&quot;john &quot; &amp;lt;john@yahoo.com&amp;gt; wrote in message &amp;lt;ggstg1$nae$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ........&lt;br&gt;
&amp;gt; Changed version:&lt;br&gt;
&amp;gt; clc; clear all; close all;&lt;br&gt;
&amp;gt; y=inline('(x^2)-(2*x)+(0.9)');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; X1=1;&lt;br&gt;
&amp;gt; X2=-2;&lt;br&gt;
&amp;gt; Xm=(0.5)*(X1+X2);&lt;br&gt;
&amp;gt; d=X2-X1;&lt;br&gt;
&amp;gt; Xnewm=X1+(0.5*d);&lt;br&gt;
&amp;gt; if sign(y(X1)) ~= sign((Xm))&lt;br&gt;
&amp;gt;     X2=Xm;&lt;br&gt;
&amp;gt; else&lt;br&gt;
&amp;gt;     if sign(y(X2)) ~= sign((Xm))&lt;br&gt;
&amp;gt;         X1=Xm;&lt;br&gt;
&amp;gt;     elseif y(Xm)==0&lt;br&gt;
&amp;gt;         disp(Xm);&lt;br&gt;
&amp;gt;     end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; when i run it, it does not display Xm at the end. &lt;br&gt;
------------------&lt;br&gt;
&amp;nbsp;&amp;nbsp;I will limit my response to just a few observations, John.  1) You have not implemented the 'while' loop you need to do the necessary iterating.  It only does its computation once.  2) You are comparing the sign of y(X1) with that of Xm which makes no sense.  3) You are waiting for y(Xm) to equal zero to display Xm which may never happen no matter how many iterations you have done.  4) You do a comparison with the sign of y(X2) after your comparison with the sign of y(X1).  If you know that they remain always opposite in sign, this is totally unnecessary.  5) In bringing the 'while' loop to a halt you would need the absolute value of the difference in y's.  This difference may never reach zero and you may not know in advance which sign it will have.  6) The quantity Xnewm is identically equal to Xm and is wholly redundant. &lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
  </channel>
</rss>

