<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012</link>
    <title>MATLAB Central Newsreader - solution of a transcendental equation</title>
    <description>Feed for thread: solution of a transcendental equation</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The 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>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 14 Jan 2008 20:29:14 -0500</pubDate>
      <title>solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409352</link>
      <author>Fulya</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
I have a transcendental equation:&lt;br&gt;
&lt;br&gt;
y=a.*((b+c.*y.*x)./(b+c.*x))^(1-1./c)&lt;br&gt;
&lt;br&gt;
I have to take y to the left side of equation and obtain an expression y=f(x). x is an array of 50 elements and a,b and c are constants.&lt;br&gt;
Do you have any idea? What can I do?&lt;br&gt;
b and c parameters are constantly changing.&lt;br&gt;
I tried 'solve' command but it didn't do like I want. &lt;br&gt;
I know that c&amp;gt;1.&lt;br&gt;
Thanks a lot.&lt;br&gt;
&lt;br&gt;
Fulya&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 00:25:18 -0500</pubDate>
      <title>Re: solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409390</link>
      <author>Roger Stafford</author>
      <description>Fulya &amp;lt;fulya_bagci@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;9544552.1200342600658.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a transcendental equation:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; y=a.*((b+c.*y.*x)./(b+c.*x))^(1-1./c)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have to take y to the left side of equation and obtain an expression y=f(x). &lt;br&gt;
x is an array of 50 elements and a,b and c are constants.&lt;br&gt;
&amp;gt; Do you have any idea? What can I do?&lt;br&gt;
&amp;gt; b and c parameters are constantly changing.&lt;br&gt;
&amp;gt; I tried 'solve' command but it didn't do like I want. &lt;br&gt;
&amp;gt; I know that c&amp;gt;1.&lt;br&gt;
&amp;gt; Thanks a lot.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Fulya&lt;br&gt;
---------&lt;br&gt;
&amp;nbsp;&amp;nbsp;Possibly you can use matlab's 'fzero' function if you can come up with a &lt;br&gt;
scheme for making the x0 estimates that function requires.  If your b and c &lt;br&gt;
values change by small amounts, you can probably use the solutions to the &lt;br&gt;
previous b and c values for estimating the next b and c solutions.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;I don't have 'fzero' on my ancient system but I think it only works with &lt;br&gt;
scalar-valued functions, so you may have to resort to a 50-step for-loop to &lt;br&gt;
treat each value in the x vector separately in determining the corresponding y &lt;br&gt;
vector, for given a, b, and c values.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;I notice that you can easily solve for x in the equation as a function of y, &lt;br&gt;
which means there is only one value of x for each y-value (for a given a, b, c &lt;br&gt;
set.)  However, the reverse does not appear to be true.  Given values of x may &lt;br&gt;
correspond to more than one y value.  In this case the x0 estimate for 'fzero' &lt;br&gt;
will have to be carefully chosen so as to lead to the correct y.  Either that or &lt;br&gt;
you need to invoke some constraints on the y-value range (using two-&lt;br&gt;
element x0's.)&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;The fact that x can be expressed as a function of y makes it possible for you &lt;br&gt;
to do some initial plotting for various values of your parameters a, b, and c, &lt;br&gt;
so as to help with the proper choice of the estimator x0 values.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jan 2008 01:26:02 -0500</pubDate>
      <title>Re: solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409392</link>
      <author>John D'Errico</author>
      <description>Fulya &amp;lt;fulya_bagci@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;9544552.1200342600658.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a transcendental equation:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; y=a.*((b+c.*y.*x)./(b+c.*x))^(1-1./c)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have to take y to the left side of equation and obtain an expression y=f(x). &lt;br&gt;
x is an array of 50 elements and a,b and c are constants.&lt;br&gt;
&amp;gt; Do you have any idea? What can I do?&lt;br&gt;
&amp;gt; b and c parameters are constantly changing.&lt;br&gt;
&amp;gt; I tried 'solve' command but it didn't do like I want. &lt;br&gt;
&amp;gt; I know that c&amp;gt;1.&lt;br&gt;
&amp;gt; Thanks a lot.&lt;br&gt;
&lt;br&gt;
% Pick some arbitrary numbers for a, b, c.&lt;br&gt;
a = 2;&lt;br&gt;
b = 3;&lt;br&gt;
c = pi;&lt;br&gt;
% and a few random numbers for x.&lt;br&gt;
n = 10;&lt;br&gt;
x = rand(n,1);&lt;br&gt;
&lt;br&gt;
% first, do it in a loop&lt;br&gt;
yi = nan(size(x));&lt;br&gt;
for i = 1:n&lt;br&gt;
&amp;nbsp;&amp;nbsp;funi = @(y) y-a.*abs((b+c.*y.*x(i))./(b+c.*x(i))).^(1-1./c);&lt;br&gt;
&amp;nbsp;&amp;nbsp;yi(i) = fzero(funi,1);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
%  verify the solutions, using a vectorized form&lt;br&gt;
fun = @(y) y-a.*abs((b+c.*y.*x)./(b+c.*x)).^(1-1./c);&lt;br&gt;
&lt;br&gt;
% solve all at once using fsolve&lt;br&gt;
opts = optimset('fsolve');&lt;br&gt;
opts.JacobPattern = speye(n,n);&lt;br&gt;
yvec = fsolve(fun,ones(n,1),opts);&lt;br&gt;
&lt;br&gt;
[yi,yvec,yi-yvec,fun(yi)]&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.4128       3.4128  -5.3715e-08            0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.1859       3.1859  -1.6924e-09            0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.7411       2.7411  -3.9524e-14            0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.6615       2.6615   8.8818e-16            0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.6786       2.6786  -2.6645e-15   4.4409e-16&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.4596       2.4596   8.8818e-16   4.4409e-16&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.775        2.775  -1.2124e-13            0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.7785       2.7785  -1.3634e-13            0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.2486       3.2486  -4.7774e-09   4.4409e-16&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.2146       3.2146  -2.7467e-09   4.4409e-16&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
John&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 16 Jan 2008 17:28:57 -0500</pubDate>
      <title>Re: solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409660</link>
      <author>Fulya</author>
      <description>OK. I used 'fsolve'.&lt;br&gt;
&lt;br&gt;
I do least squares fitting of this function.It gives such an error and although the fit is good when I enter good initial parameters, it is not smooth and it gives what I write as the initial parameters.Error:&lt;br&gt;
&lt;br&gt;
Conditioning of Gradient Poor - Switching To LM method&lt;br&gt;
Optimization terminated: search direction less than TolX.&lt;br&gt;
&lt;br&gt;
my code is&lt;br&gt;
.&lt;br&gt;
funi = @(y) mean(abs(y-a.*abs(Fsat+K.*y.*x)./ (Fsat+K.*x)).^(1-1./K));&lt;br&gt;
%yd is experimental y, yi is the theoretical y&lt;br&gt;
yi  = fsolve(funi,yd);&lt;br&gt;
.&lt;br&gt;
val = yd - yi&lt;br&gt;
&lt;br&gt;
second window:&lt;br&gt;
read experimental x and yd data&lt;br&gt;
[solution]=lsqnonlin(@OAOLmyLu,[8.0,3.0])&lt;br&gt;
plot(x,yd)&lt;br&gt;
plot(x,yi)&lt;br&gt;
&lt;br&gt;
I thank individually to whow writes to me.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 16 Jan 2008 18:59:01 -0500</pubDate>
      <title>Re: solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409677</link>
      <author>John D'Errico</author>
      <description>Fulya &amp;lt;fulya_bagci@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;22495104.1200504568448.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; OK. I used 'fsolve'.&lt;br&gt;
&lt;br&gt;
Fsolve is inappropriate to solve a least squares&lt;br&gt;
problem as you are doing.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt; I do least squares fitting of this function.It gives such an error and although &lt;br&gt;
the fit is good when I enter good initial parameters, it is not smooth and it &lt;br&gt;
gives what I write as the initial parameters.Error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Conditioning of Gradient Poor - Switching To LM method&lt;br&gt;
&lt;br&gt;
This is not an error message. It is a statement&lt;br&gt;
about the algorithm's progress.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; Optimization terminated: search direction less than TolX.&lt;br&gt;
&lt;br&gt;
This is not an error message. It is a statement&lt;br&gt;
that the algorithm has finished its work.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; my code is&lt;br&gt;
&amp;gt; .&lt;br&gt;
&amp;gt; funi = @(y) mean(abs(y-a.*abs(Fsat+K.*y.*x)./ (Fsat+K.*x)).^(1-1./K));&lt;br&gt;
&amp;gt; %yd is experimental y, yi is the theoretical y&lt;br&gt;
&amp;gt; yi  = fsolve(funi,yd);&lt;br&gt;
&amp;gt; .&lt;br&gt;
&amp;gt; val = yd - yi&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
What are you solving for? y? Or are you&lt;br&gt;
trying to solve for the parameters Fsat, K, a?&lt;br&gt;
&lt;br&gt;
&amp;nbsp;John&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 16 Jan 2008 20:58:02 -0500</pubDate>
      <title>Re: solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409698</link>
      <author>Roger Stafford</author>
      <description>Fulya &amp;lt;fulya_bagci@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;22495104.1200504568448.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; OK. I used 'fsolve'.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I do least squares fitting of this function.It gives such an error and although &lt;br&gt;
the fit is good when I enter good initial parameters, it is not smooth and it &lt;br&gt;
gives what I write as the initial parameters.Error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Conditioning of Gradient Poor - Switching To LM method&lt;br&gt;
&amp;gt; Optimization terminated: search direction less than TolX.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; my code is&lt;br&gt;
&amp;gt; .&lt;br&gt;
&amp;gt; funi = @(y) mean(abs(y-a.*abs(Fsat+K.*y.*x)./ (Fsat+K.*x)).^(1-1./K));&lt;br&gt;
&amp;gt; %yd is experimental y, yi is the theoretical y&lt;br&gt;
&amp;gt; yi  = fsolve(funi,yd);&lt;br&gt;
&amp;gt; .&lt;br&gt;
&amp;gt; val = yd - yi&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; second window:&lt;br&gt;
&amp;gt; read experimental x and yd data&lt;br&gt;
&amp;gt; [solution]=lsqnonlin(@OAOLmyLu,[8.0,3.0])&lt;br&gt;
&amp;gt; plot(x,yd)&lt;br&gt;
&amp;gt; plot(x,yi)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I thank individually to whow writes to me.&lt;br&gt;
----------&lt;br&gt;
&amp;nbsp;&amp;nbsp;Fulya, I don't understand how your function 'funi' in this second article &lt;br&gt;
relates to the original implicit function you defined in your first article:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;y=a*((b+c*y*x)/(b+c*x))^(1-1/c)&lt;br&gt;
&lt;br&gt;
Presumably 'Fsat' refers to 'b' and 'K' to 'c'.  However, in this second article the &lt;br&gt;
exponent, (1-1/c), operates on the difference between the two sides of the &lt;br&gt;
equation, rather than simply to the fraction (b+c*y*x)/(b+c*x).  Your 'funi' is &lt;br&gt;
also not the same as John's 'funi' or his 'fun'.  How do you account for the &lt;br&gt;
differences here?&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Also you don't state anywhere whether quantity 'a' is less than or greater &lt;br&gt;
than 1.  This makes a very important difference to the appearance of the x-&lt;br&gt;
versus-y curve.  Also you don't state whether you are interested in the &lt;br&gt;
portion where y &amp;gt; a or that where y &amp;lt; a.  These are two separate pieces of the &lt;br&gt;
curve.  What kinds of values are you using for a, b, and c?&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;As I mentioned earlier, x can be expressed as a function of y:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;x = b/c*(t-1)/(y-t)&lt;br&gt;
&lt;br&gt;
where&lt;br&gt;
&lt;br&gt;
&amp;nbsp;t = (y/a)^(c/(c-1)).&lt;br&gt;
&lt;br&gt;
(Very likely you intend for y and a to both be positive quantities so as to get a &lt;br&gt;
real value for t here.)  You should try plotting this function from y ranging &lt;br&gt;
from 0 up to something well above y = a to get a feeling for what you are &lt;br&gt;
dealing with.  You will be able to see the difference between the cases where &lt;br&gt;
a &amp;gt; 1 and a &amp;lt; 1, as well as noting the asymptotes at y = 0 and y = a.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;If I were doing this problem (after doing some plotting) I would first use &lt;br&gt;
'fzero' to solve it, before attempting to use 'fsolve'.  Though 'fzero' can only &lt;br&gt;
deal with scalar solutions one at a time, it is much simpler in concept than &lt;br&gt;
'fsolve' and would allow you to better understand the problem you are dealing &lt;br&gt;
with.  After that you could try for better run time efficiency with 'fsolve'.  You &lt;br&gt;
should note that the results John got with 'fzero' gave solutions that appear &lt;br&gt;
to be as accurate as matlab's double is capable of - that is, errors only out at &lt;br&gt;
the least bit.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 17 Jan 2008 08:07:21 -0500</pubDate>
      <title>Re: solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409766</link>
      <author>Fulya</author>
      <description>I want to solve Fsat and K (refering to b and c respectively).a is a constant and 1.289 for this fit.The fitting equation is a trascendental equation so I must solve it first by 'fzero' or 'fsolve' before fitting with 'lsqnonlin'. (1-1/c) is the exponent of (b+c*y*x)/(b+c*x).y decreases from 1 to 0.4 . There are 180 experimental y values.I do least squares fitting by obtaining theoretical y values by fsolve for experimental x values. Fsat (b) and K(c)can be 2 and 6 respectively (reasonable values)&lt;br&gt;
For a=1.289, b=2 and c=6 the curve starts from 1, goes flat  a little and bends down to y=0.4 exponentially( it is a semilogx graphic). &lt;br&gt;
I used fsolve rather than fzero because &lt;br&gt;
yi  = fsolve(funi,yexperimental)&lt;br&gt;
There are 180 experimental y's, if I use fzero I must enter one(or two) parameter as x0 (fzero(funi,x0))(it does not accept more) and since theoretical y's must be close to experimental y's I chose fsolve command. x (experimental) starts from 0.004 and ends with 1.49.&lt;br&gt;
It gives a statement as I wrote before and the fit is not smooth and it fits to what I write as the initial parameters for Fsat and K.&lt;br&gt;
&lt;br&gt;
function val = OAOLmyLu(s)&lt;br&gt;
global x yexperimental ytheoretical val&lt;br&gt;
a=1.289;&lt;br&gt;
funi = @(y) mean(abs(y-a.*abs((Fsat+K.*y.*x)./(Fsat+K.*x)).^(1-1./K)));&lt;br&gt;
ytheoretical  = fsolve(funi,yexperimental)&lt;br&gt;
val = ytheoretical-yexperimental;&lt;br&gt;
&lt;br&gt;
**&lt;br&gt;
close all, clc&lt;br&gt;
global x yexperimental ytheoretical val&lt;br&gt;
read experimental x and y from txt file.&lt;br&gt;
[solution]=lsqnonlin(@OAOLmyLu,[8.0,3.0]);&lt;br&gt;
K=solution(1)&lt;br&gt;
Fsat=solution(2)&lt;br&gt;
calculate sum(val.^2)&lt;br&gt;
semilogx(x, yexperimental)&lt;br&gt;
semilogx(x, ytheoretical)&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 17 Jan 2008 21:20:19 -0500</pubDate>
      <title>Re: solution of a transcendental equation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162012#409894</link>
      <author>Roger Stafford</author>
      <description>Fulya &amp;lt;fulya_bagci@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;5287596.1200557272380.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; I want to solve Fsat and K (refering to b and c respectively).a is a constant &lt;br&gt;
and 1.289 for this fit.The fitting equation is a trascendental equation so I &lt;br&gt;
must solve it first by 'fzero' or 'fsolve' before fitting with 'lsqnonlin'. (1-1/c) is &lt;br&gt;
the exponent of (b+c*y*x)/(b+c*x).y decreases from 1 to 0.4 . There are 180 &lt;br&gt;
experimental y values.I do least squares fitting by obtaining theoretical y &lt;br&gt;
values by fsolve for experimental x values. Fsat (b) and K(c)can be 2 and 6 &lt;br&gt;
respectively (reasonable values)&lt;br&gt;
&amp;gt; For a=1.289, b=2 and c=6 the curve starts from 1, goes flat  a little and &lt;br&gt;
bends down to y=0.4 exponentially( it is a semilogx graphic). &lt;br&gt;
&amp;gt; I used fsolve rather than fzero because &lt;br&gt;
&amp;gt; yi  = fsolve(funi,yexperimental)&lt;br&gt;
&amp;gt; There are 180 experimental y's, if I use fzero I must enter one(or two) &lt;br&gt;
parameter as x0 (fzero(funi,x0))(it does not accept more) and since &lt;br&gt;
theoretical y's must be close to experimental y's I chose fsolve command. x &lt;br&gt;
(experimental) starts from 0.004 and ends with 1.49.&lt;br&gt;
&amp;gt; It gives a statement as I wrote before and the fit is not smooth and it fits to &lt;br&gt;
what I write as the initial parameters for Fsat and K.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; function val = OAOLmyLu(s)&lt;br&gt;
&amp;gt; global x yexperimental ytheoretical val&lt;br&gt;
&amp;gt; a=1.289;&lt;br&gt;
&amp;gt; funi = @(y) mean(abs(y-a.*abs((Fsat+K.*y.*x)./(Fsat+K.*x)).^(1-1./K)));&lt;br&gt;
&amp;gt; ytheoretical  = fsolve(funi,yexperimental)&lt;br&gt;
&amp;gt; val = ytheoretical-yexperimental;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; **&lt;br&gt;
&amp;gt; close all, clc&lt;br&gt;
&amp;gt; global x yexperimental ytheoretical val&lt;br&gt;
&amp;gt; read experimental x and y from txt file.&lt;br&gt;
&amp;gt; [solution]=lsqnonlin(@OAOLmyLu,[8.0,3.0]);&lt;br&gt;
&amp;gt; K=solution(1)&lt;br&gt;
&amp;gt; Fsat=solution(2)&lt;br&gt;
&amp;gt; calculate sum(val.^2)&lt;br&gt;
&amp;gt; semilogx(x, yexperimental)&lt;br&gt;
&amp;gt; semilogx(x, ytheoretical)&lt;br&gt;
--------&lt;br&gt;
&amp;nbsp;&amp;nbsp;Based on the data you have given us, Fulya, it looks as though you are &lt;br&gt;
facing an impossible task, fitting the theoretical to the experimental data.  &lt;br&gt;
You stated that "x (experimental) starts from 0.004 and ends with 1.49."  You &lt;br&gt;
also stated that a &amp;gt; 1, that presumably b was to be positive, and that c was to &lt;br&gt;
be greater than 1.  Finally you stated that, "y decreases from 1 to 0.4 ".  &lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;The code below uses a = 1.289 and the "reasonable values" b = 2 and c = 6 &lt;br&gt;
you suggested, and plots x versus y over the range .01 &amp;lt;= y &amp;lt;= a^c-.1 .  It &lt;br&gt;
uses the formula I mentioned earlier for finding x as a function of y, namely, t &lt;br&gt;
= (y/a)^(c/(c-1)), x = b/c*(t-1)/(y-t), and makes a plot of the curve in yellow.  &lt;br&gt;
(You can easily check that x and y satisfy your original equation.)  It also &lt;br&gt;
includes the asymptotic lines y = 0 and y = a^c in red.  You will note that &lt;br&gt;
throughout this y range, x increases as y increases and the two lines y = 0 &lt;br&gt;
and y = a^c are approached asymptotically as x approaches minus and plus &lt;br&gt;
infinity, respectively.  (This is because the denominator, y-t, becomes zero &lt;br&gt;
when y = 0 and when y = a^c.)  If you use smaller limits on y, y=linspace&lt;br&gt;
(1.293,2.547,n), so as to restrict x approximately to the experimental range &lt;br&gt;
in question, you can see that these y values are very far away from the above-&lt;br&gt;
mentioned experimental y values which range from 1 down to .4 and they are &lt;br&gt;
moving in the wrong direction.  If we use the latter experimental y-range, we &lt;br&gt;
get negative values for theoretical x, which is again far away from the &lt;br&gt;
experimental values.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Assuming only that a &amp;gt; 1, b &amp;gt; 0, and c &amp;gt; 1, this formula of x as a function &lt;br&gt;
of y shows that on any theoretical curve, x will be zero when t = 1 and &lt;br&gt;
therefore when y = a.  For larger values of x the y values will be larger.  &lt;br&gt;
Hence, for any such a, b, and c, the theoretical curve will always remain far &lt;br&gt;
removed from the stated experimental y values and will be sloping in the &lt;br&gt;
opposite direction.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;If all this is correct, you would have no chance of fitting a theoretical curve &lt;br&gt;
of the kind you have defined to the experimental data, regardless of what &lt;br&gt;
method you use to solve the equation.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;% Calculate the theoretical curve above y = 0 and below y = a^c.&lt;br&gt;
&amp;nbsp;clear&lt;br&gt;
&amp;nbsp;a =1.289; b=2; c=6;&lt;br&gt;
&amp;nbsp;n = 1000;&lt;br&gt;
&amp;nbsp;y = linspace(.01,a^c-.1,n).';&lt;br&gt;
&amp;nbsp;t = (y/a).^(c/(c-1));&lt;br&gt;
&amp;nbsp;x = b/c*(t-1)./(y-t);&lt;br&gt;
&amp;nbsp;plot([x(1),x(n)],[a^c,a^c],'r-',[x(1),x(n)],[0,0],'r-',x,y,'y.')&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
