MathGroup Archive 2003

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

Search the Archive

Re: NonlinearFit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42161] Re: NonlinearFit
  • From: gohtk at rocketmail.com (goh tat kean)
  • Date: Sat, 21 Jun 2003 02:49:37 -0400 (EDT)
  • References: <bcrrkf$hp6$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Rees,

My suggested solution goes below:

data = {{0.1, 0.113387476}, {0.2, 0.194633152}, {0.3, 0.252848224}, {0.4, 
      0.294561145}, {0.5, 0.324449759}, {0.6, 0.345865887}, {0.7, 
      0.361211213}, {0.8, 0.37220662}, {0.9, 0.380085173}, {1.0, 0.385730403}};

To see how your data look like,

gr1 = ListPlot[data]

Load the NonlinearFit package,

<< Statistics`NonlinearFit`

Define your fit function as,

ft1 = NonlinearFit[data, c*(1 - Exp[-3*x/a]), x, {c, a}, ShowProgress -> True]

Note the correct way of exponential term is Exp[-3*x/a] not Exp(-3*x1/a).

c = 0.4, a = 0.9

Plot the fitted curve and show it together with your data.

gr2 = Plot[ft1, {x, 0, 1}]
Show[gr1, gr2]

Good luck.

Regards,
tat kean





civnrn at hotmail.com (Rees) wrote in message news:<bcrrkf$hp6$1 at smc.vnet.net>...
> Hi,
> 
> Please could someone assist me in curve fitting.
> 
> I have the following x,y data
> 
> data = {{0.1,0.113387476}, {0.2, 0.194633152}, {0.3, 
>       0.252848224}, {0.4, 0.294561145}, {0.5, 
>       0.324449759}, {0.6, 0.345865887}, {0.7, 
>       0.361211213}, {0.8, 0.37220662}, {0.9, 
>       0.380085173}, {1.0, 0.385730403}};
> 
> Now I wish to fit an exponential curve of the form below to it:
> 
> c*[1-Exp(-3x/a]
> 
> where c and a are parameters to be determined.
> 
> I tried the following but it doesn't work:
> 
> NonlinearFit[data, c*(1 - Exp(-3*x1/a)), {x1}, {c, a}]
> 
> 
> Please advise.
> 
> Thanks is advance
> 
> Rees


  • Prev by Date: Re: NonlinearFit
  • Next by Date: Re: Mathlink performance and task switches
  • Previous by thread: Re: NonlinearFit
  • Next by thread: NonlinearFit