2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Look here. $\endgroup$ – march May 3 '16 at 17:35
0
$\begingroup$
(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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.