Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

FindFit ODE with Constraints

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88994] FindFit ODE with Constraints
  • From: Jack Waddell <seoc at umich.edu>
  • Date: Fri, 23 May 2008 03:07:21 -0400 (EDT)

I'm trying to combine two features of FindFit.  The first is constraining the fitting parameters,e.g.

fit = FindFit[data, {model, {a > 0, 1 < \[Omega] < 2}}, {a, \[Omega]}, t]

The second is fitting using the numerical solution to an ODE, e.g.

fit = FindFit[data, model[\[Gamma], a, b][x], {{\[Gamma], .1}, {a, .1}, {b, 1}}, x, PrecisionGoal -> 4, AccuracyGoal -> 4]


However, the straightforward combination of the two fails:

fit = FindFit[data, {model[\[Gamma], a, b][x], {a > 0}}, {{\[Gamma], .1}, {a, .1}, {b, 1}}, x, PrecisionGoal -> 4, AccuracyGoal -> 4]

Out[8]: FindFit[{{0., 2.00953}, {0.2, 1.94523}, {0.4, 1.66468}, {0.6, 1.24228}, {0.8, 0.877598}, {1., 0.441058}, {1.2, 0.0715144}, {1.4, -0.296832}, {1.6, -0.594285}, {1.8, -0.866026}, {2., -1.13808}, {2.2, -1.39392}, {2.4, -1.41179}, <it goes on like this for a while with the data...>, }, {model[\[Gamma], a, b][x], {a > 0}}, {{\[Gamma], 0.1}, {a, 0.1}, {b, 1}}, x, PrecisionGoal -> 4, AccuracyGoal -> 4]

It take it to mean that the command is not recognized with this syntax.  Is there a way to do this?

Thanks,
Jack Waddell


  • Prev by Date: Re: circuit grid
  • Next by Date: Re: Re: Cannot NSolve a system of equations
  • Previous by thread: Re: Sluggish performance in Save, bug?
  • Next by thread: Please Help with Sums with the same StandardForm but different InputForm