<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169342</link>
    <title>MATLAB Central Newsreader - Help needed with Non-Linear Least Square Fitting</title>
    <description>Feed for thread: Help needed with Non-Linear Least Square Fitting</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>Thu, 15 May 2008 19:49:02 -0400</pubDate>
      <title>Help needed with Non-Linear Least Square Fitting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169342#432340</link>
      <author>Nima Azar</author>
      <description>Hi Guys,&lt;br&gt;
So I'm measuring Reflectance(v2) vs. Wavelength(v1) and &lt;br&gt;
need to find the thickness of my sample, for that I'm &lt;br&gt;
trying to use fitting to a function using the nonlinear &lt;br&gt;
square method to find couple of unknowns.&lt;br&gt;
If anyone can help please email me at nimakev@yahoo.com so &lt;br&gt;
I'll send you more information,&lt;br&gt;
any help is greatly appericiated.&lt;br&gt;
&amp;nbsp;&lt;br&gt;
thank you.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 15 May 2008 19:57:01 -0400</pubDate>
      <title>Re: Help needed with Non-Linear Least Square Fitting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169342#432344</link>
      <author>Nima Azar</author>
      <description>"Nima Azar" &amp;lt;nimakev@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0i43e$n5i$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi Guys,&lt;br&gt;
&amp;gt; So I'm measuring Reflectance(v2) vs. Wavelength(v1) and &lt;br&gt;
&amp;gt; need to find the thickness of my sample, for that I'm &lt;br&gt;
&amp;gt; trying to use fitting to a function using the nonlinear &lt;br&gt;
&amp;gt; square method to find couple of unknowns.&lt;br&gt;
&amp;gt; If anyone can help please email me at nimakev@yahoo.com &lt;br&gt;
so &lt;br&gt;
&amp;gt; I'll send you more information,&lt;br&gt;
&amp;gt; any help is greatly appericiated.&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; thank you.&lt;br&gt;
&lt;br&gt;
So Here's the Function:&lt;br&gt;
v2 = -a &amp;#8211; b*v1 &amp;#8211;  c*(v1)^2 + d[1+(e/2d)cos((16.745*g/v1) + &lt;br&gt;
h)] Exp(-j/(v1)^2)&lt;br&gt;
&lt;br&gt;
so basically g and h are to be found through fitting...&lt;br&gt;
&lt;br&gt;
thanks for helps.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 15 May 2008 20:00:04 -0400</pubDate>
      <title>Re: Help needed with Non-Linear Least Square Fitting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169342#432346</link>
      <author>Roger Stafford</author>
      <description>"Nima Azar" &amp;lt;nimakev@yahoo.com&amp;gt; wrote in message &amp;lt;g0i43e$n5i&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi Guys,&lt;br&gt;
&amp;gt; So I'm measuring Reflectance(v2) vs. Wavelength(v1) and &lt;br&gt;
&amp;gt; need to find the thickness of my sample, for that I'm &lt;br&gt;
&amp;gt; trying to use fitting to a function using the nonlinear &lt;br&gt;
&amp;gt; square method to find couple of unknowns.&lt;br&gt;
&amp;gt; If anyone can help please email me at nimakev@yahoo.com so &lt;br&gt;
&amp;gt; I'll send you more information,&lt;br&gt;
&amp;gt; any help is greatly appericiated.&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; thank you.&lt;br&gt;
-------------&lt;br&gt;
&amp;nbsp;&amp;nbsp;I'm afraid my physics is a little rusty at this point.  You need to tell in what way &lt;br&gt;
sample thickness is to depend on reflectance and wavelength in your fitting &lt;br&gt;
model.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 15 May 2008 20:15:08 -0400</pubDate>
      <title>Re: Help needed with Non-Linear Least Square Fitting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169342#432350</link>
      <author>Nima Azar</author>
      <description>"Roger Stafford" &lt;br&gt;
&amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
message &amp;lt;g0i4o4$2lt$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Nima Azar" &amp;lt;nimakev@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0i43e$n5i&lt;br&gt;
&amp;gt; $1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi Guys,&lt;br&gt;
&amp;gt; &amp;gt; So I'm measuring Reflectance(v2) vs. Wavelength(v1) and &lt;br&gt;
&amp;gt; &amp;gt; need to find the thickness of my sample, for that I'm &lt;br&gt;
&amp;gt; &amp;gt; trying to use fitting to a function using the nonlinear &lt;br&gt;
&amp;gt; &amp;gt; square method to find couple of unknowns.&lt;br&gt;
&amp;gt; &amp;gt; If anyone can help please email me at nimakev@yahoo.com &lt;br&gt;
so &lt;br&gt;
&amp;gt; &amp;gt; I'll send you more information,&lt;br&gt;
&amp;gt; &amp;gt; any help is greatly appericiated.&lt;br&gt;
&amp;gt; &amp;gt;  &lt;br&gt;
&amp;gt; &amp;gt; thank you.&lt;br&gt;
&amp;gt; -------------&lt;br&gt;
&amp;gt;   I'm afraid my physics is a little rusty at this point.  &lt;br&gt;
You need to tell in what way &lt;br&gt;
&amp;gt; sample thickness is to depend on reflectance and &lt;br&gt;
wavelength in your fitting &lt;br&gt;
&amp;gt; model.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Thanks Roger for your reply:&lt;br&gt;
&lt;br&gt;
Here's the Function:&lt;br&gt;
v2 = -a &amp;#8211; b*v1 &amp;#8211; c*(v1)^2 + d[1+(e/2d)cos((16.745*g/v1) + &lt;br&gt;
h)] Exp(-j/(v1)^2)&lt;br&gt;
&lt;br&gt;
so basically g and h are to be found through fitting...and &lt;br&gt;
I can get V1, V2 through measurments...&lt;br&gt;
&lt;br&gt;
thanks for help.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 15 May 2008 22:12:01 -0400</pubDate>
      <title>Re: Help needed with Non-Linear Least Square Fitting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169342#432377</link>
      <author>Roger Stafford</author>
      <description>"Nima Azar" &amp;lt;nimakev@yahoo.com&amp;gt; wrote in message &amp;lt;g0i5kc$pjn&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Thanks Roger for your reply:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Here's the Function:&lt;br&gt;
&amp;gt; v2 = -a &amp;#8211; b*v1 &amp;#8211; c*(v1)^2 + d[1+(e/2d)cos((16.745*g/v1) + &lt;br&gt;
&amp;gt; h)] Exp(-j/(v1)^2)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; so basically g and h are to be found through fitting...and &lt;br&gt;
&amp;gt; I can get V1, V2 through measurments...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thanks for help.&lt;br&gt;
-------------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If you have the Optimization Toolbox, one way is to use 'fsolve'.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;In case you don't have that toolbox, I notice that the equation can be &lt;br&gt;
reformulated to look like this:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;A*g+h = B&lt;br&gt;
&lt;br&gt;
where A and B are column vectors that depend on the various values of V1 &lt;br&gt;
and V2.  This is done by solving for the cosine expression in terms of &lt;br&gt;
everything else and then taking the arccosine of both sides.  In this form it is &lt;br&gt;
a standard linear least squares problem for which you can use matlab's &lt;br&gt;
backslash operator.  You will have to ensure that the arccosine values you &lt;br&gt;
obtain in B lie in the appropriate angular range so that realistic values of g &lt;br&gt;
and h are obtained.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 16 May 2008 13:42:01 -0400</pubDate>
      <title>Re: Help needed with Non-Linear Least Square Fitting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169342#432495</link>
      <author>aasim Azooz</author>
      <description>"Roger Stafford" &lt;br&gt;
&amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
message &amp;lt;g0i4o4$2lt$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Nima Azar" &amp;lt;nimakev@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0i43e$n5i&lt;br&gt;
&amp;gt; $1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi Guys,&lt;br&gt;
&amp;gt; &amp;gt; So I'm measuring Reflectance(v2) vs. Wavelength(v1) and &lt;br&gt;
&amp;gt; &amp;gt; need to find the thickness of my sample, for that I'm &lt;br&gt;
&amp;gt; &amp;gt; trying to use fitting to a function using the nonlinear &lt;br&gt;
&amp;gt; &amp;gt; square method to find couple of unknowns.&lt;br&gt;
&amp;gt; &amp;gt; If anyone can help please email me at nimakev@yahoo.com &lt;br&gt;
so &lt;br&gt;
&amp;gt; &amp;gt; I'll send you more information,&lt;br&gt;
&amp;gt; &amp;gt; any help is greatly appericiated.&lt;br&gt;
&amp;gt; &amp;gt;  &lt;br&gt;
&amp;gt; &amp;gt; thank you.&lt;br&gt;
&amp;gt; -------------&lt;br&gt;
&amp;gt;   I'm afraid my physics is a little rusty at this point.  &lt;br&gt;
You need to tell in what way &lt;br&gt;
&amp;gt; sample thickness is to depend on reflectance and &lt;br&gt;
wavelength in your fitting &lt;br&gt;
&amp;gt; model.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&amp;gt; &lt;br&gt;
Try the following&lt;br&gt;
write and save the following M-file&lt;br&gt;
function f=v2(p,v1)&lt;br&gt;
g=p(1);&lt;br&gt;
h=p(2)&lt;br&gt;
v2 = -a &amp;#8211; b*v1 &amp;#8211; c*(v1)^2 + d[1+(e/2d)cos((16.745*g/v1) + &lt;br&gt;
h)] Exp(-j/(v1)^2)&lt;br&gt;
&lt;br&gt;
on matlab main work space type&lt;br&gt;
p=[1 1];&lt;br&gt;
p=nlinfit(v1,v2,'f',p)&lt;br&gt;
this should give you the best fitted parameters g=p(1) and &lt;br&gt;
h=p(2)&lt;br&gt;
please tell me how do you find thickness from reflectance I &lt;br&gt;
need to know that&lt;br&gt;
Aasim Azooz&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
