4

Need to understand the principle of the distinction between f[x_,y_] and f[x_][y_]

It seems also that

z[x_, y_][a_, b_, c_][α_, β_] :=  a (x + y)^b + c/(α-β)

is interpreted by Mathematica since

Plot3D[z[x, y][2, 5, 3][2, 4], {x, 0, 1}, {y, 0, 1}]

gives a nice plot. It could be useful to distinguish between variables and two types of parameters. But, in that case, how to use association like

data1 = Association[Thread[{"a", "b", "c"} -> {.5, 1, 1}]]
data2 = Association[Thread[{"α", "β"} -> {.2, 3}]] 

--- how to use Apply --- @@ ---

NB David Park shows to me that how to do in the simple following case

b[x_][y_] := x^y
da = Association[Thread[{"x"} -> {.5}]]
(b @@ Values[da])[y]

If the association is on the first bracket-couple I can reproduce the example, but I do not know how to do it for a second bracket association.

Karsten7
  • 27,448
  • 5
  • 73
  • 134
cyrille.piatecki
  • 4,582
  • 13
  • 26

1 Answers1

0
(z[x, y]@@(Values[data1]))@@(Values[data2])
(* or  z[x, y][##&@@(Values[data1])][##&@@(Values[data2])] *)

-0.357143+0.5 (x+y)

Plot3D[(z[x, y]@@(Values[data1]))@@(Values[data2]), {x, 0, 1}, {y, 0, 1}]
(* or Plot3D[z[x, y][##&@@(Values[data1])][##&@@(Values[data2])], {x, 0, 1}, {y, 0, 1}]*)

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896