|
From: Jon <dev...@gm...> - 2010-10-05 17:42:29
|
Pretty good hints! Thanks, 2010/10/5 Hans-Bernhard Bröker <HBB...@t-...> > On 04.10.2010 21:47, Federico Bergero wrote: > > Hi I'm trying to plot a discontinuous function like this > > > > f(x) = a1*x**2+b1*x+c1 for x in [t11,t12] > > f(x) = a2*x**2+b2*x+c2 for x in [t21,t22] > > f(x) = a3*x**2+b3*x+c3 for x in [t31,t32] > > .... > > .... > > ... > > where t11<=t12<=t21<=t22, etc > > > > and I don't know how to do it. > > Several ways possible. You could combine all functions into one using > the ? operator: > > f(x) = (x < t21) ? f1(x) : (x < t31) ? f2(x) : f3(x) > > Or you can plot each function individually, like you appear to be doing > now. > > > I've tried defining as many functions as intervals and making the > > function undefined (1/0) outside its interval and plotting each > > function (with persistent plot) > > Using multiplot for that is wrong. Just > > plot f1(x), f2(x), f3(x) > > > but it doesn't work when the intervals > > are small. > > So up the 'set samples'. > > Better yet, switch to parametric mode, map a common t interval [0:1] to > your individual t ranges, and then: > > x1(t) = t11+t*(t12-t11) > ... > > plot x1(t), f1(x1(t)), x2(t), f2(x2(t)), ... > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |