|
From: Marek W. G. <gu...@if...> - 2008-02-15 18:35:21
|
I'm trying to plot two identical functions, f(x) and g(x). f(x) is defined as
a single, looong expression, while g(x) is defined as a composition of several
simpler functions. Yet, as you can see in the picture attached - f(x) and g(x)
look differently. g(x), made of smaller chunks of code, is correct.
Why are they different?
Is there any limit for the length of the expression defining a function??
Intrigued,
Marek Gutowski
gnuplot> show funct
User-Defined Functions:
f(x)=(pi*(1.0-0.5/(x**2))+2.0*atan(2.0*x)/(x**2)-2.0*(1.0+0.25/(x**2))*atan(4.0*x)-10.0*atan(0.25/x)+4.0*(1.0+0.25/(x**2))*atan(0.5/x)+2.0*log((1.0+4.0*x**2)/(1.0+16.0*x**2)))/(-2.0*pi)
f1(x)=pi*(1.0-0.5/(x**2))
f2(x)=2.0*atan(2.0*x)/(x**2)
f3(x)=-2.0*(1.0+0.25/(x**2))*atan(4.0*x)
f4(x)=-10.0*atan(0.25/x)
f5(x)=4.0*(1.0+0.25/(x**2))*atan(1.0/(2.0*x))
f6(x)=2.0*log((1.0+4.0*x**2)/(1.0+16.0*x**2))/x
g(x)=-(f1(x)+f2(x)+f3(x)+f4(x)+f5(x)+f6(x))/(2.0*pi)
gnuplot> plot [0.0001:10.0] g(x) w l 3, f(x) w l 6
I am working with
G N U P L O T
Version 4.0 patchlevel 0
last modified Thu Apr 15 14:44:22 CEST 2004
System: Linux 2.6.18-6-k7
Yes, I know there is a newer version but my Debian Linux is rather conservative
and I stick strictly to the stable distribution. The processor is Athlon XP2000+
--
Marek W. Gutowski
Institute of Physics, ON-3.2, Al. Lotnikow 32/46
02-668 Warszawa, POLAND, tel. +48-22-0228436601 ext. 3122
>> To talk or not to talk? Yes, talk, plain ASCII please <<
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|