# How to implement Plot3D on a result of operator?

Posted 9 years ago
5336 Views
|
2 Replies
|
1 Total Likes
|
 HelloCan you please address the following question?I would like to implement Plot3D on a result of an operator. Specifically, please find below the following code, which consists of the following: define a Laplacian operator in 2D calculate the result of applying it to the specified function apply Plot3D  oper = (D[#1, x, x] + D[#1, y, y]) &; f[x, y] == oper[Sin[x] Sin[y]]; Plot3D[oper[Sin[x] Sin[y]], {x, 0, 10}, {y, 0,10}] The code above fails to plot. However, the following code succeeds  oper = (D[#1, x, x] + D[#1, y, y]) &; f[x, y] == oper[Sin[x] Sin[y]]; Plot3D[oper[Sin[x] Sin[y]] /. {x -> k, y -> l}, {k, 0, 10}, {l, 0,10}]  Can you please indicate why avoiding replacement doesn't work?
2 Replies
Sort By:
Posted 9 years ago
 Hello, I am not sure what the purpose of "f[x, y] == oper[Sin[x] Sin[y]];" is for, but this will work: oper = (D[#1, x, x] + D[#1, y, y]) & Plot3D[Evaluate[oper[Sin[x] Sin[y]]], {x, 0, 10}, {y, 0, 10}] Plot and related functions have the property of HoldFirst---the upshot is that you need to Evaluate explicitly.I think if you google Mathematica and Plot and Evaluate, you will see some excellent discussions of this.
Posted 9 years ago
 Thank you very much for the answer.