Re: FindFit and complex function?
- To: mathgroup at smc.vnet.net
- Subject: [mg80575] Re: FindFit and complex function?
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Sun, 26 Aug 2007 03:10:32 -0400 (EDT)
On 8/24/07 at 2:04 AM, mignatov at chemistry.ohio-state.edu (Michael Ignatov) wrote: >I have ran into a problem of fitting my experimental data points to >a function in mathematica. The function comes from a solution of >five algebraic equations with 5 variables. Very straight forward. >Unfortunately cubic roots are present in the solution so when the >function is evaluated at fixed parameters it always return a small >imaginary part with the real part. The real parts are quite >meaningful and imaginary parts are extremely small. For all >practical purposes I can just drop the imaginary part. When I build >a model function, which is just a linear combination of 5 solutions, >I can evaluate it with fixed parameters and see that it describes my >experimental points rather well. But FindFit fails to perform a >search always stopping at the starting value. Any ideas on how to >either drop imaginary part of the function completely or make >FindFit work with a function that returns complex numbers? It isn't entirely clear to me what expression you are trying to fit your data to. It sounds like you may be using a polynomial. If so, that tends to be numerically unstable. Try replacing the polynomial with a linear combination of Chebyshev functions. This will be much more stable and may eliminate your problems with spurious imaginary parts. -- To reply via email subtract one hundred and four