Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'apply assumptions to NonlinearModelFit' topicStudent Support Forum > General > "apply assumptions to NonlinearModelFit"

Help | Reply To Topic
Author Comment/Response
Brian
09/16/10 02:13am

I am dealing with some electorchemical data, and the output of a package program (plus experiment apparatus) is in the form of
{frequency,real part,imaginary part}

it is a large array of different frequencies (about 128)

I am trying to fit the data to a electric model based on RLC circuit elements.
But i can't get Mathematica to do what i want
When i use the function NonlinearModelFit, all the best fit parameters will contain real and imaginary parts. But what I want is a set of best fit parameters that are purely real.

I tried a test code as follows:
---------------
data = {{1, 1, 2}, {3, 2, 4}, {3, 3, 6}, {9, 4, 9}, {12, 5, 11}};

dataF = Transpose[{data[[All, 1]], data[[All, 2]] + I data[[All, 3]]}];

model = I a \[Omega]+ b;

fit = NonlinearModelFit[dataF,{model},{a,b},\[Omega]]
----------------
I want a,b to be real numbers
but what is rendered is a complex number (real part+imaginary part)

Q:How do i let Mathematica fit a,b such that a,b are both real numbers?

Attachment: Untitled-4.nb, URL: ,
Help | Reply To Topic