OT: Gnuplot - integrace prubehu

Petr Mikulik mikulik at monoceros.physics.muni.cz
Wed Apr 16 09:50:40 CEST 2003


> potreboval bych poradit od nekoho, kdo pouziva gnuplot.
> Muj problem je:
> Mam textovy soubor s namerenymi hodnotami, kde je ve sloupcich za sebou
> cas, zrychleni a otacky. A potreboval bych zobrazit prubeh otacek (to
> umim) a prubeh otacek ziskanych integraci ze zrychleni (to uz ne).
> Muze mi nekdo poradit jak na to?

Mozna neco takovehoto:


Re: series and products

> What I am looking for is sum and product functions like
> sum(f(x,i),i,0,n) = f(x,0) + f(x,1) + f(x,2) + ... + f(x,n)
>  and
> prod(f(x,i),i,0,n) = f(x,0) * f(x,1) * f(x,2) * ... * f(x,n)

You can do almost exactly that, by clever use of the builtin function
evaluator's capabilities:

define

        sum(a, b) = (a < b) ? sum_function(a) : sum(a+1, b)

and use it like this:

        # set the function to be summed up:
        sum_function(i)=f(x,i)
        # plot it:
        plot sum(0,23)

The numeric integration implemented in one of our demo scripts is
implemented the same way.



Pokud to nepomuze, tak pouzit externi skript -- napr:

plot '<awk -f muj_prepocet.awk data.dat'

kde blabla.awk muze byt neco jako
{ a += $2; print $1 a*$3 }

---
Petr Mikulik




More information about the csTeX mailing list