Discussion:
Intermediate variables in user functions
(too old to reply)
l***@aol.com
2019-08-25 13:33:35 UTC
Permalink
I have a script that works beautifully that has the following function definitions:

phi(x,y) = (1+x)/(1+sqrt(1+(x*x-1)*y))
astig(n,x,y) = phi(x,y)*(1-phi(x,y)*y)*(n-1)**2-(phi(x,y)-n*n)*(n-1+y*(phi(x,y)-n))**2

It would be a lot cleaner if the following was possible:

phi(x,y) = (1+x)/(1+sqrt(1+(x*x-1)*y))
astig(n,x,y) = f=phi(x,y) f*(1-f*y)*(n-1)**2-(f-n*n)*(n-1+y*(f-n))**2

Al
Ethan Merritt
2019-08-25 17:46:21 UTC
Permalink
Post by l***@aol.com
phi(x,y) = (1+x)/(1+sqrt(1+(x*x-1)*y))
astig(n,x,y) = phi(x,y)*(1-phi(x,y)*y)*(n-1)**2-(phi(x,y)-n*n)*(n-1+y*(phi(x,y)-n))**2
phi(x,y) = (1+x)/(1+sqrt(1+(x*x-1)*y))
astig(n,x,y) = f=phi(x,y) f*(1-f*y)*(n-1)**2-(f-n*n)*(n-1+y*(f-n))**2
Al
Use the serial evaluation operator (a,b):

astig(n,x,y) = (f=phi(x,y) , f*(1-f*y)*(n-1)**2-(f-n*n)*(n-1+y*(f-n))**2)
l***@aol.com
2019-08-25 19:21:21 UTC
Permalink
Ethan,

Been using Gnuplot for years but somehow missed that feature.

Thanks,
Al

Loading...