New package for drawing direction fields with gnuplot



Dnia Mon, 22 Nov 2010 16:54:09 -0500, Mark H Weaver napisa?(a):

> Adam Majewski <adammaj1 at o2.pl> writes:
>> f(zx,zy):=block([i:0,zx2,zy2,cx:0,cy:0,ER2:4,iMax:20],
>> zx2:zx*zx,zy2:zy*zy,
>> while zx2+zy2<ER2 and i<iMax do
>> (zy:2*zx*zy+cy,zx:zx2-zy2+cx,zx2:zx*zx,zy2:zy*zy,i:i+1), return(i));
> 
> It looks as though you are trying to approximate the Mandelbrot set, but
> if so, cx and cy should be the parameters of the function, and zx and zy
> should be locals initialized to 0.  As it is now, cx and cy are always
> 0, so why include them?
It is function for dynamical plane / filled Julia set.


...
> 
> Regarding the field lines: if you had a continuous potential function,
> you could easily compute its field by taking the gradient of the
> potential.  However, since your potential function is discrete,
> computing a gradient that behaves nicely is more tricky.  I'm not sure
> drawdf is the right tool for this job.

Now I see it. Thx for explanation.
Can you make a functions for discrete potential ?



Best 

Adam

> 
>     Best,
>      Mark
> 
> 
>> I have tried :
>>
>> drawdf('(f(x,y)), [x,-2,2], [y,-2,2]); drawdf('(f(x,y)), [x,-2,2],
>> [y,-2,2],soln_at(1,1));
>>
>> drawdf('(f(x,y)), [x,-2,2], [y,-2,2],equipots_at(1,1));
>>
>> I was expecting that field lines will be straight lines towards (0,0)
>> and equipotential lines will be concentric circles like on the left
>> image :
>> http://commons.wikimedia.org/w/index.php?title=File:Jung50e.png