X-Received: by 10.99.101.196 with SMTP id z187mr8910697pgb.153.1480287402264; Sun, 27 Nov 2016 14:56:42 -0800 (PST) X-Received: by 10.157.8.134 with SMTP id 6mr459824otf.17.1480287402180; Sun, 27 Nov 2016 14:56:42 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!n6no2025155qtd.0!news-out.google.com!m27ni3472qtf.1!nntp.google.com!n6no2025150qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Sun, 27 Nov 2016 14:56:41 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=188.20.239.46; posting-account=8aAfcQoAAAAFyM529Tf50ab4Op9511Om NNTP-Posting-Host: 188.20.239.46 References: <4ad61db7-dd62-4b0f-8bb6-ffa3305505fb@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: linear fit of looped (and cutted) data set From: =?UTF-8?Q?Markus_Gr=C3=BCnwald?= Injection-Date: Sun, 27 Nov 2016 22:56:42 +0000 Content-Type: text/plain; charset=UTF-8 Xref: csiph.com comp.graphics.apps.gnuplot:3488 Am Sonntag, 27. November 2016 20:29:46 UTC+1 schrieb Ethan A Merritt: > Looks like maybe you want to fit the first derivative of the > trajectory rather than fitting the trajectory itself. Good advice. After little research and help of following blog https://stackoverflow.com/questions/15751226/how-can-i-plot-the-derivative-of-a-graph-in-gnuplot if done following: [code] limitlo(x,lo) = (x > lo) ? x : 0/0 limithi(x,hi) = (x < hi) ? x : 0/0 limitlohi(x,lo,hi) = limitlo(limithi(x,hi),lo) d2(x,y) = ($0 == 0) ? (x1 = x, y1 = y, 1/0) : (x2 = x1, x1 = x, y2 = y1, y1 = y, (y1-y2)/(x1-x2)) dx=.5; ylo=550; yhi=2500 fit [0:20] kwm "Data.txt" using ($2-dx):(d2($2,(limitlohi($3,ylo,yhi)))) via kwm fm(x) = kwm*x + dwm fit [0:20] [ylo:yhi] fm(x) "Data.txt" using 2:3 via dwm [/code] and now i got quite what i expected to.