Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. circle = Disk[{4.5, 3}, 0.5];
  2. pin = Rectangle[{4, 0}, {5, 3}];
  3. square = Rectangle[{0, 0}, {9, 9}];
  4. region = RegionDifference[square, RegionUnion[circle, pin]];
  5.  
  6. sol = NDSolveValue[{D[u[x, y], x, x] + D[u[x, y], y, y] == 0,
  7. bc},
  8. u, {x, y} [Element] region]
  9.  
  10. DensityPlot[sol[x, y], {x, y} [Element] region, Mesh -> None,
  11. ColorFunction -> "Rainbow", PlotRange -> All,
  12. PlotLegends -> Automatic]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement