• User function in "using" expression

    From layzarc@aol.com@21:1/5 to All on Wed Aug 28 12:01:04 2019
    I'm trying to use gnuplot to solve a specific version of the problem

    3d plot z(x,y) with x,ys subject to the constraint f(x,y)=0

    The following works (the files are 0 contours captured by set table)

    array n[6]
    file(i) = sprintf("coma%d.gpt",i)
    splot for [i=1:|n|] file(i) using 1:2:(0):(0):(0):(1) with vectors

    but if I also do:

    phi(x,y) = (1+x)/(1+sqrt(1+(x*x-1)*y))
    spher(n,x,y) = (f=phi(x,y),n2=n*n,((f-n)^2*(f-n2)*(1-y*f)-f^3)/(n2*(n-1)^3)) splot for [i=1:|n|] file(i) using 1:2:(0):(0):(0):(spher(n[i],$1,$2)) with vectors

    I get the following message:

    non-integer passed to boolean operator

    What am I missing? I can provide the full file if needed.

    Al

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From layzarc@aol.com@21:1/5 to All on Wed Aug 28 13:09:57 2019
    Karl,

    Duh! I knew that but copied the expression from another software and forgot to make the changes. Advantage of having a second set of eyes.

    Thanks,
    Al

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl Ratzsch@21:1/5 to All on Wed Aug 28 22:01:23 2019
    Am 28.08.2019 um 21:01 schrieb layzarc@aol.com:
    I'm trying to use gnuplot to solve a specific version of the problem

    3d plot z(x,y) with x,ys subject to the constraint f(x,y)=0

    The following works (the files are 0 contours captured by set table)

    array n[6]
    file(i) = sprintf("coma%d.gpt",i)
    splot for [i=1:|n|] file(i) using 1:2:(0):(0):(0):(1) with vectors

    but if I also do:

    phi(x,y) = (1+x)/(1+sqrt(1+(x*x-1)*y))
    spher(n,x,y) = (f=phi(x,y),n2=n*n,((f-n)^2*(f-n2)*(1-y*f)-f^3)/(n2*(n-1)^3)) splot for [i=1:|n|] file(i) using 1:2:(0):(0):(0):(spher(n[i],$1,$2)) with vectors

    I get the following message:

    non-integer passed to boolean operator

    the exponential operator in gnuplot is ** , not ^

    I didnt know about this one

    | |A| cardinality of array A

    thanks. ;)

    Karl

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl Ratzsch@21:1/5 to All on Wed Aug 28 21:53:06 2019
    Am 28.08.2019 um 21:01 schrieb layzarc@aol.com:
    I'm trying to use gnuplot to solve a specific version of the problem

    3d plot z(x,y) with x,ys subject to the constraint f(x,y)=0

    The following works (the files are 0 contours captured by set table)

    array n[6]
    file(i) = sprintf("coma%d.gpt",i)
    splot for [i=1:|n|] file(i) using 1:2:(0):(0):(0):(1) with vectors

    but if I also do:

    phi(x,y) = (1+x)/(1+sqrt(1+(x*x-1)*y))
    spher(n,x,y) = (f=phi(x,y),n2=n*n,((f-n)^2*(f-n2)*(1-y*f)-f^3)/(n2*(n-1)^3)) splot for [i=1:|n|] file(i) using 1:2:(0):(0):(0):(spher(n[i],$1,$2)) with vectors

    I get the following message:

    non-integer passed to boolean operator

    What am I missing? I can provide the full file if needed.

    Al


    gnuplot uses

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)