Re: FindFit
- To: mathgroup at smc.vnet.net
- Subject: [mg105824] Re: [mg105797] FindFit
- From: Thomas Dowling <thomasgdowling at gmail.com>
- Date: Sun, 20 Dec 2009 06:56:18 -0500 (EST)
- References: <200912191126.GAA24631@smc.vnet.net>
Hello, I think there a few ways of approaching this problem. 1. The following are the data data = {{40, 0.0624}, {50, 42.2 .276}, {58, 127.718}, {60, 216.608}, {70, 2040.088}}; 2. Use ListPlot to 'take a look': dataplot = ListPlot[data, PlotMarkers -> {Style["\[FilledSquare]", Red], 10}, AxesOrigin -> {0, 0}] 3. The data may be fitted to the exponential function as follows (note that initial values have been chosen) Clear[a, k]; model = ao E^(k t); soln = FindFit[data, model, { {ao, 4}, {k, 0.05}}, t] 4. A fitted equation may now be generated fittedeqn = ao E^ (k t) /. soln 5. 'Take a look' at the fitted plot plotfitted = Plot[fittedeqn, {t, 0, Max[data[[All, 1]]] + 15}, PlotStyle -> {Green}, AxesOrigin -> {0, 0}] 5. 'Show both plots superimposed: Show[dataplot, plotfitted] 6.( Do you need to show a data point for time zero?) Tom Dowling On Sat, Dec 19, 2009 at 11:26 AM, jj <yohan2 at spray.se> wrote: > Can anybody help me? > I want to try to show my model (function) and my data in the same > graph so I can see that my conclusions are correct. > data= { {40,0.0624}, {50,42.2.276}, {58,127.718}, {60,216.608}, > {70,2040.088}, > I used FindFit for Exponential as my model to plot: > t200= {Exp200} > > t200= {Exp300} > > model=aExp[kt]; > > fit=FindFit[data,model,{a,k},t] > > Best regads jj > >
- References:
- FindFit
- From: jj <yohan2@spray.se>
- FindFit