piecewised funktion

piecewised funktion

Post by Klau » Wed, 23 Jul 2003 21:28:14



hello,

if i define a piecewised function:

f1(x) = x>=0 && x<=pi ? 1 : 1/0

the function do not start at (x=0,y=1) but at (x + dx, y=1)
it looks as if it is x>0 than x>=0.

why do the function do not start at (0,1)?

how can i achieve this?

thanks!

klaus

 
 
 

piecewised funktion

Post by Hans-Bernhard Broeke » Wed, 23 Jul 2003 21:33:19



> hello,
> if i define a piecewised function:
> f1(x) = x>=0 && x<=pi ? 1 : 1/0
> the function do not start at (x=0,y=1) but at (x + dx, y=1)
> it looks as if it is x>0 than x>=0.

That almost certainly has nothing to do with the function, but with
the way you're plotting it.  More precisely, with the way gnuplot
selects 'x' positions to calculate the functions' value at.  If x==0
doesn't happen to be one of the positions the function is "sampled"
at, you won't see the sharp corner of it.  Same at the other end
around x==pi (but there, it's harder to notice).

So: check your xrange and 'set samples' settings, or live with the
fact that infinite precision like what you're asking for is usually
impossible in numerical maths.
--

Even if all the snow were burnt, ashes would remain.

 
 
 

piecewised funktion

Post by Klau » Wed, 23 Jul 2003 22:11:02




Quote:> So: check your xrange and 'set samples' settings, or live with the
> fact that infinite precision like what you're asking for is usually
> impossible in numerical maths.

(dx was maybe not the right expression, it is more than an infinite dx...)

which samplingrate is useful?
or which is disproportionate?

klaus

 
 
 

piecewised funktion

Post by Hans-Bernhard Broeke » Wed, 23 Jul 2003 22:20:35



> (dx was maybe not the right expression, it is more than an infinite dx...)

An infinitely *small* delta_x, to be even more precise.  Which would
take an infinite amount of time to use, because there would be
infinitely many function evaluations to be done in any finite x range.
I hope you see where this is heading: it's simply impossible.

Quote:> which samplingrate is useful?

Whatever fits your bill.  Anything larger than the horizontal
resolution of your output format (screen, paper, whatever) is usually
a complete waste of effort, though.

If you want a sample at exactly x==0, you have to manually adjust the
x range and 'set samples' to get one there.  For demonstration, try:

        set xrange [-10:10]
        set samples 5
        plot x

        pause -1 'Look at plot, then press a key'

        set samples 6
        replot

and see the difference.
--

Even if all the snow were burnt, ashes would remain.

 
 
 

1. suche spezial grafik-funktion

Ich bin auf der suche nach einem Graphik-Tool
bzw. einem Graphik-Programm, welches die Funktion
untersttzt, aus einem Bild (256 Farbe Modus)
die Vorkommis der einzelnen Farben, also die
Anzahl der Pixel jeder einzelnen Farbe, auflistet.

Welches kommerzielle Programm oder welches Freeware
Programm untersteutzt so eine Funktion. Wuerde mich
ueber jeden hinweis freuen.


2. How to coding B/W Graphic Dither?

3. looking for a spezial funktion

4. Plots "with lines" & Normalisation problems

5. looking for a speacial funktion

6. 100% K in two color sep

7. drawing a curve - search a funktion or formular

8. obj nurbs export

9. InterestRate - Funktion