3
$\begingroup$

I am trying to fit a complex data with a complex function, with the real fitting parameters. I was trying to put there constraints like this, but I got error:

FindFit[data,{1-a/(b-x^2-I*c*x),{Element[{a,b,c},Reals]}},{a,b,c},x] 

If I remove constraints, I get in general complex parameters.

$\endgroup$
3
  • $\begingroup$ Are you xs complex too? $\endgroup$ Commented Feb 26, 2015 at 15:47
  • $\begingroup$ No, they are real. $\endgroup$ Commented Feb 26, 2015 at 17:11
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) Browse common pitfalls. 2) As you receive help, try to give it too, by answering questions in your area of expertise. 3) Take the tour and check the help center! 4) When you see good questions and answers, vote them up using the triangles. Also, please remember to accept an answer if it solves your problem, by clicking the checkmark! $\endgroup$ Commented Feb 26, 2015 at 17:28

1 Answer 1

2
$\begingroup$

The following works quite well:

k = 1 - a/(b - x^2 - I*c*x); t = Table[{x, k /. {a -> 10, b -> 5, c -> 2}}, {x, 1, 50}]; FindFit[t, {k, (a | b | c) ∈ Reals}, {a, b, c}, x, NormFunction -> (Norm@## &)] (* {a -> 9.99976, b -> 4.99994, c -> 1.99994} *) 
$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.