MathGroup Archive 2006

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

Search the Archive

Re: damped oscilations data fit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70540] Re: damped oscilations data fit
  • From: "ben" <benjamin.friedrich at gmail.com>
  • Date: Thu, 19 Oct 2006 03:22:02 -0400 (EDT)
  • References: <eh4ntl$7sb$1@smc.vnet.net>

Hi Miro,

use FindFit

In[45]:=
list={{0,54},{120,56.5},{230,56},{305,54},{340,53},{360,52.7},{378,52.5},{405,
        52.5},{443,53},{480,53.5},{510,54},{540,54.7},{570,54.4},{602,

56},{643,56.5},{660,56.5},{685,56.25},{706,56},{727,55.25},{743,

55.5},{756,55.25},{775,55},{787,54.75},{799,54.5},{814,54.25},{828,
        54},{845,53.75},{858,53.5},{877,53.25},{894,53},{923,52},{951,
        53},{983,53.5},{1014,54}};

In[14]:=
model=Exp[-\[Lambda] t](a Cos[\[Omega] t]+b Sin[\[Omega] t])+c;

In[47]:=
\!\(fit =
    FindFit[list,
      model, {{\[Lambda], 0}, {\[Omega], \(2  \[Pi]\)\/1000}, {a, 2},
{b,
          0}, {c, Mean[list[\([All, 2]\)]]}}, t]\)

Out[47]=
{\[Lambda]\[Rule]0.000469179,\[Omega]\[Rule]0.0120411,a\[Rule]-0.510182,
  b\[Rule]2.31158,c\[Rule]54.3103}

In[48]:=
Show[
    ListPlot[list,DisplayFunction\[Rule]Identity],

Plot[model/.fit//Evaluate,{t,0,1000},DisplayFunction\[Rule]Identity],
    DisplayFunction\[Rule]$DisplayFunction];

It is essential to provide reasonable starting values for the
parameters.

Bye
Ben

Miroslav Hý?a schrieb:

> hello,
> I have one question about data manipulation in mathematica.
> I've got set of experimental data. Data describe damped oscillation. My question is following:
>
> How can I fit these data?
> I would like to get formula of function which will approximately describe my data and plot this function.
>
> my data list:
> {{0, 54}, {120, 56.5}, {230, 56}, {305, 54}, {340, 53}, {360, 52.7}, {378, 52.5}, {405, 52.5}, {443, 53}, {480, 53.5}, {510, 54}, {540, 54.7}, {570, 54.4}, {602, 56}, {643,56.5}, {660, 56.5}, {685, 56.25}, {706, 56}, {727, 55.25}, {743, 55.5}, {756, 55.25}, {775, 55}, {787, 54.75}, {799, 54.5}, {814, 54.25}, {828, 54}, {845, 53.75}, {858, 53.5}, {877, 53.25}, {894, 53}, {923, 52}, {951, 53}, {983, 53.5}, {1014, 54}}
>
> Have anyone an idea?
> I'm mathematica beginner therefore I'll be grateful for any suggestion.
> Thanks
> <<mira


  • Prev by Date: Re: damped oscilations data fit
  • Next by Date: Re: damped oscilations data fit
  • Previous by thread: Re: damped oscilations data fit
  • Next by thread: Re: damped oscilations data fit