0
$\begingroup$

I found a picture for example in google and I want to do with my code like that: enter image description here

And here is my code:

\[CapitalOmega] = Rectangle[{0, 0}, {1, 1}];
op = Laplacian[u[x, y], {x, y}] + 2;
Subscript[\[CapitalGamma], 
D] = {DirichletCondition[u[x, y] == 0, True]};
\[CapitalPhi] = 
NDSolveValue[{op == 0, Subscript[\[CapitalGamma], D]}, 
u, {x, y} \[Element] \[CapitalOmega]];
Plot3D[\[CapitalPhi][x, y], {x, y} \[Element] \[CapitalOmega], 
PlotStyle -> None]
$\endgroup$
4
  • $\begingroup$ @Kuba Sorry, I didnt saw that... $\endgroup$
    – wlkyr
    Commented Apr 17, 2015 at 17:41
  • $\begingroup$ Don't worry. p.s. deleted link by mistake: mathematica.stackexchange.com/q/27083/5478 $\endgroup$
    – Kuba
    Commented Apr 17, 2015 at 17:42
  • $\begingroup$ The LaTeX Code to reproduce OP`s picture Bivariate normal distribution. $\endgroup$
    – user9660
    Commented Apr 17, 2015 at 17:46
  • $\begingroup$ @Lou Thanks, but I want to solve it with Mathematica $\endgroup$
    – wlkyr
    Commented Apr 17, 2015 at 17:48

1 Answer 1

2
$\begingroup$

Use ParametricPlot3D to create the integrated curves as parametric curves along the lines {x,1} and {y,0}. Then use Show to combine the objects together.

\[CapitalOmega] = Rectangle[{0, 0}, {1, 1}];
op = Laplacian[u[x, y], {x, y}] + 2;
Subscript[\[CapitalGamma], D] = {DirichletCondition[u[x, y] == 0, True]};
\[CapitalPhi] = NDSolveValue[{op == 0, Subscript[\[CapitalGamma], D]}, u, {x, y} \[Element] \[CapitalOmega]];
graph1 = Plot3D[\[CapitalPhi][x, y], {x, y} \[Element] \[CapitalOmega], PlotStyle -> None]
xint[y_] := Integrate[\[CapitalPhi][x, y], {x, 0, 1}]
yint[x_] := Integrate[\[CapitalPhi][x, y], {y, 0, 1}]
Show[ParametricPlot3D[{0, y, xint[y]}, {y, 0, 1}], 
ParametricPlot3D[{x, 1, yint[x]}, {x, 0, 1}], graph1, 
PlotRange -> {{0, 1}, {0, 1}, All}]

Result:

Surface plot with background curves

$\endgroup$

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