baptiste auguie ba208exeteracuk dear list ive problem im looking general robust technique ive able imagine need find n typically n 3 5 zeros function polynomial specified interval code illustrates creating noisy curve three peaks different position magnitude width asymmetry x seq1 10 length500 examplefunction functionx create data peaks different scaling widths noise fano function p x y0 p1 a1 absp2 w1 absp3 x01 p4 q p5 b1 2 a1pi q w1 x x0124 x x012 w12 y0 b1 p1 c01 1 1 5 1 p2 c05 07 02 4 1 p3 c0 05 3 12 1 fanop1 x fanop2 x fanop3 x jittery a0005maxy examplefunctionx sampledf dataframex x withsampledf plotx tl three peaks located around x2 4 5 yspl smoothsplinex smooth noise linesyspl colred wish obtain zeros first second derivatives smoothed spline yspl use uniroot optim find one root find reliable way iterate find desired number solutions 3 peaks 2 inflexion points side ive used locator guesstimate disjoints intervals look solutions would like get rid unnecessary user input robust way finding predefined number solutions total interval something along lines findzeros function f numberofzeros 3 exclusioninterval c01 02 01 number solutions found less numberofzeros search root f union intervals excluding neighborhood solutions already found exclusioninterval could apply procedure first second derivatives yspl could also useful function many thanks remark suggestion baptiste _____________________________ baptiste auguié school physics university exeter stocker road exeter devon ex4 4ql uk phone 44 1392 264187 httpnewtonexacukresearchemag ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code thu 07 aug 2008 114907 0100 r recursive root finding